/* =========================
   PAGE LAYOUT
========================= */
.page-shell {
    background: linear-gradient(180deg, #f8fafc 0%, #eef4ff 100%);
    min-height: calc(100vh - 100px);
    margin: -1rem;
    padding: 1rem;
}

@media (min-width: 768px) {
    .page-shell {
        margin: -1.5rem;
        padding: 1.5rem;
    }
}

.page-header-clean {
    margin-bottom: 1.25rem;
}

.page-title-clean {
    font-size: 1.4rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: .2rem;
}

.page-subtitle-clean {
    color: #64748b;
    margin-bottom: 0;
    font-size: .92rem;
}

/* =========================
   GENERIC CARD / PANEL
========================= */
.ui-card {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 24px;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.05);
}

.panel-clean,
.panel-card {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 24px;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.05);
    overflow: hidden;
    height: 100%;
}

.panel-clean-header,
.panel-header {
    padding: 22px 24px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.05);
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.panel-clean-title,
.panel-title-clean {
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: .2rem;
}

.panel-clean-subtitle,
.panel-subtitle-clean {
    color: #64748b;
    font-size: .9rem;
    margin-bottom: 0;
}

.panel-body {
    padding: 24px;
}

.panel-clean-footer {
    padding: 14px 24px 24px;
}

/* =========================
   SUMMARY CARD
========================= */
.summary-card {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 22px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.05);
    padding: 18px;
    height: 100%;
}

.summary-label {
    font-size: .78rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 700;
    margin-bottom: .45rem;
}

.summary-value {
    font-size: 1.55rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
    margin-bottom: .35rem;
}

.summary-meta {
    font-size: .84rem;
    color: #64748b;
    margin: 0;
}

/* =========================
   SEARCH + FILTER + BUTTON
========================= */
.search-clean {
    position: relative;
    min-width: 280px;
}

.search-clean input {
    height: 46px;
    padding-left: 42px;
    border-radius: 14px;
    border: 1px solid #dbe3ef;
    background: #f8fafc;
    box-shadow: none;
}

.search-clean input:focus {
    background: #fff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.08);
}

.search-clean i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
}

.btn-filter-clean {
    height: 46px;
    border-radius: 14px;
    border: 1px solid #dbe3ef;
    background: #fff;
    color: #334155;
    font-weight: 700;
    padding: 0 16px;
}

.btn-add-clean,
.quick-btn {
    height: 46px;
    border-radius: 14px;
    font-weight: 700;
    padding: 0 18px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.filter-pill {
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #fff;
    color: #334155;
    border-radius: 999px;
    padding: .48rem .9rem;
    font-size: .82rem;
    font-weight: 700;
    transition: .2s ease;
}

.filter-pill:hover,
.filter-pill.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

/* =========================
   FOOTER / PAGINATION
========================= */
.footer-card-clean {
    border: 1px solid rgba(15, 23, 42, 0.05);
    background: #f8fafc;
    border-radius: 18px;
    padding: 16px 18px;
}

.rows-select-clean {
    width: 180px;
    border-radius: 12px;
    border-color: #dbe3ef;
    background: #fff;
}

.pagination-clean .btn {
    width: 38px;
    height: 38px;
    border-radius: 12px !important;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* =========================
   EMPTY STATE
========================= */
.empty-state-clean {
    padding: 56px 24px;
    text-align: center;
}

.empty-state-clean .icon {
    width: 76px;
    height: 76px;
    border-radius: 22px;
    margin: 0 auto 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
    color: #2563eb;
    font-size: 1.9rem;
}

/* =========================
   DASHBOARD HERO
========================= */
.hero-card {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    padding: 30px;
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.22), transparent 24%),
        radial-gradient(circle at bottom left, rgba(16, 185, 129, 0.18), transparent 30%),
        linear-gradient(135deg, #0f172a 0%, #111827 45%, #1e293b 100%);
    color: #fff;
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.18);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .48rem .85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .10);
    border: 1px solid rgba(255, 255, 255, .08);
    color: rgba(255, 255, 255, .92);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-title {
    font-size: 2rem;
    line-height: 1.15;
    font-weight: 800;
    color: #fff;
    margin-bottom: .75rem;
}

.hero-subtitle {
    color: rgba(255, 255, 255, .74);
    max-width: 760px;
    margin-bottom: 1.5rem;
    font-size: .96rem;
}

.hero-mini-card {
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 18px;
    padding: 16px;
    height: 100%;
}

.hero-mini-card .label {
    color: rgba(255, 255, 255, .65);
    font-size: .78rem;
    margin-bottom: .2rem;
}

.hero-mini-card .value {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 800;
}

/* =========================
   DASHBOARD SECTION
========================= */
.section-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: .2rem;
}

.section-subtitle {
    color: #64748b;
    font-size: .92rem;
    margin-bottom: 0;
}

.step-card {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 22px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
    padding: 22px;
    height: 100%;
    transition: .25s ease;
}

.step-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
}

.step-number {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .95rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 1rem;
}

.step-card h5 {
    font-size: 1rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: .45rem;
}

