:root {
    --navy: #0c2d57;
    --blue: #175cd3;
    --blue-light: #eaf2ff;
    --yellow: #f5b700;
    --green: #15803d;
    --red: #b42318;
    --ink: #182230;
    --muted: #667085;
    --line: #e4e7ec;
    --page: #f4f7fb;
    --white: #ffffff;
    --shadow: 0 18px 45px rgba(12, 45, 87, 0.10);
}

* { box-sizing: border-box; }

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

a { color: inherit; }

.auth-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    background:
        radial-gradient(circle at 10% 10%, rgba(245, 183, 0, .18), transparent 25%),
        radial-gradient(circle at 90% 90%, rgba(23, 92, 211, .20), transparent 30%),
        #eef3fa;
}

.auth-layout {
    width: min(1050px, 100%);
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: var(--shadow);
    background: var(--white);
}

.auth-intro {
    min-height: 600px;
    padding: 72px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: var(--white);
    background:
        linear-gradient(145deg, rgba(12,45,87,.97), rgba(23,92,211,.90)),
        linear-gradient(45deg, #0c2d57, #175cd3);
}

.auth-intro h1 {
    max-width: 640px;
    margin: 16px 0;
    font-size: clamp(42px, 6vw, 68px);
    line-height: 1.03;
}

.auth-intro p {
    max-width: 560px;
    margin: 0;
    color: rgba(255,255,255,.82);
    font-size: 18px;
    line-height: 1.7;
}

.eyebrow {
    display: inline-block;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .18em;
    color: var(--yellow);
}

.auth-card {
    padding: 56px;
    background: var(--white);
}

.auth-card h1,
.auth-card h2 { margin: 18px 0 8px; }
.auth-card p { color: var(--muted); line-height: 1.6; }

.setup-card {
    width: min(520px, 100%);
    border-radius: 24px;
    box-shadow: var(--shadow);
    text-align: center;
}

.brand-mark {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: inline-grid;
    place-items: center;
    background: var(--navy);
    color: var(--yellow);
    font-weight: 900;
    font-size: 20px;
}

.brand-mark.small {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    font-size: 15px;
}

label {
    display: block;
    margin: 18px 0 7px;
    font-size: 13px;
    font-weight: 800;
    color: #344054;
}

input, select {
    width: 100%;
    min-height: 46px;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    padding: 10px 13px;
    font: inherit;
    color: var(--ink);
    background: var(--white);
    outline: none;
}

input:focus, select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(23,92,211,.10);
}

