:root {
    --bg-main: #eef5f4;
    --bg-accent: #d9eeea;
    --glass: rgba(255, 255, 255, 0.52);
    --glass-border: rgba(255, 255, 255, 0.72);
    --text-main: #173531;
    --text-muted: #5f7d78;
    --primary: #0f8874;
    --primary-2: #20a58f;
    --danger: #c2465e;
    --warning: #ca8d2f;
    --success: #2c9874;
    --shadow: 0 10px 30px rgba(25, 54, 48, 0.12);
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
}

html[data-theme="dark"] {
    --bg-main: #0d1719;
    --bg-accent: #132125;
    --glass: rgba(18, 29, 33, 0.64);
    --glass-border: rgba(169, 210, 202, 0.2);
    --text-main: #e4f2f0;
    --text-muted: #a2bebb;
    --primary: #17a88f;
    --primary-2: #24c1a4;
    --danger: #d7677f;
    --warning: #d8a348;
    --success: #48ba92;
    --shadow: 0 16px 36px rgba(2, 9, 11, 0.5);
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: "Sora", sans-serif;
    color: var(--text-main);
    background: radial-gradient(1300px 800px at 5% 0%, #f8fffd 0%, #eef5f4 55%, #e6f1ee 100%);
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

html[data-theme="dark"] body {
    background: radial-gradient(1300px 800px at 5% 0%, #152124 0%, #0d1719 55%, #0b1416 100%);
}

.liquid-background {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(420px circle at 15% 12%, rgba(53, 177, 158, 0.22), transparent 65%),
        radial-gradient(540px circle at 90% 5%, rgba(86, 123, 229, 0.14), transparent 60%),
        radial-gradient(460px circle at 65% 90%, rgba(241, 181, 103, 0.14), transparent 63%);
}

html[data-theme="dark"] .liquid-background {
    background:
        radial-gradient(420px circle at 15% 12%, rgba(24, 172, 143, 0.22), transparent 65%),
        radial-gradient(540px circle at 90% 5%, rgba(64, 107, 197, 0.18), transparent 60%),
        radial-gradient(460px circle at 65% 90%, rgba(186, 125, 51, 0.15), transparent 63%);
}

.glass-panel,
.glass-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow);
}

.glass-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.glass-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 34px rgba(25, 54, 48, 0.16);
    border-color: rgba(255, 255, 255, 0.8);
}

.glass-input,
.form-control.glass-input,
.form-select.glass-input {
    background: rgba(255, 255, 255, 0.48);
    border: 1px solid rgba(255, 255, 255, 0.85);
    color: var(--text-main);
    border-radius: var(--radius-sm);
}

.glass-input:focus {
    border-color: rgba(15, 136, 116, 0.45);
    box-shadow: 0 0 0 0.2rem rgba(15, 136, 116, 0.14);
    background: rgba(255, 255, 255, 0.7);
}

.glass-input::placeholder,
.form-control.glass-input::placeholder {
    color: var(--text-muted);
    opacity: 0.9;
}

.btn {
    border-radius: 999px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

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

.btn-emerald {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    border: none;
    box-shadow: 0 12px 24px rgba(15, 136, 116, 0.24);
}

.btn-emerald:hover {
    color: #fff;
    box-shadow: 0 15px 30px rgba(15, 136, 116, 0.3);
}

.btn-outline-light {
    border-color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.35);
    color: var(--text-main);
}

.icon-btn {
    width: 2.4rem;
    height: 2.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.55);
    color: var(--text-main);
    transition: all 0.2s ease;
}

.icon-btn:hover {
    transform: translateY(-2px) scale(1.02);
    color: var(--primary);
}

.theme-toggle-btn.active {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    border-color: transparent;
    box-shadow: 0 8px 18px rgba(15, 136, 116, 0.34);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.22rem 0.62rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
}

.status-badge.pending {
    background: rgba(202, 141, 47, 0.14);
    color: #94661f;
}

.status-badge.completed,
.status-badge.approved,
.status-badge.success {
    background: rgba(44, 152, 116, 0.14);
    color: #1f7758;
}

.status-badge.rejected,
.status-badge.timed_out,
.status-badge.danger {
    background: rgba(194, 70, 94, 0.14);
    color: #9e3148;
}