.step-card p {
    color: #64748b;
    font-size: .92rem;
    margin-bottom: 1rem;
}

.step-link {
    font-size: .88rem;
    font-weight: 700;
    text-decoration: none;
}

/* =========================
   METRIC CARDS
========================= */
.metric-card {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    border: 0;
    min-height: 170px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.10);
    color: #fff;
}

.metric-card .card-body {
    padding: 20px;
}

.metric-label {
    font-size: .78rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .72);
    font-weight: 700;
    margin-bottom: .85rem;
}

.metric-value {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: .75rem;
    color: #fff;
}

.metric-desc {
    color: rgba(255, 255, 255, .78);
    font-size: .88rem;
    margin-bottom: 0;
}

.metric-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    padding: .35rem .7rem;
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 700;
}

.metric-icon {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45rem;
    background: rgba(255, 255, 255, .14);
    color: #fff;
}

.bg-blue {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.bg-green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.bg-slate {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
}

.bg-cyan {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}

.bg-red {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.bg-orange {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.bg-purple {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.bg-emerald {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

/* =========================
   DASHBOARD STATUS / SUMMARY
========================= */
.status-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.status-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.05);
}

.status-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.status-title {
    font-size: .92rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: .1rem;
}

.status-subtitle {
    font-size: .82rem;
    color: #64748b;
    margin: 0;
}

.status-value {
    font-size: .95rem;
    font-weight: 800;
    color: #0f172a;
}

.summary-box {
    border-radius: 18px;
    padding: 18px;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.05);
    height: 100%;
}

.summary-box h6 {
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #64748b;
    font-weight: 700;
    margin-bottom: .75rem;
}

.summary-box .big {
    font-size: 1.4rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: .3rem;
}

.summary-box p {
    font-size: .88rem;
    color: #64748b;
    margin: 0;
}

/* =========================
   INSTANCE TABLE / DEVICE
========================= */
.instance-table-wrap {
    padding: 22px 24px 10px;
}

.instance-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 14px;
}

.instance-table thead th {
    border: 0;
    background: transparent;
    color: #64748b;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 800;
    padding: 0 16px;
}

.instance-table tbody tr {
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.instance-table tbody td {
    background: #fff;
    padding: 18px 16px;
    vertical-align: middle;
    border-top: 1px solid rgba(15, 23, 42, 0.05);
    border-bottom: 1px solid rgba(15, 23, 42, 0.05);
}

.instance-table tbody td:first-child {
    border-left: 1px solid rgba(15, 23, 42, 0.05);
    border-radius: 18px 0 0 18px;
}

.instance-table tbody td:last-child {
    border-right: 1px solid rgba(15, 23, 42, 0.05);
    border-radius: 0 18px 18px 0;
}

.instance-device {
    display: flex;
    align-items: center;
    gap: 14px;
}

.instance-device-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #16a34a;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.instance-device-icon.offline {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #dc2626;
}

.instance-device-name {
    font-size: .98rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: .15rem;
}

.instance-device-desc {
    font-size: .85rem;
    color: #64748b;
    margin: 0;
}

.status-badge-clean {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .42rem .78rem;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 700;
    margin-bottom: .5rem;
}

.status-online {
    background: #ecfdf5;
    color: #059669;
}

.status-offline {
    background: #fef2f2;
    color: #dc2626;
}

.connection-meta {
    display: flex;
    flex-direction: column;
    gap: .28rem;
}

.connection-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .88rem;
    color: #64748b;
}

.plan-badge {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .45rem .78rem;
    border-radius: 999px;
    background: #eff6ff;
    color: #2563eb;
    font-size: .8rem;
    font-weight: 700;
    margin-bottom: .55rem;
}

.plan-badge.warning {
    background: #fff7ed;
    color: #ea580c;
}

.plan-expiry {
    font-size: .86rem;
    color: #64748b;
}

.actions-clean {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: .5rem;
}

.btn-action-clean {
    height: 38px;
    border-radius: 12px;
    padding: 0 .9rem;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .82rem;
    font-weight: 700;
}

.btn-action-icon-clean {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* =========================
   AUTH / LOGIN
========================= */
.auth-shell {
    min-height: 100vh;
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.16), transparent 25%),
        radial-gradient(circle at bottom left, rgba(16, 185, 129, 0.12), transparent 28%),
        linear-gradient(180deg, #f8fafc 0%, #eef4ff 100%);
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-wrap {
    width: 100%;
    max-width: 1220px;
}

.auth-card {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 32px;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.10);
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.auth-brand-side {
    position: relative;
    min-height: 100%;
    padding: 42px;
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.24), transparent 26%),
        radial-gradient(circle at bottom left, rgba(16, 185, 129, 0.18), transparent 30%),
        linear-gradient(135deg, #0f172a 0%, #111827 45%, #1e293b 100%);
    color: #fff;
}

.auth-brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .10);
    border: 1px solid rgba(255, 255, 255, .10);
    color: rgba(255, 255, 255, .92);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 18px;
}

.auth-brand-title {
    font-size: 2.2rem;
    line-height: 1.1;
    font-weight: 800;
    color: #fff;
    margin-bottom: 14px;
}

