:root {
    --primary: #b91c1c;
    --primary-dark: #7f1d1d;
    --primary-mid: #991b1b;
    --primary-light: #ef4444;
    --primary-soft: #fee2e2;
    --primary-soft-2: #fff7f7;

    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;

    --text: #0f172a;
    --muted: #475569;
    --muted-light: #64748b;

    --success-bg: #dcfce7;
    --success-text: #166534;
    --warning-bg: #fef3c7;
    --warning-text: #92400e;
    --info-bg: #dbeafe;
    --info-text: #1d4ed8;
    --danger-bg: #fee2e2;
    --danger-text: #991b1b;
    --purple-bg: #ede9fe;
    --orange-bg: #ffedd5;

    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --radius-xl: 28px;

    --shadow-sm: 0 8px 22px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 14px 34px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 26px 70px rgba(15, 23, 42, 0.14);
    --shadow-red: 0 18px 45px rgba(185, 28, 28, 0.22);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", Arial, sans-serif;
}

body {
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

img,
svg {
    max-width: 100%;
}

::selection {
    background: rgba(239, 68, 68, 0.22);
}

/* SHARED BACKGROUND */
.home-body,
.auth-body {
    background:
        radial-gradient(circle at 15% 20%, rgba(239, 68, 68, 0.12), transparent 28%),
        radial-gradient(circle at 85% 10%, rgba(59, 130, 246, 0.10), transparent 26%),
        radial-gradient(circle at 70% 85%, rgba(185, 28, 28, 0.10), transparent 28%),
        var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* HOMEPAGE */
.hero-home {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
}

.hero-left {
    background:
        radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.16), transparent 28%),
        radial-gradient(circle at 85% 85%, rgba(255, 255, 255, 0.10), transparent 25%),
        linear-gradient(135deg, var(--primary-dark), var(--primary), var(--primary-light));
    color: white;
    padding: 70px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-left::before,
.hero-left::after,
.auth-brand::before,
.auth-brand::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    pointer-events: none;
}

.hero-left::before,
.auth-brand::before {
    width: 240px;
    height: 240px;
    right: -80px;
    top: 80px;
}

.hero-left::after,
.auth-brand::after {
    width: 320px;
    height: 320px;
    left: -120px;
    bottom: -130px;
}

.hero-content,
.auth-brand-content {
    max-width: 560px;
    position: relative;
    z-index: 1;
}

.brand-icon {
    width: 76px;
    height: 76px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 38px;
    margin-bottom: 26px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.hero-content h1,
.auth-brand-content h1 {
    font-size: clamp(42px, 5vw, 58px);
    margin: 0 0 16px;
    letter-spacing: -1.7px;
    line-height: 1.05;
    color: white;
}

.hero-content p,
.auth-brand-content p {
    font-size: 20px;
    line-height: 1.7;
    color: #fee2e2;
    margin: 0 0 34px;
}

.home-btn-group {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 34px;
}

.home-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 15px 24px;
    border-radius: 15px;
    text-decoration: none;
    font-weight: 800;
    font-size: 15px;
    transition: all 0.2s ease;
}

.home-btn-primary {
    background: white;
    color: var(--primary);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.home-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}

.home-btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
}

.home-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: translateY(-2px);
}

.feature-list {
    display: grid;
    gap: 14px;
}

.feature-item {
    background: rgba(255, 255, 255, 0.15);
    padding: 15px 18px;
    border-radius: 18px;
    backdrop-filter: blur(8px);
    font-weight: 700;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
    color: white;
}

.hero-right {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 44px;
}

.info-card {
    width: 100%;
    max-width: 480px;
    background: rgba(255, 255, 255, 0.98);
    padding: 40px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(226, 232, 240, 0.95);
}

.info-card h2 {
    font-size: 34px;
    margin: 0 0 12px;
    letter-spacing: -0.5px;
}

.info-card p {
    color: var(--muted-light);
    line-height: 1.7;
    margin: 0 0 28px;
}

.mini-card {
    background: var(--primary-soft-2);
    border: 1px solid #fecaca;
    border-radius: var(--radius-md);
    padding: 16px 18px;
    margin-bottom: 14px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mini-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.mini-card strong {
    display: block;
    color: var(--danger-text);
    margin-bottom: 6px;
}

.footer-note {
    margin-top: 22px;
    font-size: 14px;
    color: var(--muted-light);
}

/* LOGIN / REGISTER PAGES */
.auth-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.08fr 0.92fr;
}

.auth-brand {
    background:
        radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.16), transparent 28%),
        radial-gradient(circle at 85% 85%, rgba(255, 255, 255, 0.10), transparent 25%),
        linear-gradient(135deg, var(--primary-dark), var(--primary), var(--primary-light));
    color: white;
    padding: 70px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.auth-side {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 44px;
    background:
        radial-gradient(circle at 80% 18%, rgba(239, 68, 68, 0.10), transparent 30%),
        radial-gradient(circle at 25% 85%, rgba(59, 130, 246, 0.10), transparent 30%),
        var(--bg);
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: rgba(255, 255, 255, 0.98);
    padding: 40px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(226, 232, 240, 0.95);
}