.btn {
    appearance: none;
    border: 0;
    border-radius: 10px;
    padding: 12px 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font: inherit;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.btn-primary { background: var(--blue); color: var(--white); }
.btn-secondary { background: var(--blue-light); color: var(--blue); }
.btn-danger { background: #fff0ee; color: var(--red); }
.btn-small { padding: 8px 11px; font-size: 12px; }
.btn-block { width: 100%; margin-top: 22px; }

.credentials-box {
    margin-top: 24px;
    padding: 16px;
    display: grid;
    gap: 5px;
    border: 1px dashed #b8c5d9;
    border-radius: 12px;
    background: #f8fafc;
    color: #344054;
    font-size: 14px;
}

.text-link {
    display: inline-block;
    margin-top: 18px;
    color: var(--blue);
    font-weight: 800;
    text-decoration: none;
}

.alert {
    margin: 18px 0;
    padding: 13px 15px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
}

.alert.success { background: #ecfdf3; color: var(--green); }
.alert.error { background: #fff0ee; color: var(--red); }
.alert.warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
    display: flex;
    align-items: center;
    gap: 10px;
}
.alert.warning strong { color: #7c2d12; }

.cleanup-status {
    margin: 18px 0;
    padding: 14px 16px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.cleanup-status.warning {
    background: #fffbeb;
    border-color: #fde68a;
}
.cleanup-status-info { display: flex; align-items: flex-start; gap: 10px; }
.cleanup-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--green, #16a34a);
    margin-top: 6px;
    flex-shrink: 0;
}
.cleanup-status.warning .cleanup-status-dot { background: #d97706; }
.cleanup-status-info strong { display: block; font-size: 14px; color: #1f2937; }
.cleanup-status.warning .cleanup-status-info strong { color: #7c2d12; }
.cleanup-status-info p { margin: 2px 0 0; font-size: 13px; color: #6b7280; }
.btn-delete-now {
    background: #dc2626;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}
.btn-delete-now:hover { background: #b91c1c; }

.app-body { min-height: 100vh; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 255px;
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    background: var(--navy);
    color: var(--white);
}

.sidebar-brand {
    padding: 4px 8px 28px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand strong,
.sidebar-brand small { display: block; }
.sidebar-brand small { margin-top: 3px; color: rgba(255,255,255,.62); }

.sidebar nav {
    display: grid;
    gap: 7px;
}

.sidebar nav a,
.logout-link {
    padding: 12px 14px;
    border-radius: 10px;
    color: rgba(255,255,255,.78);
    text-decoration: none;
    font-weight: 700;
}

.sidebar nav a:hover,
.sidebar nav a.active { background: rgba(255,255,255,.12); color: var(--white); }
.logout-link { margin-top: auto; background: rgba(255,255,255,.08); }

.main-content {
    margin-left: 255px;
    padding: 30px;
}

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

.topbar h1 { margin: 7px 0 0; font-size: 30px; }

.user-chip {
    min-width: 210px;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--white);
    text-align: right;
}

.user-chip strong,
.user-chip span { display: block; }
.user-chip span { margin-top: 3px; color: var(--muted); font-size: 13px; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 20px;
}

.stat-card,
.panel {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--white);
    box-shadow: 0 6px 20px rgba(16,24,40,.04);
}

.stat-card { padding: 22px; }
.stat-card span { display: block; color: var(--muted); font-weight: 700; font-size: 13px; }
.stat-card strong { display: block; margin-top: 12px; font-size: 34px; color: var(--navy); }

.two-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.user-layout { grid-template-columns: 390px minmax(0, 1fr); align-items: start; }
.sticky-panel { position: sticky; top: 20px; }

.panel { overflow: hidden; }
.panel-header {
    padding: 20px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--line);
}

.panel-header h2 { margin: 0; font-size: 18px; }
.panel-header p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }

.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
}

th, td {
    padding: 14px 16px;
    border-bottom: 1px solid #eef0f3;
    text-align: left;
    vertical-align: middle;
    font-size: 13px;
}

th {
    color: var(--muted);
    background: #fafbfc;
    font-size: 11px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

td strong,
td small { display: block; }
td small { margin-top: 4px; color: var(--muted); line-height: 1.35; }
.wide-text { min-width: 260px; max-width: 480px; line-height: 1.5; }
.empty { padding: 30px; text-align: center; color: var(--muted); }

.badge {
    display: inline-flex;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .04em;
}

.badge.success,
.badge.logout { background: #ecfdf3; color: var(--green); }
.badge.failed { background: #fff0ee; color: var(--red); }
.badge.role { background: var(--blue-light); color: var(--blue); }

.activity-list { padding: 12px 22px 18px; }
.activity-item {
    padding: 14px 0;
    display: grid;
    grid-template-columns: 12px 1fr;
    gap: 12px;
    border-bottom: 1px solid #eef0f3;
}

.activity-dot {
    width: 10px;
    height: 10px;
    margin-top: 5px;
    border-radius: 50%;
    background: var(--yellow);
    box-shadow: 0 0 0 4px rgba(245,183,0,.15);
}

.activity-item strong { font-size: 13px; }
.activity-item p { margin: 4px 0; color: var(--muted); font-size: 12px; }
.activity-item small { color: #98a2b3; }

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

.full-width { grid-column: 1 / -1; }

@media (max-width: 1050px) {
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .two-column, .user-layout { grid-template-columns: 1fr; }
    .sticky-panel { position: static; }
}

@media (max-width: 800px) {
    .auth-layout { grid-template-columns: 1fr; }
    .auth-intro { display: none; }
    .auth-card { padding: 34px 26px; }

    .sidebar {
        position: static;
        width: 100%;
        min-height: auto;
    }

    .sidebar nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .logout-link { margin-top: 15px; }
    .main-content { margin-left: 0; padding: 20px; }
    .topbar { align-items: flex-start; }
    .user-chip { display: none; }
}

@media (max-width: 520px) {
    .auth-body { padding: 14px; }
    .stat-grid { grid-template-columns: 1fr; }
    .sidebar nav { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .full-width { grid-column: auto; }
}

/* Login password eye button */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    margin-top: 0;
}

.password-wrapper {
    position: relative;
    width: 100%;
}

.password-wrapper input {
    width: 100%;
    padding-right: 52px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    padding: 0;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #667085;
    cursor: pointer;
}

.password-toggle svg {
    width: 21px;
    height: 21px;
    fill: currentColor;
}

.password-toggle svg[hidden] {
    display: none;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    color: var(--blue);
    background: var(--blue-light);
    outline: none;
}

/* Basic user dashboard */
.user-dashboard-card {
    width: min(980px, 100%);
    padding: 38px;
    border-radius: 24px;
    background: #fff;
    box-shadow: var(--shadow);
}

.user-dashboard-heading {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-dashboard-heading h1 {
    margin: 5px 0 5px;
}

.user-dashboard-heading p {
    margin: 0;
    color: var(--muted);
}

.user-stat-grid {
    margin: 28px 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
}

.user-stat-grid article {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f8fafc;
}

.user-stat-grid span,
.user-stat-grid strong {
    display: block;
}

.user-stat-grid span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.user-stat-grid strong {
    margin-top: 8px;
    color: var(--navy);
    font-size: 28px;
}

@media (max-width: 750px) {
    .user-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 460px) {
    .user-dashboard-card {
        padding: 25px 20px;
    }

    .user-dashboard-heading {
        align-items: flex-start;
    }

    .user-stat-grid {
        grid-template-columns: 1fr;
    }
}