/* =============================================
   POS CAFE - Premium Dark Theme
   ============================================= */
:root {
    /* Color Palette */
    --bg-primary: #0f1117;
    --bg-secondary: #1a1d27;
    --bg-tertiary: #242736;
    --bg-card: #1e2130;
    --bg-hover: #2a2d3e;

    --accent-primary: #6c5ce7;
    --accent-secondary: #a29bfe;
    --accent-success: #00b894;
    --accent-warning: #fdcb6e;
    --accent-danger: #e17055;
    --accent-info: #74b9ff;

    --text-primary: #e8e8ef;
    --text-secondary: #8b8da3;
    --text-muted: #5f6180;

    --border-color: #2d3045;
    --shadow-color: rgba(0, 0, 0, 0.3);

    /* Sidebar */
    --sidebar-width: 260px;
    --sidebar-collapsed: 0px;

    /* Transitions */
    --transition-speed: 0.3s;
}

[data-theme="light"] {
    --bg-primary: #f5f7fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #edf2f7;
    --bg-card: #ffffff;
    --bg-hover: #e2e8f0;

    --text-primary: #2d3436;
    --text-secondary: #636e72;
    --text-muted: #b2bec3;

    --border-color: #dfe6e9;
    --shadow-color: rgba(0, 0, 0, 0.1);
    /* Recalibrate accents for light mode visibility if needed, 
       but standard ones usually work well on light too. 
       Micro-adjusting shadow for card hover in light mode. */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
}

/* =============================================
   SCROLLBAR
   ============================================= */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* =============================================
   SIDEBAR
   ============================================= */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform var(--transition-speed) ease;
}

.sidebar-brand {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent-primary);
    border-bottom: 1px solid var(--border-color);
}

.sidebar-brand i {
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-speed) ease;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
    border-left-color: var(--accent-secondary);
}

.sidebar-nav .nav-link.active {
    color: var(--accent-primary);
    background: rgba(108, 92, 231, 0.1);
    border-left-color: var(--accent-primary);
}

.sidebar-nav .nav-link i {
    width: 20px;
    text-align: center;
    font-size: 0.95rem;
}

.nav-divider {
    padding: 1rem 1.5rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
}

/* Sidebar submenu */
.nav-link-parent {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-speed) ease;
    border-left: 3px solid transparent;
    cursor: pointer;
    width: 100%;
    background: none;
    border-right: none;
    border-top: none;
    border-bottom: none;
    text-align: left;
}
.nav-link-parent:hover,
.nav-link-parent[aria-expanded="true"] {
    color: var(--text-primary);
    background: var(--bg-hover);
    border-left-color: var(--accent-secondary);
}
.nav-link-parent .nav-caret {
    margin-left: auto;
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}
.nav-link-parent[aria-expanded="true"] .nav-caret {
    transform: rotate(180deg);
}
.nav-submenu .nav-link {
    padding-left: 2.75rem;
    font-size: 0.85rem;
    font-weight: 400;
    border-left: none;
    border-left: 3px solid transparent;
}
.nav-submenu .nav-link::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    display: inline-block;
    margin-right: 0.5rem;
    flex-shrink: 0;
}
.nav-submenu .nav-link.active::before {
    background: var(--accent-primary);
}
.nav-submenu .nav-link:hover::before {
    background: var(--accent-secondary);
}
.sidebar-nav .nav-submenu .nav-link {
    padding-left: 2.75rem;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.sidebar-version {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* =============================================
   MAIN CONTENT
   ============================================= */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left var(--transition-speed) ease;
}

.top-navbar {
    position: sticky;
    top: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: var(--bg-secondary);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
}

.top-navbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.top-navbar-right {
    display: flex;
    align-items: center;
}

.page-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
}

.sidebar-toggle {
    color: var(--text-secondary);
    font-size: 1.2rem;
    padding: 0.3rem;
    text-decoration: none;
}

.sidebar-toggle:hover {
    color: var(--text-primary);
}

.content-wrapper {
    padding: 1.5rem;
}

/* =============================================
   USER INFO
   ============================================= */
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.85rem;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.user-role {
    font-size: 0.75rem;
}

/* =============================================
   BRANCH SWITCHER
   ============================================= */
.branch-switcher .form-select {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-primary);
    font-size: 0.8rem;
    min-width: 160px;
}

.branch-switcher .input-group-text {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--accent-primary);
    font-size: 0.8rem;
}

/* =============================================
   CARDS
   ============================================= */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    transition: all var(--transition-speed) ease;
}

