/* =========================================
   I-Village Design System v2
   ========================================= */

:root {
    --iv-white: #ffffff;
    --iv-beige: #f4eee5;
    --iv-beige-light: #faf7f3;
    --iv-green: #1f3d34;
    --iv-green-mid: #2d5c4a;
    --iv-green-light: #3a7a60;
    --iv-gold: #c7a55b;
    --iv-gold-pale: #f5e9ca;
    --iv-neutral-50: #f9fafb;
    --iv-neutral-100: #f3f4f6;
    --iv-neutral-200: #e5e7eb;
    --iv-neutral-400: #9ca3af;
    --iv-neutral-600: #4b5563;
    --iv-neutral-900: #111827;
    --iv-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --iv-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 2px 6px rgba(0, 0, 0, 0.05);
    --iv-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.09), 0 2px 4px rgba(0, 0, 0, 0.05);
    --iv-shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.13), 0 4px 8px rgba(0, 0, 0, 0.06);
    --iv-radius: 0.875rem;
    --iv-radius-sm: 0.5rem;
}

/* ---- Base ---- */
html,
body {
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    background: var(--iv-beige-light);
    color: var(--iv-neutral-900);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- Page animation ---- */
.page-shell {
    animation: fadeIn 380ms ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---- Cards ---- */
.card-hover {
    transition: transform 240ms ease, box-shadow 240ms ease;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--iv-shadow-lg);
}

.card-base {
    background: #fff;
    border: 1.5px solid var(--iv-neutral-200);
    border-radius: var(--iv-radius);
    box-shadow: var(--iv-shadow-sm);
}

/* ---- Transitions ---- */
.soft-transition {
    transition: all 200ms ease;
}

/* ---- Backgrounds ---- */
.muted-bg {
    background: var(--iv-beige-light);
}

.hero-gradient {
    background: linear-gradient(135deg, var(--iv-green) 0%, var(--iv-green-mid) 60%, var(--iv-green-light) 100%);
}

/* ---- Brand Text ---- */
.brand-green {
    color: var(--iv-green);
}

.brand-gold {
    color: var(--iv-gold);
}

/* ---- Buttons ---- */
.brand-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--iv-green);
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.01em;
    border-radius: var(--iv-radius-sm);
    box-shadow: 0 2px 8px rgba(31, 61, 52, 0.28);
    transition: background 200ms, transform 160ms, box-shadow 200ms;
    cursor: pointer;
    border: none;
    text-decoration: none;
}

.brand-button:hover {
    background: var(--iv-green-mid);
    box-shadow: 0 5px 16px rgba(31, 61, 52, 0.34);
    transform: translateY(-1px);
}

.brand-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(31, 61, 52, 0.2);
}

.brand-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--iv-gold);
    color: var(--iv-green);
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: var(--iv-radius-sm);
    transition: background 200ms, border-color 200ms;
    cursor: pointer;
    text-decoration: none;
}

.brand-outline:hover {
    background: var(--iv-gold-pale);
    border-color: #b8943e;
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--iv-neutral-600);
    font-weight: 500;
    font-size: 0.875rem;
    border-radius: var(--iv-radius-sm);
    transition: background 200ms, color 200ms;
    cursor: pointer;
    text-decoration: none;
}

.btn-ghost:hover {
    background: var(--iv-neutral-100);
    color: var(--iv-green);
}

/* ---- Form Inputs ---- */
.iv-input {
    width: 100%;
    border: 1.5px solid var(--iv-neutral-200);
    border-radius: var(--iv-radius-sm);
    padding: 0.65rem 0.9rem;
    font-size: 0.9375rem;
    font-family: inherit;
    background: #fff;
    color: var(--iv-neutral-900);
    transition: border-color 200ms, box-shadow 200ms;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.iv-input:focus {
    border-color: var(--iv-green);
    box-shadow: 0 0 0 3px rgba(31, 61, 52, 0.09);
}

.iv-input::placeholder {
    color: var(--iv-neutral-400);
}

.iv-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.3rem;
    letter-spacing: 0.01em;
}

.iv-select {
    width: 100%;
    border: 1.5px solid var(--iv-neutral-200);
    border-radius: var(--iv-radius-sm);
    padding: 0.65rem 2.4rem 0.65rem 0.9rem;
    font-size: 0.9375rem;
    font-family: inherit;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236b7280'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E") no-repeat right 0.75rem center / 1.1rem;
    color: var(--iv-neutral-900);
    transition: border-color 200ms, box-shadow 200ms;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.iv-select:focus {
    border-color: var(--iv-green);
    box-shadow: 0 0 0 3px rgba(31, 61, 52, 0.09);
}

/* ---- Badges ---- */
.badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.22rem 0.65rem;
    border-radius: 999px;
    white-space: nowrap;
}

.badge-green {
    background: #ecfdf5;
    color: #065f46;
}

.badge-gold {
    background: var(--iv-gold-pale);
    color: #92700a;
}

.badge-red {
    background: #fef2f2;
    color: #991b1b;
}

.badge-neutral {
    background: var(--iv-neutral-100);
    color: #374151;
}

.badge-blue {
    background: #eff6ff;
    color: #1d4ed8;
}

/* ---- Section Label ---- */
.section-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--iv-gold);
}

/* ---- Stat Cards ---- */
.stat-card {
    border-radius: var(--iv-radius);
    padding: 1.25rem 1.375rem;
    background: #fff;
    border: 1.5px solid var(--iv-neutral-200);
    box-shadow: var(--iv-shadow-sm);
    transition: box-shadow 220ms, transform 220ms;
}

.stat-card:hover {
    box-shadow: var(--iv-shadow-md);
    transform: translateY(-2px);
}

.stat-card-green {
    border-left: 4px solid var(--iv-green);
}

.stat-card-gold {
    border-left: 4px solid var(--iv-gold);
}

.stat-card-blue {
    border-left: 4px solid #3b82f6;
}

.stat-card-rose {
    border-left: 4px solid #f43f5e;
}

.stat-card-teal {
    border-left: 4px solid #14b8a6;
}

/* ---- Tables ---- */
.iv-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.iv-table thead th {
    background: var(--iv-neutral-50);
    color: var(--iv-neutral-600);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1.5px solid var(--iv-neutral-200);
}

.iv-table tbody tr {
    border-bottom: 1px solid var(--iv-neutral-100);
    transition: background 160ms;
}

.iv-table tbody tr:hover {
    background: #f9fafb;
}

.iv-table tbody td {
    padding: 0.75rem 1rem;
    color: #374151;
}

.iv-table tbody tr:last-child {
    border-bottom: none;
}

/* ---- Divider ---- */
.iv-divider {
    border: none;
    border-top: 1.5px solid var(--iv-neutral-100);
    margin: 2rem 0;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}