:root {
    --primary: #2563eb;
    --primary-soft: #eef4ff;
    --dark: #0f172a;
    --muted: #64748b;
    --border: #e5e7eb;
    --soft-border: #eef2f7;
    --body: #f8fafc;
    --panel: #ffffff;
    --success: #00a85a;
    --danger: #ef233c;
    --orange: #fb5607;
    --purple: #a855f7;
    --green: #08a045;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: Inter, Arial, Helvetica, sans-serif;
    background: var(--body);
    color: var(--dark);
}

a {
    text-decoration: none;
}

.admin-body {
    min-height: 100vh;
    padding-bottom: 58px;
}

.admin-topbar {
    height: 58px;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 28px;
}

.brand-admin {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--dark);
    font-size: 15px;
}

.brand-admin strong span,
.brand-login span {
    color: var(--primary);
}

.brand-icon {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.admin-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-nav a,
.admin-sidebar a {
    color: #475569;
    border-radius: 8px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 7px;
}

.admin-nav a {
    padding: 9px 13px;
}

.admin-nav a.active,
.admin-nav a:hover,
.admin-sidebar a.active,
.admin-sidebar a:hover {
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 600;
}

.mobile-menu-btn {
    display: none;
    border: 0;
    background: transparent;
    font-size: 24px;
    color: #475569;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.notification-btn {
    position: relative;
    border: 0;
    background: transparent;
    color: #64748b;
    font-size: 18px;
}

.notification-btn span {
    position: absolute;
    top: 5px;
    right: 2px;
    width: 7px;
    height: 7px;
    background: var(--danger);
    border-radius: 50%;
}

.admin-user-box {
    display: flex;
    align-items: center;
    gap: 9px;
    border-left: 1px solid var(--border);
    padding-left: 16px;
}

.admin-user-box strong {
    display: block;
    font-size: 12px;
    line-height: 14px;
}

.admin-user-box small {
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.admin-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #475569;
}

.admin-shell {
    display: block;
}

.admin-sidebar {
    display: none;
}

.sidebar-backdrop {
    display: none;
}

.admin-main {
    padding: 24px;
}

.page-header {
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.page-header h1 {
    font-size: 23px;
    font-weight: 800;
    margin: 0 0 3px;
}

.page-header p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.page-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn {
    border-radius: 10px;
    font-weight: 700;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 26px;
}

.metric-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    min-height: 125px;
    box-shadow: 0 2px 7px rgba(15, 23, 42, .08);
}

.metric-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 14px;
}

.metric-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    color: #111827;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.bg-blue { background: #2563eb; }
.bg-purple { background: var(--purple); }
.bg-orange { background: var(--orange); }
.bg-green { background: var(--green); }

.metric-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 9px;
    border-radius: 999px;
}

.metric-badge.success {
    color: var(--success);
    background: #ecfdf3;
}

.metric-badge.danger {
    color: var(--danger);
    background: #fff1f2;
}

.metric-card p {
    margin: 0 0 3px;
    color: #475569;
    font-size: 13px;
}

.metric-card h2 {
    margin: 0;
    font-size: 23px;
    font-weight: 800;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.panel-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 2px 7px rgba(15, 23, 42, .08);
}

.panel-title {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 18px;
    gap: 12px;
}

.panel-title h3,
.side-panel h3 {
    font-size: 16px;
    font-weight: 800;
    margin: 0;
}

.panel-subtitle {
    color: var(--muted);
    font-size: 12px;
}

.panel-title a {
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.charge-list {
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.charge-item {
    display: flex;
    align-items: center;
    gap: 13px;
    background: #f8fafc;
    border: 1px solid var(--soft-border);
    border-radius: 10px;
    padding: 12px 14px;
}

.charge-overdue {
    border-color: #ffe4e6;
    background: #fffafa;
}

.client-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    flex-shrink: 0;
}

.client-avatar.blue { background: #3b82f6; }
.client-avatar.red { background: #ff3045; }

.charge-info {
    flex: 1;
}

.charge-info strong,
.charge-value strong {
    display: block;
    font-size: 14px;
}

.charge-info small,
.charge-value small {
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.charge-value {
    text-align: right;
}

.charge-value.danger small {
    color: var(--danger);
    font-weight: 700;
}

.side-panel {
    min-height: 310px;
}

.domain-alert {
    display: grid;
    grid-template-columns: 10px 1fr auto;
    gap: 10px;
    align-items: center;
    margin-top: 16px;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.dot.orange { background: var(--orange); }
.dot.red { background: #fb7185; }

.domain-alert strong {
    display: block;
    font-size: 12px;
}

.domain-alert small {
    display: block;
    font-size: 11px;
    color: var(--muted);
}

.domain-alert a {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
}

.side-panel hr {
    border-color: var(--border);
    margin: 22px 0;
}

.side-panel h4 {
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 12px;
}

.audit-log {
    margin-bottom: 10px;
}

.audit-log p {
    font-size: 12px;
    margin: 0;
    color: #475569;
}

.audit-log span {
    color: var(--success);
    font-weight: 800;
}

.audit-log small {
    color: var(--muted);
    font-size: 11px;
}

.admin-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 48px;
    background: var(--body);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    color: #94a3b8;
    font-size: 11px;
    z-index: 90;
}

.admin-footer div {
    display: flex;
    align-items: center;
    gap: 24px;
}

.admin-footer a {
    color: #64748b;
}

.admin-login-body {
    background: #f4f7fb;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .08);
}

.brand-login {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 22px;
}

.brand-text {
    font-size: 18px;
    font-weight: 900;
}

.login-card h1 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 4px;
}

.login-card p {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 22px;
}

.form-control {
    border-radius: 10px;
    min-height: 44px;
}

@media (max-width: 1100px) {
    .metric-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .admin-nav {
        display: none;
    }

    .mobile-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .admin-sidebar {
        position: fixed;
        top: 58px;
        left: -280px;
        width: 260px;
        bottom: 0;
        background: #fff;
        border-right: 1px solid var(--border);
        display: block;
        z-index: 130;
        padding: 18px;
        overflow-y: auto;
        transition: left .2s ease;
    }

    .admin-sidebar.open {
        left: 0;
    }

    .sidebar-section {
        margin-bottom: 22px;
    }

    .sidebar-section span {
        display: block;
        text-transform: uppercase;
        color: #94a3b8;
        font-size: 11px;
        font-weight: 800;
        margin-bottom: 8px;
    }

    .admin-sidebar a {
        padding: 10px 11px;
        margin-bottom: 4px;
    }

    .sidebar-backdrop.open {
        display: block;
        position: fixed;
        top: 58px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(15, 23, 42, .25);
        z-index: 120;
    }
}

@media (max-width: 650px) {
    .admin-topbar {
        padding: 0 14px;
    }

    .topbar-left {
        gap: 12px;
    }

    .admin-main {
        padding: 18px 14px;
    }

    .page-header {
        display: block;
    }

    .page-actions {
        margin-top: 14px;
    }

    .metric-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .admin-user-box div:first-child {
        display: none;
    }

    .charge-item {
        align-items: flex-start;
    }

    .charge-value {
        min-width: 86px;
    }

    .admin-footer {
        position: static;
        height: auto;
        padding: 18px 14px;
        display: block;
    }

    .admin-footer div {
        margin-top: 10px;
        gap: 14px;
        flex-wrap: wrap;
    }

    .admin-body {
        padding-bottom: 0;
    }
}