.auth-card h2 {
    font-size: 34px;
    margin: 0 0 8px;
    letter-spacing: -0.5px;
    color: var(--text);
}

.subtitle {
    color: var(--muted-light);
    margin: 0 0 28px;
    font-size: 15px;
}

.auth-card label,
.form-box label,
.control-card label {
    display: block;
    font-weight: 800;
    margin-bottom: 8px;
    color: #334155;
}

.auth-card input,
.auth-card select,
.form-box input,
.form-box select,
.form-box textarea,
.control-card input,
.control-card select,
.control-card textarea {
    width: 100%;
    padding: 15px 16px;
    border-radius: 15px;
    border: 1px solid var(--border-strong);
    margin-bottom: 18px;
    font-size: 15px;
    transition: all 0.2s ease;
    background: white;
    color: var(--text);
    font-family: inherit;
}

.form-box textarea,
.control-card textarea {
    min-height: 125px;
    resize: vertical;
}

.auth-card input::placeholder,
.form-box input::placeholder,
.form-box textarea::placeholder,
.control-card input::placeholder,
.control-card textarea::placeholder {
    color: #94a3b8;
}

.auth-card input:focus,
.auth-card select:focus,
.form-box input:focus,
.form-box select:focus,
.form-box textarea:focus,
.control-card input:focus,
.control-card select:focus,
.control-card textarea:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
}

input:disabled,
select:disabled,
textarea:disabled {
    background: #f1f5f9;
    color: #64748b;
    cursor: not-allowed;
}

.auth-btn,
button,
.banner-btn,
.dark-btn {
    border: none;
    min-height: 46px;
    padding: 13px 18px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    line-height: 1.2;
}

.auth-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    box-shadow: 0 12px 30px rgba(185, 28, 28, 0.30);
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 40px rgba(185, 28, 28, 0.36);
}

button,
.banner-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    box-shadow: 0 10px 24px rgba(185, 28, 28, 0.22);
}

button:hover,
.banner-btn:hover,
.dark-btn:hover {
    transform: translateY(-2px);
}

button:active,
.banner-btn:active,
.dark-btn:active,
.auth-btn:active,
.home-btn:active {
    transform: translateY(0);
}

button:disabled,
button[disabled] {
    background: #94a3b8 !important;
    color: white !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
    transform: none !important;
}

.dark-btn {
    background: #0f172a;
    color: white;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
}

.error,
.error-message,
.success-message {
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 18px;
    font-weight: 800;
    line-height: 1.5;
}

.error,
.error-message {
    background: var(--danger-bg);
    color: var(--danger-text);
    border: 1px solid #fecaca;
}

.success-message {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid #bbf7d0;
}

.auth-link {
    text-align: center;
    margin-top: 24px;
    color: var(--muted-light);
    font-size: 15px;
}

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

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

/* DASHBOARD / APP PAGES */
.page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px 1fr;
    background:
        radial-gradient(circle at top right, rgba(239, 68, 68, 0.05), transparent 32%),
        var(--bg);
}

.sidebar {
    background: linear-gradient(180deg, var(--primary-dark), var(--primary-mid), var(--primary));
    color: white;
    padding: 28px 22px;
    box-shadow: 8px 0 30px rgba(15, 23, 42, 0.08);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.premium-sidebar h2 {
    margin: 0 0 30px;
    font-size: 34px;
    letter-spacing: -1px;
    color: white;
}

.premium-sidebar h2 span {
    color: #fecaca;
}

.sidebar ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar li {
    margin-bottom: 10px;
}

.sidebar a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.94);
    text-decoration: none;
    padding: 14px 16px;
    border-radius: 14px;
    font-weight: 750;
    transition: all 0.2s ease;
}

.sidebar a:hover,
.sidebar a.active {
    background: rgba(255, 255, 255, 0.14);
    color: white;
    transform: translateX(4px);
}

.sidebar a.active {
    box-shadow: inset 4px 0 0 rgba(255, 255, 255, 0.75);
}

.main {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid var(--border);
    padding: 20px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.topbar strong {
    font-size: 20px;
    letter-spacing: -0.2px;
}

.topbar span {
    color: var(--muted);
    font-weight: 650;
}

.content {
    padding: 28px;
    max-width: 1500px;
    width: 100%;
}

.welcome-banner {
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.18), transparent 28%),
        linear-gradient(135deg, var(--primary-dark), var(--primary), var(--primary-light));
    color: white;
    padding: 28px;
    border-radius: 24px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-red);
}

.welcome-banner h2 {
    margin: 0 0 10px;
    font-size: 30px;
    color: white;
    letter-spacing: -0.4px;
}

.welcome-banner p {
    margin: 0;
    color: #fee2e2;
    line-height: 1.6;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.card,
.form-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-sm);
}

.card + .card,
.form-box + .card,
.card + .form-box {
    margin-top: 20px;
}

.card h3,
.form-box h2,
.form-box h3 {
    margin-top: 0;
    color: var(--text);
    letter-spacing: -0.25px;
}

