/* ========================================================
   HEIN HOA — BOTANICAL ATELIER DESIGN SYSTEM (2026)
   Phong cách: Editorial Floral Studio — Tinh tế, ấm áp, hiện đại
   ======================================================== */

:root {
    /* Light Mode — Warm Alabaster & Sage Botanical */
    --bg-page: #FAF7F2;
    --bg-subtle: #F3EFE6;
    --bg-card: #FFFFFF;
    --bg-card-hover: #FCFBF9;
    --bg-glass: rgba(250, 247, 242, 0.88);

    --text-main: #1C2520;
    --text-secondary: #4A5850;
    --text-muted: #7A8880;

    --border-soft: #E6E0D5;
    --border-strong: #D5CBBF;

    --brand: #23533D;
    --brand-hover: #1A402E;
    --brand-light: #EAF2EE;
    --brand-accent: #387B5B;

    --rose-accent: #C85A6E;
    --rose-soft: #FDF2F4;
    --amber-accent: #C87D20;
    --amber-soft: #FEF7EC;

    --shadow-card: 0 2px 12px -2px rgba(28, 37, 32, 0.05), 0 1px 4px -1px rgba(28, 37, 32, 0.03);
    --shadow-elevated: 0 14px 34px -6px rgba(28, 37, 32, 0.09), 0 4px 12px -2px rgba(28, 37, 32, 0.04);
    --radius-card: 20px;
}

.dark {
    /* Dark Mode — Deep Forest Espresso & Soft Sage */
    --bg-page: #0F1512;
    --bg-subtle: #161F1A;
    --bg-card: #18221D;
    --bg-card-hover: #1D2923;
    --bg-glass: rgba(15, 21, 18, 0.88);

    --text-main: #EFF5F1;
    --text-secondary: #B0C0B6;
    --text-muted: #76877D;

    --border-soft: #26352D;
    --border-strong: #34483D;

    --brand: #40916C;
    --brand-hover: #52B788;
    --brand-light: rgba(64, 145, 108, 0.16);
    --brand-accent: #74C69D;

    --rose-accent: #E57A8E;
    --rose-soft: rgba(229, 122, 142, 0.14);
    --amber-accent: #EAB354;
    --amber-soft: rgba(234, 179, 84, 0.14);

    --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.35);
    --shadow-elevated: 0 18px 40px -6px rgba(0, 0, 0, 0.55);
}

/* ================= BASE & TYPOGRAPHY ================= */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body, button, input, select, textarea {
    font-family: 'Be Vietnam Pro', 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

body {
    background-color: var(--bg-page);
    color: var(--text-main);
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.25s ease, color 0.25s ease;
    background-image:
        radial-gradient(at 0% 0%, rgba(56, 123, 91, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(200, 90, 110, 0.05) 0px, transparent 50%);
    background-attachment: fixed;
    letter-spacing: -0.005em;
}

.font-serif-display {
    font-family: 'Be Vietnam Pro', 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    letter-spacing: -0.015em;
}

.font-mono-num {
    font-family: 'Be Vietnam Pro', 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.005em;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ================= HEADER & NAVIGATION ================= */
.atelier-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-soft);
}

@media (min-width: 768px) {
    .atelier-header {
        background: var(--bg-glass);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }
}

.nav-pill-container {
    background: var(--bg-subtle);
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    padding: 4px;
}

.nav-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

.nav-tab:hover {
    color: var(--text-main);
}

.nav-tab.tab-active {
    background: var(--bg-card);
    color: var(--brand);
    box-shadow: 0 2px 8px rgba(28, 37, 32, 0.08);
}

.dark .nav-tab.tab-active {
    background: #23322A;
    color: #74C69D;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* ================= CARDS & SURFACES ================= */
.card-floral {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-card);
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
}

.card-floral:hover {
    box-shadow: var(--shadow-elevated);
    border-color: var(--border-strong);
}

/* Bento Hero Banner */
.atelier-hero-card {
    background: linear-gradient(135deg, #1E4633 0%, #2A5C43 55%, #376E54 100%);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 16px 36px -8px rgba(26, 64, 46, 0.22);
    position: relative;
    overflow: hidden;
}

.dark .atelier-hero-card {
    background: linear-gradient(135deg, #152E22 0%, #1C3B2C 60%, #16261E 100%);
    border-color: rgba(116, 198, 157, 0.2);
    box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.5);
}

.atelier-hero-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 235, 210, 0.14) 0%, transparent 70%);
    pointer-events: none;
}

