/* Qalinle Baby Care Management System - Custom CSS Variables & Themes */
:root {
    --bg-primary: #f8f9fa;
    --bg-sidebar: #1e1e2d;
    --bg-sidebar-hover: #2b2b40;
    --text-primary: #3f4254;
    --text-muted: #b5b5c3;
    --primary: #6f42c1;
    --primary-light: rgba(111, 66, 193, 0.1);
    --secondary: #00e096;
    --secondary-light: rgba(0, 224, 150, 0.1);
    --accent: #ffa800;
    --accent-light: rgba(255, 168, 0, 0.1);
    --danger: #f64e60;
    --danger-light: rgba(246, 78, 96, 0.1);
    --card-shadow: 0px 10px 30px rgba(82, 63, 105, 0.05);
    --border-color: #ebedf3;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.3);
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', 'Outfit', system-ui, -apple-system, sans-serif;
    overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Glassmorphism Styles */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
}

/* Sidebar Styling */
.sidebar-wrapper {
    width: 260px;
    background-color: var(--bg-sidebar);
    color: #fff;
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 5px 0px 15px rgba(0,0,0,0.1);
}

.sidebar-wrapper .sidebar-brand {
    padding: 24px;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-wrapper .sidebar-menu {
    padding: 20px 0;
    list-style-type: none;
    margin: 0;
}

.sidebar-wrapper .sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 24px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    border-left: 4px solid transparent;
}

.sidebar-wrapper .sidebar-menu li a:hover,
.sidebar-wrapper .sidebar-menu li.active a {
    color: #fff;
    background-color: var(--bg-sidebar-hover);
    border-left-color: var(--primary);
}

.sidebar-wrapper .sidebar-menu li a i {
    width: 20px;
    font-size: 1.1rem;
    text-align: center;
}

/* Main Content Wrapper */
.main-content {
    margin-left: 260px;
    padding: 30px;
    min-height: 100vh;
    transition: all 0.3s ease;
}

/* Top Navbar Style */
.top-navbar {
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    padding: 15px 25px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Dashboard Summary Cards */
.stat-card {
    border-radius: 16px;
    padding: 24px;
    border: none;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
    background: #fff;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0px 15px 35px rgba(82, 63, 105, 0.1);
}

.stat-card .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.stat-card.stat-primary .stat-icon {
    background-color: var(--primary-light);
    color: var(--primary);
}

.stat-card.stat-success .stat-icon {
    background-color: var(--secondary-light);
    color: var(--secondary);
}

.stat-card.stat-warning .stat-icon {
    background-color: var(--accent-light);
    color: var(--accent);
}

.stat-card.stat-danger .stat-icon {
    background-color: var(--danger-light);
    color: var(--danger);
}

/* Modern Forms & Inputs */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 10px 15px;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Custom Table Styles */
.custom-table-container {
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    padding: 24px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.custom-table {
    margin-bottom: 0;
}

.custom-table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-color);
    padding: 15px 10px;
}

.custom-table td {
    padding: 15px 10px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

/* POS Interface Layout */
.pos-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 25px;
    height: calc(100vh - 180px);
}

.pos-products-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.pos-cart-panel {
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.pos-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    overflow-y: auto;
    padding: 10px 5px;
    flex-grow: 1;
}

.pos-product-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 220px;
}

.pos-product-card:hover {
    border-color: var(--primary);
    box-shadow: 0px 5px 15px rgba(111, 66, 193, 0.1);
    transform: translateY(-3px);
}

.pos-product-card img {
    height: 90px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 8px;
}

.pos-cart-items {
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px;
}

.pos-cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.pos-cart-item:last-child {
    border-bottom: none;
}

/* Printing styles for thermal receipt */
@media print {
    body * {
        visibility: hidden;
    }
    #thermal-receipt, #thermal-receipt * {
        visibility: visible;
    }
    #thermal-receipt {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
    .no-print {
        display: none !important;
    }
}

#thermal-receipt {
    background: #fff;
    color: #000;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    line-height: 1.4;
    padding: 10px;
}

#thermal-receipt.receipt-58mm {
    width: 58mm;
}

#thermal-receipt.receipt-80mm {
    width: 80mm;
}

#thermal-receipt .receipt-header {
    text-align: center;
    margin-bottom: 15px;
}

#thermal-receipt .receipt-header img {
    max-width: 60px;
    margin-bottom: 5px;
}

#thermal-receipt .receipt-divider {
    border-top: 1px dashed #000;
    margin: 8px 0;
}

#thermal-receipt table {
    width: 100%;
    border-collapse: collapse;
}

#thermal-receipt th, #thermal-receipt td {
    font-size: 11px;
    padding: 3px 0;
}

#thermal-receipt th {
    text-align: left;
    border-bottom: 1px solid #000;
}

/* Responsive sidebar adjustments */
@media (max-width: 991.98px) {
    .sidebar-wrapper {
        left: -260px;
    }
    .sidebar-wrapper.show {
        left: 0;
    }
    .main-content {
        margin-left: 0;
    }
}
