:root {
    --color-bg: #f5f7fb;
    --color-bg-accent: #eef1f9;
    --color-surface: rgba(255, 255, 255, 0.92);
    --color-border: rgba(148, 163, 184, 0.18);
    --color-primary: #6366f1;
    --color-primary-dark: #4f46e5;
    --color-secondary: #38bdf8;
    --color-heading: #1f2937;
    --color-body: #475569;
    --color-muted: #94a3b8;
    --shadow-soft: 0 20px 45px rgba(15, 23, 42, 0.12);
    --shadow-lifted: 0 24px 65px rgba(15, 23, 42, 0.18);
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --backdrop: blur(18px);
    --transition-base: all 0.3s ease;
    --transition-slow: all 0.45s ease;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 82px;
}

body {
    font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    margin: 0;
    color: var(--color-body);
    background: radial-gradient(circle at 15% 20%, rgba(99, 102, 241, 0.18), transparent 55%),
                radial-gradient(circle at 85% 10%, rgba(56, 189, 248, 0.18), transparent 50%),
                radial-gradient(circle at 20% 85%, rgba(236, 72, 153, 0.14), transparent 55%),
                var(--color-bg);
    overflow-x: hidden;
    line-height: 1.6;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0.35));
    opacity: 0.65;
    pointer-events: none;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: var(--transition-base);
}

a:hover {
    color: var(--color-primary-dark);
}

img {
    max-width: 100%;
    display: block;
}

.container {
    width: min(96vw, 1480px);
    margin: 0 auto;
    padding: 0 clamp(18px, 3vw, 36px);
}

.content-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 clamp(18px, 3vw, 36px);
}

.page-wrapper {
    width: 100%;
    min-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
}

.page-content {
    flex: 1;
    padding: clamp(24px, 3vw, 48px) 0;
}

.content-container {
    display: flex;
    flex-direction: column;
    gap: clamp(20px, 2vw, 32px);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--color-heading);
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 0.75em;
}

h1 { font-size: clamp(2rem, 2.6vw, 3rem); }
h2 { font-size: clamp(1.8rem, 2.2vw, 2.4rem); }
h3 { font-size: clamp(1.4rem, 2vw, 2rem); }
h4 { font-size: clamp(1.2rem, 1.8vw, 1.5rem); }

p {
    margin: 0 0 1em;
    color: var(--color-body);
    max-width: 80ch;
}

.page-header {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: clamp(28px, 3vw, 48px);
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.page-header::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at right top, rgba(99, 102, 241, 0.16), transparent 60%);
    pointer-events: none;
}

.page-header h1 {
    margin-bottom: 12px;
}

.page-header p {
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    color: var(--color-muted);
    margin: 0;
}

.card {
    position: relative;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: clamp(24px, 2.5vw, 36px);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--color-border);
    transition: var(--transition-slow);
    overflow: hidden;
}

.card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(145deg, rgba(99, 102, 241, 0.08), rgba(56, 189, 248, 0.05));
    opacity: 0;
    transition: var(--transition-slow);
    pointer-events: none;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lifted);
}

.card:hover::before {
    opacity: 1;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 18px;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.card-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: clamp(1.3rem, 1.6vw, 1.6rem);
    font-weight: 700;
    color: var(--color-heading);
}

.card-title i {
    font-size: 1.4em;
    color: var(--color-primary);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 22px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.btn::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.35), transparent 65%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn:hover::after {
    opacity: 1;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: #fff;
    box-shadow: 0 16px 35px rgba(99, 102, 241, 0.35);
}

.btn-secondary {
    background: rgba(148, 163, 184, 0.16);
    color: var(--color-heading);
}

.btn-danger {
    background: linear-gradient(135deg, #f97316, #ef4444);
    color: #fff;
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #22d3ee);
    color: #fff;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
    filter: brightness(0.98);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 16px 30px;
    font-size: 1.05rem;
}

.form-group {
    margin-bottom: 22px;
    position: relative;
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--color-heading);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1.5px solid rgba(148, 163, 184, 0.35);
    background: rgba(255, 255, 255, 0.82);
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition-base);
}

.form-control:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.65);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.18);
    background: rgba(255, 255, 255, 0.95);
}