.card:hover {
    border-color: rgba(108, 92, 231, 0.3);
    box-shadow: 0 8px 32px rgba(108, 92, 231, 0.1);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.card-body {
    padding: 1.25rem;
}

/* Stat Cards */
.stat-card {
    border-radius: 16px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.stat-card .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.stat-card .stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.bg-gradient-purple {
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.15), rgba(162, 155, 254, 0.05));
    border: 1px solid rgba(108, 92, 231, 0.2);
}

.bg-gradient-green {
    background: linear-gradient(135deg, rgba(0, 184, 148, 0.15), rgba(85, 239, 196, 0.05));
    border: 1px solid rgba(0, 184, 148, 0.2);
}

.bg-gradient-orange {
    background: linear-gradient(135deg, rgba(225, 112, 85, 0.15), rgba(250, 177, 160, 0.05));
    border: 1px solid rgba(225, 112, 85, 0.2);
}

.bg-gradient-blue {
    background: linear-gradient(135deg, rgba(116, 185, 255, 0.15), rgba(162, 210, 255, 0.05));
    border: 1px solid rgba(116, 185, 255, 0.2);
}

.bg-gradient-yellow {
    background: linear-gradient(135deg, rgba(253, 203, 110, 0.15), rgba(254, 221, 156, 0.05));
    border: 1px solid rgba(253, 203, 110, 0.2);
}

.icon-purple {
    background: rgba(108, 92, 231, 0.2);
    color: var(--accent-primary);
}

.icon-green {
    background: rgba(0, 184, 148, 0.2);
    color: var(--accent-success);
}

.icon-orange {
    background: rgba(225, 112, 85, 0.2);
    color: var(--accent-danger);
}

.icon-blue {
    background: rgba(116, 185, 255, 0.2);
    color: var(--accent-info);
}

.icon-yellow {
    background: rgba(253, 203, 110, 0.2);
    color: var(--accent-warning);
}

/* =============================================
   TABLES
   ============================================= */
.table {
    color: var(--text-primary);
    --bs-table-bg: transparent;
    --bs-table-hover-bg: var(--bg-hover);
    border-color: var(--border-color);
    margin-bottom: 0;
}

.table thead th {
    background: var(--bg-tertiary);
    border-bottom: 2px solid var(--border-color);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    padding: 0.85rem 1rem;
    white-space: nowrap;
}

.table tbody td {
    border-color: var(--border-color);
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    vertical-align: middle;
}

.table-striped>tbody>tr:nth-of-type(odd)>* {
    --bs-table-bg-type: rgba(255, 255, 255, 0.02);
}

/* =============================================
   FORMS
   ============================================= */
.form-control,
.form-select {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    transition: all var(--transition-speed) ease;
}

.form-control:focus,
.form-select:focus {
    background-color: var(--bg-tertiary);
    border-color: var(--accent-primary);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-label {
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.input-group-text {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

/* =============================================
   BUTTONS
   ============================================= */
.btn {
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.55rem 1.2rem;
    transition: all var(--transition-speed) ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), #5a4bd1);
    border: none;
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a4bd1, var(--accent-primary));
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--accent-success), #00a885);
    border: none;
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 184, 148, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--accent-danger), #c0392b);
    border: none;
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(225, 112, 85, 0.4);
}

.btn-outline-primary {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.btn-outline-primary:hover {
    background: var(--accent-primary);
    color: white;
}

.btn-outline-light {
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.btn-outline-light:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.btn-outline-danger {
    color: var(--accent-danger);
    border-color: var(--accent-danger);
}

.btn-outline-danger:hover {
    background: var(--accent-danger);
    color: white;
}

/* =============================================
   BADGES
   ============================================= */
.badge {
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
    border-radius: 6px;
}

.badge-stock-low {
    background: rgba(225, 112, 85, 0.15);
    color: var(--accent-danger);
    border: 1px solid rgba(225, 112, 85, 0.3);
}

.badge-stock-ok {
    background: rgba(0, 184, 148, 0.15);
    color: var(--accent-success);
    border: 1px solid rgba(0, 184, 148, 0.3);
}

/* =============================================
   MODALS
   ============================================= */
.modal-content {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem;
}

.modal-header .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.modal-footer {
    border-top: 1px solid var(--border-color);
}

.modal-title {
    font-weight: 600;
    font-size: 1.05rem;
}

/* =============================================
   ALERTS
   ============================================= */
.alert {
    border-radius: 12px;
    border: none;
    font-size: 0.9rem;
}

.alert-success {
    background: rgba(0, 184, 148, 0.15);
    color: var(--accent-success);
    border: 1px solid rgba(0, 184, 148, 0.2);
}

.alert-danger {
    background: rgba(225, 112, 85, 0.15);
    color: var(--accent-danger);
    border: 1px solid rgba(225, 112, 85, 0.2);
}

.alert-warning {
    background: rgba(253, 203, 110, 0.15);
    color: var(--accent-warning);
    border: 1px solid rgba(253, 203, 110, 0.2);
}

.alert-info {
    background: rgba(116, 185, 255, 0.15);
    color: var(--accent-info);
    border: 1px solid rgba(116, 185, 255, 0.2);
}

/* =============================================
   LOGIN PAGE
   ============================================= */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(108, 92, 231, 0.15), transparent 70%);
    top: -150px;
    right: -100px;
}