.auth-brand-subtitle {
    color: rgba(255, 255, 255, .72);
    font-size: .98rem;
    line-height: 1.7;
    max-width: 520px;
    margin-bottom: 28px;
}

.auth-feature-list {
    display: grid;
    gap: 14px;
}

.auth-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .08);
}

.auth-feature-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 1rem;
    flex-shrink: 0;
}

.auth-feature-title {
    font-size: .95rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 2px;
}

.auth-feature-text {
    font-size: .84rem;
    color: rgba(255, 255, 255, .68);
    margin: 0;
}

.auth-form-side {
    padding: 42px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.auth-logo {
    margin-bottom: 22px;
}

.auth-form-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 16px;
}

.auth-form-title {
    font-size: 1.9rem;
    line-height: 1.15;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 10px;
}

.auth-form-subtitle {
    color: #64748b;
    font-size: .95rem;
    line-height: 1.7;
    margin-bottom: 26px;
}

.auth-form-group {
    margin-bottom: 18px;
}

.auth-label {
    font-size: .88rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 8px;
    display: inline-block;
}

.auth-input-wrap {
    position: relative;
}

.auth-input-wrap .auth-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 1rem;
    pointer-events: none;
}

.auth-input {
    height: 52px;
    border-radius: 16px;
    border: 1px solid #dbe3ef;
    background: #f8fafc;
    padding-left: 44px;
    padding-right: 16px;
    box-shadow: none;
    font-size: .94rem;
}

.auth-input:focus {
    background: #fff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, .08);
}

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.auth-link {
    color: #2563eb;
    font-weight: 700;
    text-decoration: none;
    font-size: .88rem;
}

.auth-link:hover {
    color: #1d4ed8;
}

.auth-submit {
    height: 52px;
    border-radius: 16px;
    font-weight: 800;
    font-size: .95rem;
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.18);
}

.auth-divider {
    position: relative;
    text-align: center;
    margin: 24px 0;
}

.auth-divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    border-top: 1px solid #e2e8f0;
    transform: translateY(-50%);
}

.auth-divider span {
    position: relative;
    z-index: 1;
    background: #fff;
    padding: 0 12px;
    color: #64748b;
    font-size: .84rem;
    font-weight: 600;
}

.auth-note {
    margin-top: 22px;
    padding: 14px 16px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.05);
    color: #64748b;
    font-size: .88rem;
}

.auth-copyright {
    margin-top: 18px;
    color: #94a3b8;
    font-size: .82rem;
    text-align: center;
}

@media (max-width: 991.98px) {
    .auth-brand-side {
        display: none;
    }

    .auth-form-side {
        padding: 28px;
    }

    .auth-form-title {
        font-size: 1.6rem;
    }
}

@media (max-width: 575.98px) {
    .auth-shell {
        padding: 14px;
    }

    .auth-card {
        border-radius: 24px;
    }

    .auth-form-side {
        padding: 22px;
    }

    .auth-form-title {
        font-size: 1.45rem;
    }

    .auth-row {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* =========================
   GLOBAL TOAST NOTIFICATION
========================= */
.waslah-toast-container {
    position: fixed;
    top: 22px;
    right: 22px;
    z-index: 1085;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: min(380px, calc(100vw - 28px));
}

.waslah-toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(10px);
    animation: waslahToastIn .35s ease;
    overflow: hidden;
    position: relative;
}

.waslah-toast::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    background: currentColor;
    opacity: .18;
}

.waslah-toast-success {
    color: #059669;
}

.waslah-toast-error {
    color: #dc2626;
}

.waslah-toast-warning {
    color: #d97706;
}

.waslah-toast-info {
    color: #2563eb;
}

.waslah-toast-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.15rem;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.05);
}

.waslah-toast-success .waslah-toast-icon {
    background: #ecfdf5;
}

.waslah-toast-error .waslah-toast-icon {
    background: #fef2f2;
}

.waslah-toast-warning .waslah-toast-icon {
    background: #fff7ed;
}

.waslah-toast-info .waslah-toast-icon {
    background: #eff6ff;
}

.waslah-toast-content {
    flex: 1;
    min-width: 0;
}

.waslah-toast-title {
    font-size: .9rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 2px;
}

.waslah-toast-text {
    font-size: .86rem;
    color: #64748b;
    line-height: 1.5;
}

.waslah-toast-close {
    border: 0;
    background: transparent;
    color: #94a3b8;
    font-size: 1rem;
    line-height: 1;
    padding: 2px;
    cursor: pointer;
    flex-shrink: 0;
}

.waslah-toast-close:hover {
    color: #334155;
}

.waslah-toast.hide-toast {
    opacity: 0;
    transform: translateX(30px);
    transition: all .28s ease;
}

@keyframes waslahToastIn {
    from {
        opacity: 0;
        transform: translateY(-10px) translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0) translateX(0);
    }
}

@media (max-width: 575.98px) {
    .waslah-toast-container {
        top: 14px;
        right: 14px;
        left: 14px;
        width: auto;
    }

    .waslah-toast {
        border-radius: 16px;
    }
}