.card h3 {
    margin-bottom: 14px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 112px;
}

.strong-card {
    border-left: 5px solid var(--primary-light);
}

.stat-card h3 {
    margin: 0 0 6px;
    font-size: 15px;
    color: var(--muted);
}

.stat-card p {
    margin: 0;
    font-size: 32px;
    font-weight: 900;
    color: var(--text);
    line-height: 1;
}

.stat-icon {
    width: 62px;
    height: 62px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    flex-shrink: 0;
}

.stat-icon.blue {
    background: var(--info-bg);
}

.stat-icon.green {
    background: var(--success-bg);
}

.stat-icon.yellow {
    background: var(--warning-bg);
}

.stat-icon.purple {
    background: var(--purple-bg);
}

.stat-icon.red {
    background: var(--danger-bg);
}

.stat-icon.orange {
    background: var(--orange-bg);
}

.control-card {
    margin-bottom: 24px;
}

.control-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.control-actions a {
    text-decoration: none;
}

/* TABLES */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 14px;
    background: white;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
}

th {
    background: var(--surface-soft);
    color: #334155;
    font-size: 13px;
    text-align: left;
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

td {
    padding: 14px 12px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    color: var(--text);
    font-size: 14px;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: var(--primary-soft-2);
}

td form {
    margin: 4px 0;
}

td button,
td .dark-btn {
    min-height: 38px;
    padding: 10px 13px;
    font-size: 13px;
    border-radius: 12px;
}

.empty-state {
    text-align: center;
    color: var(--muted-light);
    padding: 24px;
    font-style: italic;
}

.status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    text-transform: capitalize;
    white-space: nowrap;
}

.status.pending {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.status.approved {
    background: var(--success-bg);
    color: var(--success-text);
}

.status.completed {
    background: var(--info-bg);
    color: var(--info-text);
}

.status.rejected,
.status.cancelled {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.form-box p {
    color: var(--muted-light);
    line-height: 1.6;
}

a {
    color: inherit;
}

a button {
    text-decoration: none;
}

/* ACCESSIBILITY */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(239, 68, 68, 0.28);
    outline-offset: 2px;
}

/* RESPONSIVE */
@media (max-width: 1200px) {
    .page {
        grid-template-columns: 240px 1fr;
    }

    .content {
        padding: 22px;
    }

    .sidebar {
        padding: 24px 18px;
    }
}

@media (max-width: 900px) {

    .hero-home,
    .auth-page,
    .page {
        grid-template-columns: 1fr;
    }

    .hero-left,
    .auth-brand {
        padding: 42px 24px;
        text-align: center;
        justify-content: center;
    }

    .brand-icon {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-content p,
    .auth-brand-content p {
        font-size: 17px;
    }

    .home-btn-group {
        justify-content: center;
    }

    .hero-right,
    .auth-side {
        padding: 28px 18px 36px;
    }

    .info-card,
    .auth-card {
        padding: 30px 24px;
    }

    .sidebar {
        position: relative;
        height: auto;
        padding: 20px 18px;
    }

    .premium-sidebar h2 {
        margin-bottom: 16px;
        font-size: 30px;
    }

    .sidebar ul {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
        gap: 8px;
    }

    .sidebar li {
        margin-bottom: 0;
    }

    .sidebar a:hover,
    .sidebar a.active {
        transform: none;
    }

    .topbar,
    .content {
        padding: 18px;
    }

    .topbar {
        position: relative;
    }

    .welcome-banner {
        flex-direction: column;
        align-items: flex-start;
    }

    .welcome-banner .banner-btn,
    .welcome-banner form,
    .welcome-banner a {
        width: 100%;
    }

    .welcome-banner button,
    .welcome-banner .banner-btn {
        width: 100%;
    }
}

@media (max-width: 700px) {
    .cards {
        grid-template-columns: 1fr;
    }

    .control-actions,
    .control-actions a,
    .control-actions button {
        width: 100%;
    }

    .card,
    .form-box {
        padding: 18px;
        border-radius: 18px;
    }
}

@media (max-width: 520px) {

    .hero-content h1,
    .auth-brand-content h1 {
        font-size: 34px;
    }

    .brand-icon {
        width: 64px;
        height: 64px;
        font-size: 30px;
        border-radius: 18px;
    }

    .home-btn {
        width: 100%;
        text-align: center;
    }

    .auth-card h2,
    .info-card h2,
    .welcome-banner h2 {
        font-size: 28px;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .auth-card,
    .info-card {
        border-radius: 22px;
    }

    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
    }

    th {
        display: none;
    }

    tr {
        margin-bottom: 14px;
        border: 1px solid var(--border);
        border-radius: 14px;
        overflow: hidden;
        background: white;
    }

    td {
        border-bottom: 1px solid #f1f5f9;
        padding: 12px;
    }

    td:last-child {
        border-bottom: none;
    }

    td button,
    td .dark-btn,
    td a,
    td form {
        width: 100%;
    }

    td button,
    td .dark-btn {
        margin-top: 6px;
    }
}