/* KPI Stat Cards */
.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: 20px;
    padding: 16px 18px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease;
}

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

/* ================= ORDER TICKET CARD ================= */
.order-ticket {
    position: relative;
    overflow: hidden;
}

.order-ticket::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--brand);
    border-radius: 4px 0 0 4px;
}

.order-ticket.ticket-urgent::before {
    background: #E11D48;
}

.order-ticket.ticket-warning::before {
    background: #D97706;
}

.order-ticket.ticket-completed::before {
    background: #10B981;
}

.order-ticket.ticket-cancelled::before {
    background: #94A3B8;
}

/* Photo Frame Polaroid Style */
.photo-slot {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 14px;
    overflow: hidden;
    background: var(--bg-subtle);
    border: 1px solid var(--border-soft);
    transition: all 0.2s ease;
}

.photo-slot:hover {
    transform: scale(1.02);
    border-color: var(--brand);
}

/* Greeting Card Quote Box */
.greeting-card-box {
    background: var(--rose-soft);
    border: 1px solid rgba(200, 90, 110, 0.22);
    border-radius: 14px;
    padding: 10px 14px;
    position: relative;
}

/* Receipt Breakdown Box */
.receipt-box {
    background: var(--bg-subtle);
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    padding: 14px 16px;
}

/* ================= BADGES & ANIMATIONS ================= */
.countdown-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px;
    border-radius: 9999px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: -0.01em;
    border-width: 1px;
    transition: all 0.2s ease;
}

.urgent-pulse {
    animation: urgentPulse 2s infinite;
}

@keyframes urgentPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.4);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(225, 29, 72, 0);
    }
}

@keyframes floatSlow {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-3px); }
}

.float-flower {
    animation: floatSlow 4s ease-in-out infinite;
}

/* ================= FORM CONTROLS & BUTTONS ================= */
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
    border-radius: 12px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--brand) !important;
    box-shadow: 0 0 0 3px rgba(35, 83, 61, 0.15);
}

.dark input:not([type="checkbox"]):not([type="radio"]):focus,
.dark select:focus,
.dark textarea:focus {
    box-shadow: 0 0 0 3px rgba(82, 183, 136, 0.2);
}

.btn-brand {
    background: var(--brand);
    color: #FFFFFF;
    border-radius: 14px;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 14px rgba(35, 83, 61, 0.22);
}

.btn-brand:hover {
    background: var(--brand-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(35, 83, 61, 0.28);
}

/* ================= MOBILE BOTTOM NAVIGATION ================= */
@media (max-width: 767px) {
    body {
        padding-bottom: calc(84px + env(safe-area-inset-bottom)) !important;
    }

    .mobile-bottom-nav {
        position: fixed;
        z-index: 50;
        left: 10px;
        right: 10px;
        bottom: calc(8px + env(safe-area-inset-bottom));
        background: var(--bg-glass);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid var(--border-soft);
        border-radius: 22px;
        padding: 5px;
        box-shadow: 0 12px 32px rgba(15, 25, 20, 0.16);
    }

    .mobile-bottom-nav .nav-pill-container {
        background: transparent;
        border: 0;
        padding: 0;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 2px;
    }

    .mobile-bottom-nav .nav-tab {
        flex-direction: column;
        justify-content: center;
        padding: 6px 1px;
        gap: 2px;
        font-size: 10px;
        border-radius: 14px;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-bottom-nav .nav-icon {
        font-size: 16px;
        line-height: 1;
    }

    /* Bottom sheet modals on mobile */
    #orderModal, #inventoryModal, #expenseModal, #restockQuickModal, #screenshotScannerModal {
        align-items: flex-end !important;
        padding: 0 !important;
    }

    #orderModal > div, #inventoryModal > div, #expenseModal > div, #restockQuickModal > div, #screenshotScannerModal > div {
        width: 100% !important;
        max-width: 100vw !important;
        max-height: 92dvh !important;
        border-radius: 24px 24px 0 0 !important;
        padding-bottom: calc(20px + env(safe-area-inset-bottom)) !important;
        overflow-x: hidden !important;
    }
}

/* ================= PRINT STYLES (80mm RECEIPT) ================= */
@media print {
    body * {
        visibility: hidden;
    }
    #printSection, #printSection * {
        visibility: visible;
    }
    #printSection {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        max-width: 80mm;
        padding: 8px;
        background: white !important;
        color: black !important;
        font-size: 13px;
        line-height: 1.4;
    }
    .no-print {
        display: none !important;
    }
}
