body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
}

.main-header {
    background: #333;
    color: #fff;
    padding: 10px 20px;
}

.main-header nav a {
    color: #fff;
    margin-right: 10px;
    text-decoration: none;
}

.main-content {
    padding: 20px;
}

.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #f5f5f5;
}

.auth-container {
    background: #fff;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 0 6px rgba(0,0,0,0.1);
    min-width: 300px;
}

.auth-form label {
    display: block;
    margin-bottom: 10px;
}

.auth-form input {
    width: 100%;
    padding: 6px;
    margin-top: 4px;
}

.alert.alert-error {
    background: #ffe5e5;
    color: #b10000;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 3px;
}

:root {
    --color-bg: #0f172a;
    --color-bg-light: #111827;
    --color-primary: #3b82f6;
    --color-primary-dark: #2563eb;
    --color-border: #1f2937;
    --color-text: #e5e7eb;
    --color-muted: #9ca3af;
    --color-error: #f97373;
    --radius-lg: 16px;
    --shadow-lg: 0 20px 40px rgba(15, 23, 42, 0.7);
    --transition-fast: 0.2s ease-in-out;
    --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body.auth-body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-main);
    color: var(--color-text);
    background: radial-gradient(circle at top left, #1d4ed8, #020617 45%, #000);
}

/* Layout */

.auth-wrapper {
    display: grid;
    grid-template-columns: minmax(0, 460px) minmax(0, 1.2fr);
    min-height: 100vh;
}

.auth-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 48px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 2;
}

.auth-side {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #1d4ed8 0%, #0f172a 40%, #020617 100%);
}

.auth-side-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 10% 20%, rgba(96, 165, 250, 0.4), transparent 55%),
        radial-gradient(circle at 90% 80%, rgba(59, 130, 246, 0.5), transparent 55%);
    opacity: 0.8;
}

.auth-side-content {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px;
    color: white;
}

.auth-side-content h2 {
    font-size: clamp(2.2rem, 3vw, 2.8rem);
    margin-bottom: 1rem;
}

.auth-side-content p {
    font-size: 1.05rem;
    max-width: 420px;
    color: rgba(226, 232, 240, 0.9);
}

/* Brand */

.auth-brand {
    display: flex;
    align-items: center;
    margin-bottom: 32px;
}

.auth-logo {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: radial-gradient(circle at 30% 0%, #60a5fa, #1d4ed8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #eff6ff;
    font-weight: 700;
    letter-spacing: 0.03em;
    margin-right: 12px;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.6);
}

.auth-brand-text h1 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.auth-brand-text p {
    margin: 2px 0 0;
    font-size: 0.85rem;
    color: var(--color-muted);
}

/* Content */

.auth-content {
    width: 100%;
    max-width: 380px;
}

.auth-header h2 {
    margin: 0 0 6px;
    font-size: 1.6rem;
}

.auth-header p {
    margin: 0 0 24px;
    color: var(--color-muted);
}

/* Form */

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.9rem;
    color: var(--color-muted);
}

.form-group input {
    border-radius: 10px;
    border: 1px solid var(--color-border);
    padding: 10px 12px;
    font-size: 0.95rem;
    background: #020617;
    color: var(--color-text);
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.form-group input::placeholder {
    color: #4b5563;
}

.form-group input:focus {
    border-color: var(--color-primary);
    background: #020617;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.4);
}

/* Buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 9px 18px;
    font-size: 0.95rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.45);
    width: 100%;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.55);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.4);
}

/* Alerts */

.alert {
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.alert-error {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.6);
    color: #fecaca;
}

/* Footer / Links */

.form-footer {
    margin-top: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.auth-alt {
    margin-top: 18px;
    font-size: 0.9rem;
    color: var(--color-muted);
}

.auth-link {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
}

.auth-link:hover {
    text-decoration: underline;
}

.auth-footer {
    margin-top: 30px;
    font-size: 0.8rem;
    color: var(--color-muted);
}

/* Responsive */

@media (max-width: 900px) {
    .auth-wrapper {
        grid-template-columns: 1fr;
    }

    .auth-side {
        display: none;
    }

    .auth-card {
        min-height: 100vh;
        padding: 32px 24px;
        max-width: 480px;
        margin: 0 auto;
        box-shadow: none;
        background: rgba(15, 23, 42, 0.98);
    }
}

/* =========================
   App Shell (Dashboard)
   ========================= */

body.app-body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-main, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
    background: #020617;
    color: #e5e7eb;
}

.app-shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: 100vh;
}

/* Sidebar */

.app-sidebar {
    background: radial-gradient(circle at top, #1d4ed8 0, #020617 45%);
    color: #e5e7eb;
    display: flex;
    flex-direction: column;
    padding: 20px 18px;
    border-right: 1px solid rgba(15, 23, 42, 0.9);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: radial-gradient(circle at 30% 0%, #60a5fa, #1d4ed8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #eff6ff;
    font-weight: 700;
    margin-right: 10px;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.6);
}

.sidebar-title span {
    display: block;
    font-size: 0.98rem;
    font-weight: 600;
}

.sidebar-title small {
    color: #9ca3af;
    font-size: 0.78rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: auto;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    color: #e5e7eb;
    text-decoration: none;
    font-size: 0.93rem;
    transition: background 0.15s ease, transform 0.1s ease;
}

.nav-link:hover {
    background: rgba(15, 23, 42, 0.6);
    transform: translateX(1px);
}

.nav-link.active {
    background: rgba(15, 23, 42, 0.9);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.6);
}

