:root {
    --ink: #152033;
    --muted: #6b7280;
    --line: #e5e7eb;
    --page: #f4f6fb;
    --card: #ffffff;
    --blue: #2457f5;
    --green: #0b8f52;
    --purple: #7138e8;
    --pink: #ee5d86;
    --orange: #ff884d;
    --shadow: 0 18px 45px rgba(23, 36, 64, .09);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--page);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

.login-screen {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(560px, 1.08fr) minmax(460px, .92fr);
    background:
        radial-gradient(circle at 90% 18%, rgba(36, 87, 245, .12), transparent 28%),
        linear-gradient(115deg, #081326 0%, #0d1d34 48%, #f6f8fc 48.1%, #f6f8fc 100%);
}

.login-art {
    padding: 46px 54px;
    color: #fff;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.login-art::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 16% 18%, rgba(65, 118, 255, .28), transparent 24%),
        radial-gradient(circle at 78% 84%, rgba(5, 180, 110, .23), transparent 30%),
        linear-gradient(145deg, #071225 0%, #123461 58%, #07533f 100%);
    opacity: 1;
}

.login-art::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .055) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(90deg, rgba(0,0,0,.9), rgba(0,0,0,.28));
}

.login-art > * {
    position: relative;
    z-index: 1;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    letter-spacing: 0;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: #fff;
    color: var(--green);
    font-size: 24px;
}

.brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    object-fit: cover;
    display: block;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .10);
}

.brand-logo.large {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .18);
}

.login-art h1 {
    font-size: clamp(42px, 5vw, 66px);
    line-height: 1;
    margin: 0 0 18px;
    letter-spacing: 0;
    max-width: 700px;
}

.login-art p {
    max-width: 620px;
    color: rgba(255, 255, 255, .86);
    font-size: 17px;
    line-height: 1.65;
}

.login-visual {
    max-width: 720px;
    margin: 32px 0;
}

.visual-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.system-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    padding: 9px 13px;
    background: rgba(255, 255, 255, .11);
    font-weight: 800;
    color: rgba(255, 255, 255, .92);
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 6px rgba(34, 197, 94, .15);
}

.system-time {
    color: rgba(255, 255, 255, .74);
    font-weight: 700;
    font-size: 13px;
}

.mock-window {
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 8px;
    background: rgba(255, 255, 255, .10);
    box-shadow: 0 26px 70px rgba(0, 0, 0, .22);
    backdrop-filter: blur(16px);
    overflow: hidden;
}

.mock-head {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 13px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, .14);
}

.mock-head span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .48);
}

.mock-body {
    padding: 18px;
}

.mock-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.mock-stat,
.mock-panel,
.flow-step {
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 8px;
    background: rgba(255, 255, 255, .13);
    padding: 14px;
}

.mock-stat small,
.flow-step small {
    display: block;
    color: rgba(255, 255, 255, .68);
    font-weight: 700;
    margin-bottom: 7px;
}

.mock-stat strong,
.flow-step strong {
    display: block;
    font-size: 22px;
}

.mock-grid {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    gap: 12px;
    margin-top: 12px;
}

.mock-panel h3 {
    margin: 0 0 12px;
    font-size: 14px;
}

.chart-bars {
    height: 134px;
    display: flex;
    align-items: end;
    gap: 9px;
}

.chart-bars span {
    flex: 1;
    border-radius: 8px 8px 0 0;
    background: linear-gradient(180deg, #79a7ff, #16c784);
    min-height: 28px;
}

.mini-list {
    display: grid;
    gap: 10px;
}

.mini-row {
    display: grid;
    grid-template-columns: 34px 1fr auto;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: rgba(255, 255, 255, .78);
}

.mini-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    font-weight: 900;
}

.mini-row strong {
    display: block;
    color: #fff;
    font-size: 13px;
}

.flow-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 12px;
}

