/* ===== Kavinora POS — Web App Styles ===== */

/* Font */
*, *::before, *::after { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }

/* ===== Layout ===== */
html, body, #app {
    margin: 0; padding: 0;
    background: #f8fafc;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.kav-app-layout {
    min-height: 100vh;
}

.kav-main-content {
    min-height: 100vh;
    background: #f8fafc;
}

.kav-main-container {
    padding: 20px 24px;
}

/* ===== Sidebar Nav ===== */
.mud-nav-link {
    border-radius: 8px !important;
    margin: 2px 8px !important;
    color: #94a3b8 !important;
    transition: all 0.15s ease !important;
    font-size: 0.875rem !important;
}
.mud-nav-link:hover {
    background: rgba(255,255,255,0.08) !important;
    color: #e2e8f0 !important;
}
.mud-nav-link.active {
    background: rgba(59,130,246,0.15) !important;
    color: #3b82f6 !important;
    font-weight: 600 !important;
}
.mud-nav-link .mud-nav-link-icon {
    color: inherit !important;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ===== Table ===== */
.mud-table-head .mud-table-cell {
    font-weight: 600 !important;
    font-size: 0.75rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    color: #64748b !important;
    background: #f8fafc !important;
    border-bottom: 2px solid #e2e8f0 !important;
}
.mud-table-row:hover {
    background: #f1f5f9 !important;
}

/* ===== Card Hover ===== */
.mud-paper {
    transition: box-shadow 0.2s ease !important;
}

/* ===== Chips ===== */
.mud-chip {
    font-weight: 600 !important;
    font-size: 0.75rem !important;
    border-radius: 6px !important;
}

/* ===== Tabs ===== */
.mud-tabs {
    background: white;
    border-radius: 12px;
    overflow: hidden;
}
.mud-tab {
    text-transform: none !important;
    font-weight: 600 !important;
    font-size: 0.875rem !important;
}

/* ===== Buttons ===== */
.mud-button-root {
    border-radius: 8px !important;
    text-transform: none !important;
    font-weight: 600 !important;
}

/* ===== Snackbar ===== */
.mud-snackbar {
    border-radius: 10px !important;
    font-size: 0.875rem !important;
}

/* ===== Skeleton Shimmer ===== */
.skeleton-shimmer {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 6px;
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== Responsive ===== */

/* Table horizontal scroll */
.mud-table-container {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

@media (max-width: 960px) {
    .kav-main-container {
        padding: 16px;
    }
}

@media (max-width: 600px) {
    .kav-main-container {
        padding: 12px;
    }

    .mud-appbar .mud-typography-h6 {
        font-size: 0.95rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: calc(100vw - 120px);
    }

    /* Dialogs full-screen on mobile */
    .mud-dialog {
        margin: 8px !important;
        width: calc(100vw - 16px) !important;
        max-width: calc(100vw - 16px) !important;
        max-height: calc(100dvh - 32px) !important;
        border-radius: 12px !important;
    }
    .mud-dialog-content {
        padding: 12px 14px !important;
        overflow-y: auto !important;
    }
    .mud-dialog-actions {
        padding: 8px 14px 12px !important;
        gap: 8px !important;
        flex-wrap: wrap !important;
    }
    .mud-dialog-actions .mud-button-root {
        flex: 1 1 auto;
        min-width: 80px;
    }

    /* Buttons: wrap, no overflow */
    .mud-button-root {
        white-space: nowrap !important;
        font-size: 0.82rem !important;
        padding: 5px 10px !important;
        min-height: 34px !important;
    }
    div[style*="display:flex"][style*="gap:8px"],
    div[style*="display: flex"][style*="gap: 8px"] {
        flex-wrap: wrap !important;
    }

    /* Tables: condensed */
    .mud-table-cell {
        padding: 6px 8px !important;
        font-size: 0.8rem !important;
    }
    .mud-table-head .mud-table-cell {
        font-size: 0.7rem !important;
    }

    /* Typography */
    .mud-typography-h5 {
        font-size: 1.1rem !important;
    }
    .mud-typography-h4 {
        font-size: 1.25rem !important;
    }

    /* MudSwitch label */
    .mud-switch .mud-button-label {
        white-space: normal !important;
        font-size: 0.85rem !important;
    }

    /* MudSelect full width */
    .mud-select {
        width: 100% !important;
    }

    /* Paper padding */
    .mud-paper.pa-5 {
        padding: 14px !important;
    }
    .mud-paper.pa-6 {
        padding: 16px !important;
    }

    /* Login container padding */
    .login-container {
        padding: 12px;
    }

    /* POS layout */
    .pos-cart-item {
        padding: 6px 8px !important;
    }
}

/* ===== Login Page ===== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 20px;
}

/* ===== POS Layout ===== */
.pos-cart-item {
    transition: background 0.1s ease;
}
.pos-cart-item:hover {
    background: #f8fafc;
}