.form-control::placeholder {
    color: var(--color-muted);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 20px;
    padding-right: 48px;
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    border-radius: calc(var(--radius-lg) - 6px);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.95));
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.92rem;
}

thead th {
    position: sticky;
    top: 0;
    background: linear-gradient(180deg, rgba(244, 245, 255, 0.95), rgba(237, 242, 255, 0.95));
    color: var(--color-heading);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.8rem;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
    z-index: 1;
}

tbody tr {
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

tbody tr:hover {
    background: rgba(99, 102, 241, 0.06);
    box-shadow: inset 0 0 0 9999px rgba(99, 102, 241, 0.05);
}

tbody tr:nth-child(even) {
    background: rgba(15, 23, 42, 0.02);
}

td {
    padding: 18px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    color: var(--color-body);
}

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

.table-compact td {
    padding-block: 12px;
}

.alert {
    padding: 18px 22px;
    border-radius: var(--radius-sm);
    border-left: 4px solid;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.12);
    animation: fadeInUp 0.3s ease-out both;
}

.alert-success { border-color: #22c55e; color: #166534; }
.alert-warning { border-color: #f97316; color: #9a3412; }
.alert-danger { border-color: #ef4444; color: #991b1b; }
.alert-info { border-color: #38bdf8; color: #0369a1; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    background: rgba(99, 102, 241, 0.12);
    color: var(--color-primary);
}

.badge-success { background: rgba(34, 197, 94, 0.15); color: #15803d; }
.badge-warning { background: rgba(249, 115, 22, 0.16); color: #c2410c; }
.badge-danger { background: rgba(239, 68, 68, 0.16); color: #b91c1c; }

.row {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(16px, 2vw, 24px);
}

.col {
    flex: 1 1 260px;
    min-width: 0;
}

.col-1 { flex: 0 0 8.333%; min-width: 8.333%; }
.col-2 { flex: 0 0 16.666%; min-width: 16.666%; }
.col-3 { flex: 0 0 25%; min-width: 25%; }
.col-4 { flex: 0 0 33.333%; min-width: 33.333%; }
.col-6 { flex: 0 0 50%; min-width: 50%; }
.col-8 { flex: 0 0 66.666%; min-width: 66.666%; }
.col-9 { flex: 0 0 75%; min-width: 75%; }
.col-12 { flex: 0 0 100%; min-width: 100%; }

.metric-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    align-items: center;
}

.metric-card strong {
    font-size: clamp(1.6rem, 2vw, 2rem);
    color: var(--color-heading);
}

.metric-card span {
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.75rem;
}

.empty-state {
    text-align: center;
    padding: clamp(40px, 6vw, 72px) 20px;
    background: rgba(255, 255, 255, 0.88);
    border-radius: var(--radius-lg);
    border: 1px dashed rgba(148, 163, 184, 0.35);
}

.empty-state-icon {
    font-size: clamp(3rem, 6vw, 4rem);
    color: rgba(99, 102, 241, 0.6);
    margin-bottom: 16px;
}

.empty-state-title {
    font-size: clamp(1.4rem, 2vw, 1.8rem);
    color: var(--color-heading);
    margin-bottom: 10px;
}

.empty-state-text {
    color: var(--color-muted);
    max-width: 520px;
    margin: 0 auto;
}

.fade-in-up {
    opacity: 0;
    transform: translateY(18px);
    transition: transform 0.6s ease, opacity 0.6s ease;
    transition-delay: var(--animate-delay, 0s);
}

.fade-in-up.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.glass {
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: var(--shadow-soft);
    backdrop-filter: var(--backdrop);
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(148, 163, 184, 0.18);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--color-primary), var(--color-secondary));
    border-radius: 999px;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

@media (max-width: 1024px) {
    .container,
    .content-container {
        width: min(98vw, 1100px);
        padding: 0 20px;
    }

    .card {
        padding: 24px;
    }
}

@media (max-width: 768px) {
    .page-content {
        padding: 24px 0;
    }

    .card {
        padding: 20px;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    thead th {
        position: static;
    }

    .row {
        flex-direction: column;
    }
}

@supports (backdrop-filter: blur(10px)) {
    .card,
    .page-header,
    .alert {
        backdrop-filter: var(--backdrop);
    }
}
