@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200');

/* Kinetic Enterprise Design Tokens & Reset */
:root {
    --color-primary: #004ac6;
    --color-surface: #f9f9ff;
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    font-family: var(--font-family);
    background-color: #f9f9ff;
    color: #111c2d;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

/* Material Symbols Outlined Icon Styling */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
}

/* Dark Mode Overrides */
html.dark body {
    background-color: #0b1320;
    color: #e2e8f0;
}
html.dark .bg-surface,
html.dark .bg-surface-container-lowest {
    background-color: #111c2d !important;
    color: #f8fafc !important;
}
html.dark .bg-surface-container,
html.dark .bg-surface-container-low,
html.dark .bg-surface-container-high {
    background-color: #1a273c !important;
    color: #f1f5f9 !important;
}
html.dark .border-outline-variant {
    border-color: #2e3d55 !important;
}
html.dark .text-on-surface {
    color: #f8fafc !important;
}
html.dark .text-secondary {
    color: #94a3b8 !important;
}

/* App Views Switcher */
.app-view {
    display: none;
    opacity: 0;
    transition: opacity 0.25s ease-in-out;
}
.app-view.active {
    display: block;
    opacity: 1;
}

/* Active Nav Links styling */
.nav-link.active, .mobile-nav-link.active {
    background-color: #dbe1ff !important;
    color: #004ac6 !important;
    font-weight: 700 !important;
}
html.dark .nav-link.active,
html.dark .mobile-nav-link.active {
    background-color: #1e3a8a !important;
    color: #60a5fa !important;
}

.nav-link.active .material-symbols-outlined,
.mobile-nav-link.active .material-symbols-outlined {
    color: #004ac6 !important;
}

/* Elevation Shadows */
.elevation-1 {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
}

.elevation-2 {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

/* Status Badges */
.badge-active, .badge-completed {
    background-color: rgba(34, 197, 94, 0.12);
    color: #15803d;
}
.badge-trial, .badge-processing {
    background-color: rgba(234, 179, 8, 0.15);
    color: #a16207;
}
.badge-expired, .badge-cancelled {
    background-color: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}
.badge-shipped {
    background-color: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
}

/* Toggle Switch Styles */
.toggle-checkbox:checked + .toggle-label {
    background-color: var(--color-primary);
}
.toggle-checkbox:checked + .toggle-label:after {
    left: calc(100% - 2px);
    transform: translateX(-100%);
}
.toggle-label:after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 9999px;
    transition: 0.25s ease;
}

/* Mobile Sidebar Drawer Smooth Animation */
#sidebar {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

@media (max-width: 767px) {
    #sidebar {
        transform: translateX(-100%);
    }
    #sidebar.sidebar-open {
        transform: translateX(0%) !important;
    }
}

/* Modal Animations & Mobile Bottom Sheet */
.modal-backdrop {
    background-color: rgba(17, 28, 45, 0.6);
    backdrop-filter: blur(4px);
    transition: opacity 0.25s ease-out;
    z-index: 9999 !important;
}

@media (max-width: 640px) {
    .modal-backdrop > div {
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        max-height: 90vh;
        animation: slideUp 0.3s ease-out forwards;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Custom Scrollbar for tables and drawers */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 9999px;
}
html.dark ::-webkit-scrollbar-thumb {
    background: #334155;
}

/* Paper Size Preview Rules */
.paper-preview-a4 {
    max-width: 100% !important;
    margin: 0 auto;
    transition: all 0.3s ease;
}

.paper-preview-a5 {
    max-width: 540px !important;
    margin: 0 auto;
    font-size: 0.85rem !important;
    transition: all 0.3s ease;
}

.paper-preview-a5 table {
    font-size: 0.75rem !important;
}

.paper-preview-a5 td,
.paper-preview-a5 th {
    padding-top: 4px !important;
    padding-bottom: 4px !important;
    padding-left: 6px !important;
    padding-right: 6px !important;
}

/* Print Styles for Invoices */
@media print {
    body * {
        visibility: hidden;
    }
    #invoice-print-area, #invoice-print-area * {
        visibility: visible;
    }
    #invoice-print-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0 !important;
        padding: 0 !important;
    }
    .no-print {
        display: none !important;
    }
}
