@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Noto+Serif+SC:wght@400;700&display=swap');

:root {
    /* Palette: Modern China */
    --bg-main: #f0f4f8;
    --bg-gradient-start: #f8fafc;
    --bg-gradient-end: #e2e8f0;
    
    --primary: #0f766e;
    --primary-light: #14b8a6;
    --primary-dark: #134e4a;
    
    --secondary: #be123c;
    --accent: #d97706;
    
    --text-main: #334155;
    --text-light: #64748b;
    --text-white: #ffffff;
    
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --border-color: #e2e8f0;
    --card-radius: 16px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.8) 0%, rgba(226, 232, 240, 0.8) 100%),
                url('/static/img/chinese_misty_bg.jpg');
    background-size: auto, cover;
    background-position: center, center;
    color: var(--text-main);
    min-height: 100vh;
    line-height: 1.6;
    background-attachment: fixed, fixed;
}

/* Background decorative overlay removed in favor of chinese_bg.png image */

/* ========================= */
/* GLASSMORPHISM CARD        */
/* ========================= */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--card-radius);
    box-shadow: var(--glass-shadow);
    padding: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 12px 48px 0 rgba(31, 38, 135, 0.12);
}

/* ========================= */
/* STAT CARDS                */
/* ========================= */
.stat-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.stat-icon.primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.stat-icon.success {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
}