.login-wrapper::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(0, 184, 148, 0.1), transparent 70%);
    bottom: -100px;
    left: -100px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2.5rem;
    position: relative;
    z-index: 1;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo i {
    font-size: 3rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-logo h2 {
    font-weight: 700;
    margin-top: 0.75rem;
    font-size: 1.5rem;
}

.login-logo p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* =============================================
   POS PAGE
   ============================================= */
.pos-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 1.5rem;
    height: calc(100vh - 130px);
}

.pos-menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    align-content: start;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.pos-menu-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    text-align: center;
}

.pos-menu-item:hover {
    border-color: var(--accent-primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(108, 92, 231, 0.2);
}

.pos-menu-item .menu-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    margin: 0 auto 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.pos-menu-item .menu-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.pos-menu-item .menu-price {
    color: var(--accent-success);
    font-weight: 600;
    font-size: 0.85rem;
}

.pos-menu-item.unavailable {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Cart Panel */
.pos-cart {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cart-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 500;
    font-size: 0.9rem;
}

.cart-item-price {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

@media (max-width: 991.98px) {
    .content-wrapper .btn.btn-outline-primary.btn-sm {
        width: 100%;
    }
}

.pos-cart-bar {
    position: fixed;
    left: 0;
    right: 0;
}

.pos-cart-bar .pos-cart-btn {
    width: 100%;
    min-height: 48px;
    border-radius: 12px;
    font-weight: 500;
}


.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.92rem;
    min-height: 32px;
}

.cart-item-qty .btn {
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    border-radius: 8px;
}

.cart-item-qty-btn {
    width: 26px;
    height: 26px;
    min-width: 26px;
    min-height: 26px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    border-radius: 7px;
}

.cart-item-qty span {
    font-weight: 600;
    min-width: 22px;
    text-align: center;
    font-size: 0.95em;
}

.cart-item-subtotal {
    font-weight: 600;
    font-size: 0.85rem;
    min-width: 60px;
    text-align: right;
    margin-left: 0.5rem;
    color: #555;
}

.cart-footer {
    border-top: 1px solid var(--border-color);
    padding: 1.25rem;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.cart-total-label {
    font-size: 1rem;
    font-weight: 600;
}

.cart-total-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent-success);
}

.cart-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.cart-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Category Tabs */
.category-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0 0 1rem 0;
    overflow-x: auto;
    flex-wrap: nowrap;
}

.category-tab {
    padding: 0.5rem 1.2rem;
    border-radius: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-speed) ease;
}

.category-tab:hover,
.category-tab.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

/* =============================================
   RECEIPT
   ============================================= */
.receipt {
    background: white;
    color: #333;
    max-width: 350px;
    margin: 0 auto;
    padding: 1.5rem;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
}

.receipt-header {
    text-align: center;
    border-bottom: 2px dashed #ccc;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.receipt-items {
    border-bottom: 2px dashed #ccc;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
}

.receipt-total {
    font-weight: bold;
    font-size: 1rem;
    text-align: right;
}

.receipt-footer {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.75rem;
    color: #999;
}

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.5s ease forwards;
}

.animate-fadeIn {
    animation: fadeIn 0.4s ease forwards;
}

.stat-card {
    animation: fadeInUp 0.5s ease forwards;
}

.stat-card:nth-child(1) {
    animation-delay: 0.05s;
}

.stat-card:nth-child(2) {
    animation-delay: 0.1s;
}

.stat-card:nth-child(3) {
    animation-delay: 0.15s;
}

.stat-card:nth-child(4) {
    animation-delay: 0.2s;
}

.stat-card:nth-child(5) {
    animation-delay: 0.25s;
}

/* =============================================
   RESPONSIVE
   ============================================= */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.menu-info-stack {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.menu-info-row {
    display: block;
}

.menu-action-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: flex-start;
}

