﻿*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f4f4f1;
    color: #1a1a18;
    height: 100vh;
    overflow: hidden;
}

/* ── Shell ──────────────────────────────────────────────────────────────── */
.shell {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────  */
.sidebar {
    width: 210px;
    background: #fff;
    border-right: 0.5px solid #e0dfd8;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-brand {
    padding: 16px;
    border-bottom: 0.5px solid #e0dfd8;
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: #534AB7;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #EEEDFE;
    font-size: 15px;
}

.brand-name {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a18;
}

.nav {
    padding: 12px 8px;
    flex: 1;
    overflow-y: auto;
}

.nav-section {
    font-size: 10px;
    color: #9c9a92;
    padding: 10px 8px 4px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    color: #5f5e5a;
    cursor: pointer;
    margin-bottom: 2px;
    text-decoration: none;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

    .nav-item:hover {
        background: #f4f4f1;
        color: #1a1a18;
    }

    .nav-item.active {
        background: #EEEDFE;
        color: #3C3489;
        font-weight: 500;
    }

    .nav-item i {
        font-size: 17px;
    }

.sidebar-footer {
    padding: 12px 8px;
    border-top: 0.5px solid #e0dfd8;
}

/* ── Main ────────────────────────────────────────────────────────────────  */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.topbar {
    padding: 14px 24px;
    border-bottom: 0.5px solid #e0dfd8;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.topbar-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a18;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.content {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

/* ── Buttons ─────────────────────────────────────────────────────────────  */
.btn {
    padding: 7px 13px;
    font-size: 12px;
    border-radius: 8px;
    border: 0.5px solid #c8c7bf;
    background: #fff;
    color: #1a1a18;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

    .btn:hover {
        background: #f4f4f1;
    }

.btn-primary {
    background: #534AB7;
    color: #fff;
    border-color: #534AB7;
}

    .btn-primary:hover {
        background: #3C3489;
        border-color: #3C3489;
        color: #fff;
    }

.btn-danger {
    background: #FCEBEB;
    color: #A32D2D;
    border-color: #f7c1c1;
}

    .btn-danger:hover {
        background: #f7c1c1;
    }

.btn-sm {
    padding: 5px 10px;
    font-size: 11px;
}

/* ── Search ──────────────────────────────────────────────────────────────  */
.search-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

    .search-wrap i {
        position: absolute;
        left: 9px;
        font-size: 15px;
        color: #9c9a92;
        pointer-events: none;
    }

    .search-wrap input {
        padding: 7px 10px 7px 30px;
        font-size: 12px;
        border-radius: 8px;
        border: 0.5px solid #c8c7bf;
        background: #f4f4f1;
        color: #1a1a18;
        width: 220px;
        outline: none;
    }

        .search-wrap input:focus {
            border-color: #534AB7;
            background: #fff;
        }

/* ── Filter Bar ──────────────────────────────────────────────────────────  */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-select {
    padding: 7px 10px;
    font-size: 12px;
    border-radius: 8px;
    border: 0.5px solid #c8c7bf;
    background: #fff;
    color: #1a1a18;
    outline: none;
    cursor: pointer;
}

    .filter-select:focus {
        border-color: #534AB7;
    }

/* ── Stat Cards ──────────────────────────────────────────────────────────  */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border: 0.5px solid #e0dfd8;
    border-radius: 10px;
    padding: 14px 16px;
}

.stat-label {
    font-size: 12px;
    color: #5f5e5a;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a18;
}

.stat-sub {
    font-size: 11px;
    color: #9c9a92;
    margin-top: 4px;
}

/* ── Section Header ──────────────────────────────────────────────────────  */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.section-title {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a18;
}

/* ── Table ───────────────────────────────────────────────────────────────  */
.table-wrap {
    border: 0.5px solid #e0dfd8;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 24px;
    background: #fff;
}

.table-toolbar {
    padding: 12px 14px;
    border-bottom: 0.5px solid #e0dfd8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

thead {
    background: #f4f4f1;
}

th {
    padding: 9px 14px;
    text-align: left;
    font-weight: 500;
    color: #5f5e5a;
    border-bottom: 0.5px solid #e0dfd8;
    white-space: nowrap;
}

td {
    padding: 10px 14px;
    color: #1a1a18;
    border-bottom: 0.5px solid #e0dfd8;
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: #f9f9f7;
}

/* ── Badges ──────────────────────────────────────────────────────────────  */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
}

.badge-active {
    background: #EAF3DE;
    color: #3B6D11;
}

.badge-inactive {
    background: #f1efe8;
    color: #444441;
}

.badge-trial {
    background: #FAEEDA;
    color: #854F0B;
}

.badge-expired {
    background: #FCEBEB;
    color: #A32D2D;
}

.badge-paid {
    background: #EAF3DE;
    color: #3B6D11;
}

.badge-pending {
    background: #FAEEDA;
    color: #854F0B;
}

.badge-failed {
    background: #FCEBEB;
    color: #A32D2D;
}

.plan-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 11px;
    background: #EEEDFE;
    color: #3C3489;
    font-weight: 500;
}

/* ── Avatar ──────────────────────────────────────────────────────────────  */
.avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #EEEDFE;
    color: #534AB7;
    font-size: 10px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tenant-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Action Buttons ──────────────────────────────────────────────────────  */
.action-btn {
    padding: 4px 7px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: #5f5e5a;
    cursor: pointer;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

    .action-btn:hover {
        background: #f4f4f1;
        color: #1a1a18;
    }

    .action-btn.danger:hover {
        background: #FCEBEB;
        color: #A32D2D;
    }

.actions-cell {
    display: flex;
    gap: 2px;
}

/* ── Forms ───────────────────────────────────────────────────────────────  */
.form-card {
    background: #fff;
    border: 0.5px solid #e0dfd8;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 16px;
}

.form-card-header {
    padding: 16px 20px;
    border-bottom: 0.5px solid #e0dfd8;
}

.form-card-title {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a18;
}

.form-card-subtitle {
    font-size: 11px;
    color: #9c9a92;
    margin-top: 2px;
}

.form-card-body {
    padding: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

    .form-row.full {
        grid-template-columns: 1fr;
    }

    .form-row.three {
        grid-template-columns: 1fr 1fr 1fr;
    }

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 12px;
    font-weight: 500;
    color: #5f5e5a;
}

.required {
    color: #A32D2D;
}

.form-input {
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 8px;
    border: 0.5px solid #c8c7bf;
    background: #fff;
    color: #1a1a18;
    outline: none;
    width: 100%;
}

    .form-input:focus {
        border-color: #534AB7;
    }

    .form-input:disabled {
        background: #f4f4f1;
        color: #9c9a92;
        cursor: not-allowed;
    }

.form-select {
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 8px;
    border: 0.5px solid #c8c7bf;
    background: #fff;
    color: #1a1a18;
    outline: none;
    width: 100%;
    cursor: pointer;
}

    .form-select:focus {
        border-color: #534AB7;
    }

.form-hint {
    font-size: 11px;
    color: #9c9a92;
}

.form-error {
    font-size: 11px;
    color: #A32D2D;
}

.form-footer {
    padding: 16px 20px;
    border-top: 0.5px solid #e0dfd8;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    background: #fff;
}

/* ── Validation Summary ──────────────────────────────────────────────────  */
.alert-error {
    background: #FCEBEB;
    border: 0.5px solid #f7c1c1;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 12px;
    color: #A32D2D;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

    .alert-error i {
        font-size: 16px;
        flex-shrink: 0;
        margin-top: 1px;
    }

/* ── Detail View ─────────────────────────────────────────────────────────  */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.detail-card {
    background: #fff;
    border: 0.5px solid #e0dfd8;
    border-radius: 10px;
    padding: 16px;
}

.detail-card-title {
    font-size: 10px;
    color: #9c9a92;
    margin-bottom: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 0;
    font-size: 12px;
    border-bottom: 0.5px solid #f4f4f1;
}

    .detail-row:last-child {
        border-bottom: none;
    }

.detail-key {
    color: #5f5e5a;
}

.detail-val {
    color: #1a1a18;
    font-weight: 500;
    text-align: right;
}

    .detail-val.muted {
        color: #9c9a92;
        font-weight: 400;
    }

/* ── Danger Zone ─────────────────────────────────────────────────────────  */
.danger-zone {
    background: #FCEBEB;
    border: 0.5px solid #f7c1c1;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 24px;
}

.danger-zone-title {
    font-size: 13px;
    font-weight: 600;
    color: #A32D2D;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.danger-zone-desc {
    font-size: 12px;
    color: #793030;
    margin-bottom: 16px;
    line-height: 1.6;
}

.danger-confirm-card {
    background: #fff;
    border: 0.5px solid #f7c1c1;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.danger-confirm-label {
    font-size: 11px;
    color: #9c9a92;
    margin-bottom: 4px;
}

.danger-confirm-value {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a18;
}

/* ── Page Header ─────────────────────────────────────────────────────────  */
.page-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.page-header-back {
    padding: 6px;
    border-radius: 8px;
    border: 0.5px solid #e0dfd8;
    background: #fff;
    color: #5f5e5a;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    text-decoration: none;
    font-size: 16px;
}

    .page-header-back:hover {
        background: #f4f4f1;
        color: #1a1a18;
    }

.page-header-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a18;
}

.page-header-sub {
    font-size: 12px;
    color: #9c9a92;
    margin-top: 2px;
}

/* ── Empty State ─────────────────────────────────────────────────────────  */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: #9c9a92;
}

    .empty-state i {
        font-size: 36px;
        margin-bottom: 10px;
        display: block;
        color: #c8c7bf;
    }

    .empty-state p {
        font-size: 13px;
    }

/* ── Login Page ──────────────────────────────────────────────────────────  */
.login-shell {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f4f4f1;
    overflow: auto;
}

.login-card {
    background: #fff;
    border: 0.5px solid #e0dfd8;
    border-radius: 12px;
    padding: 32px;
    width: 100%;
    max-width: 380px;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

.login-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a18;
    margin-bottom: 4px;
}

.login-sub {
    font-size: 12px;
    color: #9c9a92;
    margin-bottom: 24px;
}

.login-footer {
    font-size: 11px;
    color: #9c9a92;
    text-align: center;
    margin-top: 16px;
}

/* ── Settings Tabs ───────────────────────────────────────────────────────  */
.settings-tab {
    padding: 12px 16px;
    font-size: 12px;
    border: none;
    background: none;
    color: #5f5e5a;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-bottom: 2px solid transparent;
    margin-bottom: -0.5px;
}

    .settings-tab:hover {
        color: #1a1a18;
    }

.settings-tab-active {
    color: #534AB7;
    border-bottom-color: #534AB7;
    font-weight: 500;
}

/* ── Alert Success ───────────────────────────────────────────────────────  */
.alert-success {
    background: #EAF3DE;
    border: 0.5px solid #b8d98b;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 12px;
    color: #3B6D11;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .alert-success i {
        font-size: 16px;
        flex-shrink: 0;
    }

/* ── Pagination ──────────────────────────────────────────────────────────  */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-top: 0.5px solid #e0dfd8;
    flex-wrap: wrap;
    gap: 8px;
}

.pagination-info {
    font-size: 11px;
    color: #9c9a92;
}

.pagination-controls {
    display: flex;
    gap: 4px;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    border: 0.5px solid #c8c7bf;
    border-radius: 6px;
    font-size: 12px;
    color: #5f5e5a;
    text-decoration: none;
    background: #fff;
    transition: background 0.15s;
    cursor: pointer;
}

    .page-btn:hover:not(.is-disabled):not(.is-active) {
        background: #f4f4f1;
        color: #1a1a18;
    }

    .page-btn.is-active {
        background: #534AB7;
        color: #fff;
        border-color: #534AB7;
        font-weight: 600;
    }

    .page-btn.is-disabled {
        color: #c8c7bf;
        pointer-events: none;
        background: #f4f4f1;
    }

/* ── Credentials Box ─────────────────────────────────────────────────────  */
.credentials-box {
    background: #EAF3DE;
    border: 0.5px solid #b8d98b;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 20px;
}

.credentials-box-title {
    font-size: 13px;
    font-weight: 600;
    color: #3B6D11;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.credentials-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
    font-size: 13px;
}

.credentials-label {
    font-weight: 500;
    color: #5f5e5a;
    width: 80px;
    flex-shrink: 0;
}

.credentials-value {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a18;
    background: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    border: 0.5px solid #b8d98b;
    letter-spacing: 0.03em;
}

.credentials-note {
    font-size: 11px;
    color: #5f5e5a;
    margin-top: 10px;
    font-style: italic;
}

/* ── Phone Input ─────────────────────────────────────────────────────────  */
.phone-input-wrap {
    display: flex;
    align-items: stretch;
    border: 0.5px solid #c8c7bf;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

    .phone-input-wrap:focus-within {
        border-color: #534AB7;
    }

.dial-code-badge {
    padding: 8px 10px;
    font-size: 12px;
    color: #5f5e5a;
    background: #f4f4f1;
    border-right: 0.5px solid #c8c7bf;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
}

.phone-number-input {
    padding: 8px 12px;
    font-size: 13px;
    border: none;
    border-radius: 0;
    background: #fff;
    color: #1a1a18;
    outline: none;
    flex: 1;
    width: 100%;
}

/* ── Feature Flags Grid ──────────────────────────────────────────────────  */
.feature-flags-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.feature-flag-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

    .feature-flag-item input[type="checkbox"] {
        margin-top: 14px;
        flex-shrink: 0;
        width: 15px;
        height: 15px;
        accent-color: #534AB7;
        cursor: pointer;
    }

.feature-flag-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    padding: 10px 12px;
    border: 0.5px solid #e0dfd8;
    border-radius: 8px;
    flex: 1;
    transition: border-color 0.15s, background 0.15s;
}

    .feature-flag-label:hover {
        border-color: #534AB7;
        background: #EEEDFE;
    }

    .feature-flag-label i {
        font-size: 20px;
        color: #534AB7;
        flex-shrink: 0;
        margin-top: 1px;
    }

.feature-flag-name {
    font-size: 12px;
    font-weight: 600;
    color: #1a1a18;
    margin-bottom: 2px;
}

.feature-flag-desc {
    font-size: 11px;
    color: #9c9a92;
    line-height: 1.5;
}