.stat-icon.accent {
    background: linear-gradient(135deg, var(--accent) 0%, #b45309 100%);
    color: white;
}

.stat-icon.danger {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    color: white;
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

/* ========================= */
/* LAYOUT UTILITIES          */
/* ========================= */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.flex-col {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.flex-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.text-center { text-align: center; }
.text-right { text-align: right; }

.w-full { width: 100%; }

/* ========================= */
/* HEADER                    */
/* ========================= */
header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.6);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header .logo {
    font-family: 'Noto Serif SC', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

header .logo i {
    color: var(--accent);
}

header nav {
    display: flex;
    align-items: center;
}

header nav a {
    color: var(--text-light);
    text-decoration: none;
    margin-left: 2rem;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

header nav a:hover,
header nav a.active {
    color: var(--primary);
}

header nav a.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 2px;
}

.nav-btn-logout {
    background: none;
    border: 1px solid var(--secondary);
    color: var(--secondary);
    padding: 0.5rem 1.25rem;
    border-radius: 25px;
    cursor: pointer;
    margin-left: 2rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-btn-logout:hover {
    background: var(--secondary);
    color: white;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* ========================= */
/* BUTTONS                   */
/* ========================= */
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 4px 15px rgba(15, 118, 110, 0.25);
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(15, 118, 110, 0.35);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-color);
    color: var(--primary);
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning) 0%, #d97706 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* ========================= */
/* TYPOGRAPHY                */
/* ========================= */
h1, h2, h3, h4, h5 {
    color: var(--primary-dark);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

h1 {
    font-family: 'Noto Serif SC', serif;
    font-size: 2.5rem;
}

h2 {
    font-family: 'Noto Serif SC', serif;
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

h5 {
    font-size: 1.1rem;
}

.text-muted {
    color: var(--text-light);
}

.text-primary {
    color: var(--primary);
}

.text-success {
    color: var(--success);
}

.text-warning {
    color: var(--warning);
}

.text-danger {
    color: var(--danger);
}

/* ========================= */
/* CARDS - SECTION HEADER    */
/* ========================= */
.card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.card-header i {
    color: var(--primary);
    font-size: 1.1rem;
}

.card-header h5 {
    margin: 0;
    font-weight: 600;
}

/* ========================= */
/* TABLES                    */
/* ========================= */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th {
    text-align: left;
    padding: 1rem 1.25rem;
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: rgba(0, 0, 0, 0.02);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    color: var(--text-main);
}

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

tbody tr {
    transition: background 0.2s;
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* ========================= */
/* STATUS BADGES             */
/* ========================= */
.status-badge {
    padding: 0.4rem 0.9rem;
    border-radius: 25px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.status-success {
    background: rgba(16, 185, 129, 0.12);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.status-warning {
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.status-danger {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.status-info {
    background: rgba(15, 118, 110, 0.12);
    color: var(--primary);
    border: 1px solid rgba(15, 118, 110, 0.25);
}

/* ========================= */
/* STAT CARDS                */
/* ========================= */
.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-icon.primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
}

.stat-icon.accent {
    background: linear-gradient(135deg, var(--accent) 0%, #f59e0b 100%);
    color: white;
}

.stat-icon.success {
    background: linear-gradient(135deg, var(--success) 0%, #34d399 100%);
    color: white;
}

.stat-icon.danger {
    background: linear-gradient(135deg, var(--danger) 0%, #f87171 100%);
    color: white;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-dark);
    font-family: 'Noto Serif SC', serif;
    line-height: 1;
}

.stat-label {
    color: var(--text-light);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

/* ========================= */
/* FORM INPUTS               */
/* ========================= */
input,
select,
textarea {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.2s;
    font-family: inherit;
    font-size: 0.95rem;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.1);
}

input[type="checkbox"] {
    width: auto;
    accent-color: var(--primary);
}

label {
    display: block;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-text {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

/* ========================= */
/* ALERTS                    */
/* ========================= */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-info {
    background: rgba(15, 118, 110, 0.1);
    color: var(--primary);
    border: 1px solid rgba(15, 118, 110, 0.2);
}

/* ========================= */
/* SCROLLBAR                 */
/* ========================= */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ========================= */
/* RESPONSIVE BREAKPOINTS    */
/* ========================= */
@media (max-width: 1200px) {
    .container {
        max-width: 960px;
    }
}

@media (max-width: 992px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
        margin: 1rem auto;
    }
    
    .grid-4,
    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    
    /* Header Mobile */
    .header-content {
        flex-wrap: wrap;
        padding: 1rem;
    }
    
    .menu-toggle {
        display: block;
    }
    
    header nav {
        display: none;
        width: 100%;
        flex-direction: column;
        padding-top: 1rem;
        border-top: 1px solid rgba(0, 0, 0, 0.05);
        margin-top: 1rem;
    }
    
    header nav.nav-open {
        display: flex;
    }
    
    header nav a {
        margin-left: 0;
        margin-bottom: 0.25rem;
        padding: 0.75rem 1rem;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.5);
        width: 100%;
    }
    
    header nav a:hover,
    header nav a.active {
        background: white;
    }
    
    header nav a.active::after {
        display: none;
    }
    
    .nav-btn-logout {
        margin-left: 0;
        margin-top: 0.5rem;
        width: 100%;
        justify-content: center;
    }
    
    /* Tables */
    th, td {
        padding: 0.75rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .card {
        padding: 1.25rem;
        border-radius: 12px;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 0.65rem 1.25rem;
        font-size: 0.9rem;
    }
}

/* ========================= */
/* ANIMATIONS                */
/* ========================= */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.4s ease forwards;
}

/* ========================= */
/* SPECIAL COMPONENTS        */
/* ========================= */
.price-display {
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 12px;
    text-align: center;
}

.price-display .label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.price-display .value {
    color: white;
    font-size: 2rem;
    font-weight: 700;
    font-family: 'Noto Serif SC', serif;
}

.divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.08);
    margin: 1.5rem 0;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.info-row:last-child {
    border-bottom: none;
}

.info-row .label {
    color: var(--text-light);
}

.info-row .value {
    font-weight: 500;
}

/* Feature check list */
.feature-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 10px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.feature-item i.active {
    color: var(--success);
}


/* Icon link button */
.btn-icon-primary {
    background-color: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-icon-primary:hover {
    background-color: var(--primary);
    color: white;
    transform: scale(1.1);
}

/* ========================= */
/* CUSTOM CHECKBOX STYLING   */
/* ========================= */
.custom-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    position: relative;
    user-select: none;
}

.custom-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    clip: rect(0, 0, 0, 0);
}

.custom-checkbox .checkmark {
    height: 22px;
    width: 22px;
    background-color: #fff;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.custom-checkbox:hover .checkmark {
    border-color: var(--primary);
}

.custom-checkbox input[type="checkbox"]:checked ~ .checkmark {
    background-color: var(--success);
    border-color: var(--success);
}

.custom-checkbox .checkmark::after {
    content: "";
    display: none;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

.custom-checkbox input[type="checkbox"]:checked ~ .checkmark::after {
    display: block;
}

.custom-checkbox .label-text {
    font-weight: 500;
    color: var(--text-main);
}

/* Back Button */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    background: rgba(15, 118, 110, 0.08);
    border: 1px solid rgba(15, 118, 110, 0.2);
}

.btn-back:hover {
    color: var(--primary-dark);
    background: rgba(15, 118, 110, 0.15);
    transform: translateX(-3px);
}

.btn-back i {
    font-size: 0.9rem;
}