.menu-action-group .btn {
    border-radius: 0.35rem !important;
    flex: 0 0 auto;
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar-overlay.show {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .pos-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

    .pos-cart {
        max-height: 50vh;
    }

    .user-details {
        display: none;
    }
}

@media (max-width: 575.98px) {
    .content-wrapper {
        padding: 1rem;
    }

    .menu-page-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: flex-start;
    }

    .menu-page-actions .btn {
        margin-left: 0 !important;
    }

    .pos-menu-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-card .stat-value {
        font-size: 1.2rem;
    }

    .menu-table thead {
        display: none;
    }

    .menu-table,
    .menu-table tbody,
    .menu-table tr,
    .menu-table td {
        display: block;
        width: 100%;
    }

    .menu-table tr {
        border-bottom: 1px solid var(--border-color);
        padding: 0.75rem 1rem;
    }

    .menu-table td {
        border: 0;
        padding: 0.3rem 0;
        text-align: left !important;
    }

    .menu-table td::before {
        content: attr(data-label);
        display: block;
        font-size: 0.72rem;
        color: var(--text-muted);
        margin-bottom: 0.2rem;
    }

    .menu-table td[data-label="Info & Aksi"] {
        margin-top: 0.35rem;
        padding-top: 0.45rem;
        border-top: 1px dashed var(--border-color);
    }

    /* Keep nested price table horizontal on mobile */
    .menu-table td table.table {
        display: table;
        width: 100%;
        font-size: 0.72em;
    }
    .menu-table td table.table thead { display: table-header-group; }
    .menu-table td table.table tbody { display: table-row-group; }
    .menu-table td table.table tr { display: table-row; border: 0; padding: 0; }
    .menu-table td table.table td,
    .menu-table td table.table th { display: table-cell; width: auto; text-align: center !important; padding: 0.15rem 0.25rem; white-space: nowrap; }
    .menu-table td table.table td::before,
    .menu-table td table.table th::before { content: none; }

    .menu-info-row .menu-action-group {
        margin-top: 0.25rem;
    }

}

@media (min-width: 1200px) {
    .pos-menu-grid {
        grid-template-columns: repeat(5, minmax(160px, 1fr));
        grid-template-rows: repeat(5, minmax(140px, 1fr));
        grid-auto-rows: minmax(140px, 1fr);
    }
}

/* =============================================
   REPORT FILTER INLINE
   ============================================= */
.report-filter { flex-wrap: nowrap !important; gap: 0.25rem !important; }
.report-filter .col-auto { flex: 0 1 auto; }
.report-filter input[type="date"] { font-size: 0.75rem; padding: 0.2rem 0.3rem; }
.report-filter .btn { padding: 0.25rem 0.5rem; white-space: nowrap; }
.report-filter .form-select { font-size: 0.75rem; padding: 0.2rem 0.3rem; }
@media (max-width: 767.98px) {
    .report-filter input[type="date"] { font-size: 0.65rem; padding: 0.15rem 0.15rem; min-width: 0; max-width: 115px; }
    .report-filter .btn { font-size: 0.65rem; padding: 0.2rem 0.4rem; }
    .report-filter .form-select { font-size: 0.65rem; padding: 0.15rem 0.15rem; min-width: 70px !important; }
    .report-filter .form-label { font-size: 0.6rem !important; }
}

/* =============================================
   MISC
   ============================================= */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-state h5 {
    color: var(--text-secondary);
    font-weight: 600;
}

.text-gradient {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.section-header h5 {
    font-weight: 600;
    margin: 0;
}

/* Print styles */
@media print {

    .sidebar,
    .top-navbar,
    .no-print {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
    }

    .receipt {
        box-shadow: none;
        border: none;
    }
}

.menu-stacked-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.menu-stacked-row {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 0.75rem;
    align-items: center;
    padding: 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-card);
    cursor: pointer;
}

.menu-stacked-row.is-unavailable {
    opacity: 0.65;
}

.menu-stacked-thumb {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-stacked-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.7rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* =============================================
   OFFLINE / NETWORK STATUS UI
   ============================================= */

/* Offline Banner */
.offline-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e17055, #d63031);
    color: #fff;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 500;
    animation: offlinePulse 2s ease-in-out infinite;
    z-index: 1050;
}

.offline-banner-content {
    display: flex;
    align-items: center;
    gap: 6px;
}

@keyframes offlinePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

/* Network Indicator */
.network-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: default;
    position: relative;
    margin-right: 8px;
}

.network-indicator.online {
    background: rgba(0, 184, 148, 0.15);
    color: var(--accent-success);
    border: 1px solid rgba(0, 184, 148, 0.3);
}

.network-indicator.offline {
    background: rgba(225, 112, 85, 0.15);
    color: var(--accent-danger);
    border: 1px solid rgba(225, 112, 85, 0.3);
    animation: offlineGlow 1.5s ease-in-out infinite;
}