.status-badge.info {
    background: rgba(74, 124, 230, 0.14);
    color: #2f61be;
}

.status-badge.warning {
    background: rgba(202, 141, 47, 0.14);
    color: #94661f;
}

.metric-box {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.85rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.72);
}

.metric-box small {
    color: var(--text-muted);
    font-size: 0.72rem;
}

.metric-box strong {
    font-size: 1rem;
    font-weight: 700;
}

.table-glass {
    margin: 0;
    color: var(--text-main);
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-main);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.18);
    --bs-table-striped-color: var(--text-main);
    --bs-table-active-bg: rgba(255, 255, 255, 0.22);
    --bs-table-active-color: var(--text-main);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.42);
    --bs-table-hover-color: var(--text-main);
    --bs-table-border-color: rgba(255, 255, 255, 0.58);
}

.table-glass > :not(caption) > * > * {
    background-color: transparent;
    color: var(--text-main);
}

.table-glass thead th {
    background: rgba(255, 255, 255, 0.35);
    border-bottom: 1px solid rgba(255, 255, 255, 0.85);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.table-glass td {
    border-top: 1px solid rgba(255, 255, 255, 0.58);
    font-size: 0.85rem;
}

.table-glass tbody tr {
    transition: background 0.2s ease;
}

.table-glass tbody tr:hover {
    background: rgba(255, 255, 255, 0.42);
}

.empty-state-inline {
    padding: 1rem;
    text-align: center;
    border: 1px dashed rgba(95, 125, 120, 0.4);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.thumb-48 {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.7);
}

.link-clean {
    color: var(--primary);
    text-decoration: none;
}

.link-clean:hover {
    color: var(--primary-2);
}

.glass-checkbox {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    padding: 0.6rem 0.8rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.36);
    border: 1px solid rgba(255, 255, 255, 0.7);
}

.glass-checkbox input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
}

.fade-in {
    animation: fadeInUp 0.42s ease both;
}

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

.skeleton {
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.38);
    border-radius: 12px;
}

.skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.56), transparent);
    animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

html[data-theme="dark"] .btn-outline-light {
    border-color: rgba(169, 210, 202, 0.32);
    background: rgba(20, 31, 35, 0.76);
    color: var(--text-main);
}

html[data-theme="dark"] .icon-btn {
    border-color: rgba(169, 210, 202, 0.26);
    background: rgba(18, 29, 33, 0.82);
    color: var(--text-main);
}

html[data-theme="dark"] .glass-input,
html[data-theme="dark"] .form-control.glass-input,
html[data-theme="dark"] .form-select.glass-input {
    background: rgba(20, 31, 35, 0.84);
    border-color: rgba(169, 210, 202, 0.24);
    color: var(--text-main);
}

html[data-theme="dark"] .glass-input:focus {
    background: rgba(25, 39, 43, 0.9);
    border-color: rgba(32, 165, 143, 0.56);
    box-shadow: 0 0 0 0.2rem rgba(23, 168, 143, 0.22);
}

html[data-theme="dark"] .table-glass thead th {
    background: rgba(19, 30, 34, 0.84);
    border-bottom-color: rgba(169, 210, 202, 0.24);
}

html[data-theme="dark"] .table-glass td {
    border-top-color: rgba(169, 210, 202, 0.16);
}

html[data-theme="dark"] .table-glass tbody tr:hover {
    background: rgba(22, 34, 39, 0.82);
}

html[data-theme="dark"] .table-glass {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-main);
    --bs-table-striped-bg: rgba(20, 31, 35, 0.78);
    --bs-table-striped-color: var(--text-main);
    --bs-table-active-bg: rgba(20, 31, 35, 0.86);
    --bs-table-active-color: var(--text-main);
    --bs-table-hover-bg: rgba(22, 34, 39, 0.82);
    --bs-table-hover-color: var(--text-main);
    --bs-table-border-color: rgba(169, 210, 202, 0.16);
}

html[data-theme="dark"] .empty-state-inline {
    border-color: rgba(169, 210, 202, 0.28);
    background: rgba(16, 26, 30, 0.6);
}

html[data-theme="dark"] .metric-box,
html[data-theme="dark"] .glass-checkbox,
html[data-theme="dark"] .skeleton {
    background: rgba(20, 31, 35, 0.78);
    border-color: rgba(169, 210, 202, 0.2);
}