.nav-link-muted {
    color: #9ca3af;
}

.nav-link-muted:hover {
    color: #e5e7eb;
}

.nav-icon {
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    margin-top: 16px;
    border-top: 1px solid rgba(15, 23, 42, 0.8);
    padding-top: 10px;
}

/* Main */

.app-main {
    display: flex;
    flex-direction: column;
    background: radial-gradient(circle at top left, #0f172a 0, #020617 48%);
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 28px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(14px);
    background: linear-gradient(to bottom, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.75));
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-title {
    margin: 0;
    font-size: 1.4rem;
}

.header-subtitle {
    margin: 4px 0 0;
    font-size: 0.9rem;
    color: #9ca3af;
}

/* User badge */

.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(31, 41, 55, 0.9);
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: #eff6ff;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.9rem;
}

.user-role {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* Content */

.app-content {
    padding: 22px 28px 28px;
}

/* Dashboard panels */

.dashboard-greeting {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.greeting-main h2 {
    margin: 0 0 6px;
    font-size: 1.3rem;
}

.greeting-main p {
    margin: 0;
    font-size: 0.95rem;
    color: #9ca3af;
}

.greeting-stats {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-pill {
    border-radius: 999px;
    border: 1px solid rgba(31, 41, 55, 0.9);
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(15, 23, 42, 0.9);
}

.stat-label {
    font-size: 0.78rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-value {
    font-size: 0.85rem;
}

/* Grid */

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    grid-auto-rows: minmax(0, auto);
    gap: 18px;
}

.dashboard-grid > .card:nth-child(3) {
    grid-column: 1 / span 2;
}

/* Cards */

.card {
    background: rgba(15, 23, 42, 0.9);
    border-radius: 14px;
    border: 1px solid rgba(31, 41, 55, 0.9);
    padding: 16px 16px 18px;
    box-shadow: 0 18px 30px rgba(15, 23, 42, 0.7);
}

.card-highlight {
    border-color: rgba(59, 130, 246, 0.7);
    box-shadow: 0 20px 40px rgba(37, 99, 235, 0.35);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.card-header h3 {
    margin: 0;
    font-size: 1rem;
}

.badge {
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 999px;
}

.badge-blue {
    background: rgba(37, 99, 235, 0.15);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.7);
}

/* Card content */

.card-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.card-list li {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: flex-start;
    gap: 10px;
}

.card-list strong {
    font-size: 0.95rem;
}

.card-list p {
    margin: 2px 0 0;
    font-size: 0.85rem;
    color: #9ca3af;
}

.dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    margin-top: 5px;
}

.dot-blue {
    background: #3b82f6;
}

.dot-yellow {
    background: #eab308;
}

.dot-green {
    background: #22c55e;
}

/* Quick actions */

.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quick-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #020617;
    border-radius: 10px;
    padding: 9px 10px;
    text-decoration: none;
    color: #e5e7eb;
    font-size: 0.92rem;
    border: 1px solid rgba(31, 41, 55, 0.9);
    transition: background 0.15s ease, transform 0.1s ease, border-color 0.15s ease;
}

.quick-btn:hover {
    background: #020617;
    transform: translateY(-1px);
    border-color: rgba(59, 130, 246, 0.8);
}

.quick-icon {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.card-empty {
    margin: 4px 0 0;
    font-size: 0.88rem;
    color: #9ca3af;
}

/* Responsive */

@media (max-width: 960px) {
    .app-shell {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .sidebar-title {
        display: none;
    }

    .sidebar-nav .nav-link span:nth-child(2) {
        display: none;
    }
}

@media (max-width: 720px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .app-sidebar {
        flex-direction: row;
        align-items: center;
        padding: 10px;
        border-right: none;
        border-bottom: 1px solid rgba(15, 23, 42, 0.9);
    }

    .sidebar-brand {
        margin-bottom: 0;
        margin-right: 10px;
    }

    .sidebar-nav {
        flex-direction: row;
        gap: 4px;
        margin-bottom: 0;
        margin-left: 10px;
    }

    .sidebar-footer {
        margin-top: 0;
        margin-left: auto;
        border-top: none;
        padding-top: 0;
    }

    .app-header {
        padding: 14px 16px;
    }

    .app-content {
        padding: 16px;
    }

    .dashboard-greeting {
        flex-direction: column;
        gap: 10px;
    }

    .dashboard-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .dashboard-grid > .card:nth-child(3) {
        grid-column: auto;
    }
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th,
.data-table td {
    padding: 8px 6px;
    border-bottom: 1px solid rgba(31, 41, 55, 0.9);
    text-align: left;
}

.data-table th {
    font-weight: 500;
    color: #9ca3af;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.table-actions {
    text-align: right;
    white-space: nowrap;
}

.table-link {
    color: #60a5fa;
    text-decoration: none;
    font-size: 0.85rem;
}

.table-link:hover {
    text-decoration: underline;
}

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

.form-grid .form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-grid .form-group span-2,
.form-grid .span-2 {
    grid-column: span 2;
}

.quote-item-row {
    border: 1px solid rgba(31, 41, 55, 0.7);
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 10px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.quote-item-row .span-2 {
    grid-column: span 3;
}

@media (max-width: 720px) {
    .quote-item-row {
        grid-template-columns: minmax(0, 1fr);
    }
}