.login-points {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.glass-stat {
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 8px;
    padding: 16px;
    background: rgba(255, 255, 255, .12);
    backdrop-filter: blur(8px);
}

.glass-stat strong {
    display: block;
    font-size: 23px;
}

.login-panel {
    display: grid;
    place-items: center;
    padding: 52px;
    background:
        radial-gradient(circle at 74% 20%, rgba(36, 87, 245, .08), transparent 25%),
        #f6f8fc;
}

.login-card {
    width: min(480px, 100%);
    background: #fff;
    border-radius: 8px;
    padding: 42px;
    box-shadow: 0 26px 70px rgba(23, 36, 64, .12);
    border: 1px solid #edf0f5;
}

.login-card h2 {
    margin: 0 0 8px;
    font-size: 34px;
}

.muted {
    color: var(--muted);
}

.field {
    display: grid;
    gap: 7px;
    margin: 18px 0;
    font-weight: 700;
    font-size: 13px;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 13px 14px;
    font: inherit;
    background: #fff;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: 2px solid rgba(36, 87, 245, .16);
    border-color: var(--blue);
}

.button {
    border: 0;
    border-radius: 8px;
    padding: 13px 16px;
    background: linear-gradient(135deg, #2457f5, #123ed8);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.button.full {
    width: 100%;
}

.error {
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 258px 1fr;
}

.sidebar {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border-right: 1px solid #dfe7f2;
    padding: 20px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.nav-section {
    margin-top: 24px;
}

.nav-title {
    color: #9aa3b2;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    margin: 18px 10px 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 8px;
    color: #293446;
    font-weight: 700;
    font-size: 13px;
    border: 1px solid transparent;
    margin-bottom: 3px;
}

.nav-link:hover,
.nav-link.active {
    background: #eef4ff;
    color: var(--blue);
    border-color: #dce8ff;
    box-shadow: 0 8px 22px rgba(36, 87, 245, .08);
}

.nav-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #334155;
    flex: 0 0 24px;
}

.nav-link.active .nav-icon,
.nav-link:hover .nav-icon {
    background: transparent;
    color: var(--blue);
}

.nav-icon svg {
    width: 17px;
    height: 17px;
    stroke-width: 2;
}

.flash {
    margin-bottom: 18px;
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    color: #166534;
    padding: 12px 14px;
    border-radius: 8px;
    font-weight: 700;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
}

.form-grid .wide {
    grid-column: span 2;
}

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

.mini-button {
    border: 1px solid #dbe3ef;
    background: #fff;
    color: #263347;
    border-radius: 8px;
    padding: 8px 10px;
    font-weight: 800;
    cursor: pointer;
}

.mini-button.primary {
    background: #2457f5;
    color: #fff;
    border-color: #2457f5;
}

.mini-button.danger {
    color: #b91c1c;
    border-color: #fecaca;
    background: #fff7f7;
}

.page-stack {
    display: grid;
    gap: 22px;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.toolbar-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.toolbar .button,
.toolbar .mini-button {
    min-height: 36px;
    padding: 8px 13px;
    font-size: 12px;
}

.data-table td {
    vertical-align: middle;
}

.row-title {
    font-weight: 900;
    color: var(--ink);
}

.row-sub {
    color: var(--muted);
    font-size: 12px;
    margin-top: 2px;
}

.money {
    font-weight: 900;
    color: #0f766e;
}

.modal-toggle {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .48);
    display: none;
    place-items: center;
    padding: 24px;
    z-index: 30;
}

.modal-toggle:checked + .modal {
    display: grid;
}

.modal-card {
    width: min(920px, 100%);
    max-height: 90vh;
    overflow: auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 30px 90px rgba(0,0,0,.24);
    border: 1px solid #e5e7eb;
    padding: 24px;
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.modal-head h2 {
    margin: 0;
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: #f1f5f9;
    color: #334155;
    font-weight: 900;
    cursor: pointer;
}

.status-pending { background: #fff7ed; color: #c2410c; }
.status-completed,
.status-active,
.status-sold { background: #ecfdf5; color: #047857; }
.status-rejected,
.status-suspended,
.status-inactive { background: #fef2f2; color: #b91c1c; }
.status-held { background: #eef4ff; color: #2457f5; }

.pagination {
    margin-top: 16px;
}

.pagination nav > div:first-child {
    display: none;
}

.pagination span,
.pagination a {
    font-size: 13px;
}

.main {
    padding: 22px;
    min-width: 0;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.topbar h1 {
    margin: 0;
    font-size: 22px;
    line-height: 1.2;
    font-weight: 850;
}

.topbar .muted {
    font-size: 13px;
}

.profile-pill {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.profile-pill:hover {
    border-color: #cbd5e1;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .06);
    transform: translateY(-1px);
}

.user-menu {
    position: relative;
    margin-left: auto;
}

.user-menu summary {
    list-style: none;
    cursor: pointer;
    outline: none;
}

.user-menu summary::-webkit-details-marker {
    display: none;
}

.chevron {
    color: #94a3b8;
    width: 16px;
    height: 16px;
    display: inline-grid;
    place-items: center;
    font-size: 14px;
    line-height: 1;
    transition: transform .15s ease;
}

.user-menu[open] .chevron {
    transform: rotate(180deg);
}

.user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: 210px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .14);
    padding: 8px;
    z-index: 20;
}

.user-dropdown::before {
    content: "";
    position: absolute;
    top: -6px;
    right: 24px;
    width: 10px;
    height: 10px;
    background: #fff;
    border-left: 1px solid #e2e8f0;
    border-top: 1px solid #e2e8f0;
    transform: rotate(45deg);
}

.user-dropdown a,
.user-dropdown button {
    width: 100%;
    border: 0;
    background: transparent;
    color: #253044;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 9px;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    padding: 10px 11px;
    text-align: left;
    border-radius: 7px;
}

.user-dropdown a:hover,
.user-dropdown button:hover {
    background: #f1f5f9;
    color: var(--blue);
}

.profile-pill:focus,
.profile-pill:focus-visible {
    outline: none;
    border-color: #cbd5e1;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .06);
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue), var(--green));
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 900;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.stat-card {
    border-radius: 8px;
    padding: 16px;
    color: #fff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .08);
    min-height: 92px;
}

.stat-card span {
    display: block;
    opacity: .9;
    font-size: 12px;
    margin-bottom: 7px;
    font-weight: 700;
}

.stat-card strong {
    font-size: 24px;
    line-height: 1;
    font-weight: 850;
}

.g-purple { background: linear-gradient(135deg, #5b4bdb, #4f7df3); }
.g-pink { background: linear-gradient(135deg, #e95f83, #db3f75); }
.g-orange { background: linear-gradient(135deg, #f59e42, #ef6b3f); }
.g-blue { background: linear-gradient(135deg, #2563eb, #4f7df3); }

.content-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr .95fr;
    gap: 16px;
    margin-top: 16px;
}

.content-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel {
    background: #fff;
    border: 1px solid #eef0f5;
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 22px;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.panel h2 {
    margin: 0 0 16px;
    font-size: 18px;
}

.panel-head h2 {
    margin: 0;
}

.check-field {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 40px;
    color: #374151;
    font-size: 13px;
    font-weight: 700;
}

.metric-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.metric {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: #fbfcff;
}

.metric strong {
    display: block;
    font-size: 18px;
    font-weight: 850;
}

.metric .muted {
    font-size: 12px;
}

.activity {
    display: grid;
    gap: 12px;
}

.activity-item {
    display: flex;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eef0f5;
}

.activity-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.donut {
    width: 106px;
    height: 106px;
    border-radius: 50%;
    margin: 8px auto 18px;
    background: conic-gradient(var(--blue) 0 42%, var(--pink) 42% 100%);
    display: grid;
    place-items: center;
}

.donut::after {
    content: "";
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: #fff;
}

.portal-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 16px;
}

.portal-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: var(--shadow);
    border-top: 5px solid var(--blue);
    padding: 18px;
}

.portal-card.admin { border-color: var(--purple); }
.portal-card.staff { border-color: var(--blue); }
.portal-card.user { border-color: var(--green); }

.quick-actions {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

.action-tile {
    min-height: 86px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 10px;
    font-weight: 800;
    color: #293446;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table th,
.table td {
    padding: 13px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.table th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 800;
    background: #ecfdf5;
    color: #047857;
}

.module-grid {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 22px;
}

.empty-workspace {
    min-height: 320px;
    display: grid;
    align-content: center;
    gap: 12px;
    color: var(--muted);
}

.logout {
    width: 100%;
    border: 0;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

@media (max-width: 1100px) {
    .grid-4,
    .content-grid,
    .portal-cards,
    .module-grid {
        grid-template-columns: 1fr 1fr;
    }

    .quick-actions {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 760px) {
    .login-screen,
    .app-shell,
    .grid-4,
    .content-grid,
    .portal-cards,
    .module-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
    }

    .login-art {
        min-height: 420px;
        padding: 32px;
    }

    .login-art h1 {
        font-size: 38px;
    }

    .login-points {
        grid-template-columns: 1fr;
    }
}

/* Professional admin polish */
.panel {
    padding: 20px;
    border-color: #e7ebf2;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
}

.panel h2 {
    font-size: 17px;
    letter-spacing: 0;
}

.field {
    gap: 6px;
    margin: 10px 0;
    font-size: 12px;
    color: #334155;
}

.field input,
.field select,
.field textarea {
    min-height: 42px;
    padding: 10px 12px;
    font-size: 13px;
    border-color: #dfe4ec;
    box-shadow: inset 0 1px 1px rgba(15, 23, 42, .02);
}

.button {
    min-height: 40px;
    border: 1px solid #1d4ed8;
    padding: 9px 15px;
    background: linear-gradient(180deg, #2563eb, #1d4ed8);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 8px 16px rgba(37, 99, 235, .18);
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
    white-space: nowrap;
}

.button:hover {
    background: linear-gradient(180deg, #1d4ed8, #1e40af);
    box-shadow: 0 10px 20px rgba(37, 99, 235, .22);
    transform: translateY(-1px);
}

.button:active {
    transform: translateY(0);
}

.mini-button {
    min-height: 34px;
    border: 1px solid #d6deea;
    padding: 8px 12px;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    border-radius: 8px;
    color: #334155;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease;
    white-space: nowrap;
}

.mini-button:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.mini-button.primary {
    background: linear-gradient(180deg, #2563eb, #1d4ed8);
    border-color: #2563eb;
    box-shadow: 0 6px 14px rgba(37, 99, 235, .16);
}

.mini-button.primary:hover {
    background: linear-gradient(180deg, #1d4ed8, #1e40af);
}

.mini-button.danger {
    color: #b42318;
    border-color: #fecdca;
    background: linear-gradient(180deg, #fff, #fff5f5);
}

.mini-button.danger:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}

.button:focus-visible,
.mini-button:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .18);
    outline-offset: 2px;
}

.form-grid {
    gap: 10px 14px;
}

.toolbar {
    margin-bottom: 14px;
}

.toolbar h2 {
    margin-bottom: 0;
}

.table {
    font-size: 13px;
}

.table th,
.table td {
    padding: 12px 10px;
}

.table th {
    font-size: 11px;
    letter-spacing: .02em;
}

.modal-card {
    padding: 22px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .24);
}

body {
    font-size: 14px;
}

.row-title {
    font-weight: 800;
}

.badge {
    padding: 4px 9px;
    font-size: 11px;
}

.modal-head h2 {
    font-size: 18px;
}

.profile-pill strong {
    font-size: 13px;
}

.profile-pill small {
    font-size: 11px;
}