@keyframes offlineGlow {
    0%, 100% { box-shadow: 0 0 4px rgba(225, 112, 85, 0.2); }
    50% { box-shadow: 0 0 12px rgba(225, 112, 85, 0.5); }
}

/* Pending count badge */
.offline-pending-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: var(--accent-warning);
    color: #1a1d27;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0 5px;
    margin-left: 2px;
}

/* Offline sync note in success modal */
.offline-sync-note {
    border-radius: 10px;
    font-size: 0.85rem;
}

/* Light theme adjustments */
[data-theme="light"] .offline-banner {
    background: linear-gradient(135deg, #e17055, #d63031);
    color: #fff;
}

[data-theme="light"] .network-indicator.online {
    background: rgba(0, 184, 148, 0.1);
    color: #00a281;
    border-color: rgba(0, 184, 148, 0.3);
}

[data-theme="light"] .network-indicator.offline {
    background: rgba(225, 112, 85, 0.1);
    color: #c0392b;
    border-color: rgba(225, 112, 85, 0.3);
}

[data-theme="light"] .offline-pending-badge {
    background: #f39c12;
    color: #fff;
}

/* =============================================
   MODIFIER GROUP TABS - Horizontal Scrollable
   ============================================= */
.modifier-group-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) transparent;
    padding-bottom: 6px;
    margin-bottom: 4px;
    white-space: nowrap;
}
.modifier-group-tabs::-webkit-scrollbar {
    height: 4px;
}
.modifier-group-tabs::-webkit-scrollbar-track {
    background: transparent;
}
.modifier-group-tabs::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
.modifier-group-tab {
    flex-shrink: 0;
    padding: 7px 16px;
    border: 1.5px solid var(--border-color);
    border-radius: 20px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.modifier-group-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}
.modifier-group-tab.active {
    background: var(--accent-primary);
    color: #fff;
    border-color: var(--accent-primary);
}
.modifier-tab-badge {
    font-size: 0.7rem;
    padding: 1px 7px;
    border-radius: 10px;
    background: rgba(255,255,255,0.15);
    color: inherit;
    font-weight: 600;
}
.modifier-group-tab.active .modifier-tab-badge {
    background: rgba(255,255,255,0.25);
}

/* Modifier option rows */
.modifier-group-pane {
    padding: 4px 0;
}
.modifier-option-row {
    padding: 8px 12px;
    margin-bottom: 4px;
    border-radius: 8px;
    transition: background 0.15s;
}
.modifier-option-row:hover {
    background: var(--bg-hover);
}
.modifier-opt-name {
    font-weight: 500;
}
.modifier-opt-price {
    color: var(--accent-warning);
    font-size: 0.85rem;
    margin-left: 4px;
}

/* Light theme */
[data-theme="light"] .modifier-group-tab {
    background: #f0f0f0;
    color: #555;
    border-color: #ddd;
}
[data-theme="light"] .modifier-group-tab:hover {
    background: #e0e0ff;
    border-color: #6c5ce7;
}
[data-theme="light"] .modifier-group-tab.active {
    background: #6c5ce7;
    color: #fff;
}
[data-theme="light"] .modifier-option-row:hover {
    background: #f5f5ff;
}
[data-theme="light"] .modifier-opt-price {
    color: #e67e22;
}

/* Clickable stat card */
.stat-card-clickable {
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}
.stat-card-clickable:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}
.stat-card-clickable:active {
    transform: translateY(0);
}

/* Low stock menus column */
.low-stock-menus {
    max-width: 320px;
    line-height: 1.8;
}

/* Transaction history toggle detail */
.trx-toggle-icon {
    transition: transform 0.2s ease;
    font-size: 1rem;
    color: var(--text-secondary);
}
.toggle-detail:hover .trx-toggle-icon {
    color: var(--accent-primary);
}
.trx-detail-row > td {
    border-top: none !important;
    background: var(--bg-tertiary);
}
.trx-detail-content table {
    background: transparent !important;
}
.trx-detail-content table th,
.trx-detail-content table td {
    color: var(--text-primary);
    border-color: rgba(255,255,255,0.05);
}

/* Light theme overrides */
[data-theme="light"] .trx-toggle-icon {
    color: #6c757d;
}
[data-theme="light"] .toggle-detail:hover .trx-toggle-icon {
    color: #0d6efd;
}
[data-theme="light"] .trx-detail-row > td {
    background: #f8f9fa;
}
[data-theme="light"] .trx-detail-content table th,
[data-theme="light"] .trx-detail-content table td {
    color: #212529;
    border-color: rgba(0,0,0,0.08);
}