/* Fraunces import intentionally lives only here — kitchen.php previously
   duplicated this exact @import, firing a second identical font request
   on every kitchen-page load. Removed from kitchen.php; style.css loads
   first on every page (including kitchen), so this single import covers
   both files. */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&display=swap');

/* CSS Variables — premium cozy: cream, white, brown, near-black,
   plus a small warm status palette used consistently everywhere
   (tables, badges, alerts, buttons, notifications) instead of
   default Bootstrap red/green/yellow/teal. */
:root {
    --cream: #FBF5EA;
    --cream-alt: #F1E6D3;
    --cream-line: #EDE1CC;
    --white: #FFFDF9;
    --brown: #4A2F1C;
    --brown-mid: #8A5A34;
    --brown-soft: #C7A272;
    --black: #2A1D14;
    --muted: #9C8A76;

    --amber: #C98B3B;
    --amber-bg: #FBEDD4;
    --terracotta: #B85C4A;
    --terracotta-bg: #F7E4DE;
    --sage: #6E8B63;
    --sage-bg: #E7EFE2;
    --plum: #6E5A8B;
    --plum-bg: #EEE9F5;

    --shadow: 0 4px 20px rgba(74, 47, 28, 0.08);
    --shadow-lift: 0 8px 30px rgba(74, 47, 28, 0.14);
    --radius: 16px;
    --transition: all 0.3s ease;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--cream);
    color: var(--black);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

h1, h2, h3, .page-title, .login-header h1, .modal-header h2,
.stat-number, .brand-text, .table-number, .order-number {
    font-family: 'Fraunces', Georgia, serif;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--cream) 0%, var(--cream-alt) 100%);
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-box {
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lift);
    border: 1px solid var(--cream-line);
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 15px;
}

.login-header h1 {
    font-size: 26px;
    font-weight: 600;
    color: var(--brown);
    margin-bottom: 5px;
}

.login-header p {
    color: var(--muted);
    font-size: 14px;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: var(--muted);
}

/* Navigation */
.navbar {
    background: var(--white);
    padding: 12px 24px;
    box-shadow: 0 2px 10px rgba(74, 47, 28, 0.06);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--cream-line);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.nav-logo {
    height: 40px;
    width: auto;
}

.brand-text {
    font-size: 19px;
    font-weight: 600;
    color: var(--brown);
}

.nav-links {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    flex: 1;
}

.nav-link {
    padding: 8px 16px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--black);
    font-weight: 500;
    font-size: 14px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.nav-link:hover {
    background: var(--cream);
    transform: translateY(-2px);
}

.nav-link.active {
    background: var(--brown);
    color: var(--white);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.user-role {
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--brown);
}

.logout-btn {
    color: var(--muted);
    transition: var(--transition);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 8px;
}

.logout-btn:hover {
    color: var(--brown);
    background: var(--cream);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--black);
    padding: 4px 8px;
    border-radius: 8px;
    transition: var(--transition);
}

.mobile-menu-btn:hover {
    background: var(--cream);
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Page Title */
.page-title {
    font-size: 28px;
    font-weight: 600;
    color: var(--brown);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-title i {
    color: var(--amber);
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--cream-line);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--brown);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lift);
}

.stat-card .stat-icon {
    font-size: 32px;
    margin-bottom: 10px;
    color: var(--amber);
}

.stat-card .stat-number {
    font-size: 32px;
    font-weight: 600;
    color: var(--brown);
}

.stat-card .stat-label {
    color: var(--muted);
    font-size: 14px;
    margin-top: 4px;
}

/* Tables Grid */
.tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.table-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: var(--transition);
    border: 3px solid transparent;
}

.table-card:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lift);
}

.table-card.free {
    border-color: var(--sage);
    background: var(--sage-bg);
}

.table-card.waiting {
    border-color: var(--amber);
    background: var(--amber-bg);
    animation: pulseWaiting 2s ease-in-out infinite;
}

@keyframes pulseWaiting {
    0%, 100% { box-shadow: 0 0 0 0 rgba(201, 139, 59, 0.35); }
    50% { box-shadow: 0 0 0 10px rgba(201, 139, 59, 0); }
}

.table-card.preparing {
    border-color: var(--brown-mid);
    background: var(--cream-alt);
}

.table-card.ready {
    border-color: var(--plum);
    background: var(--plum-bg);
    animation: pulseReady 1.5s ease-in-out infinite;
}

@keyframes pulseReady {
    0%, 100% { box-shadow: 0 0 0 0 rgba(110, 90, 139, 0.35); }
    50% { box-shadow: 0 0 0 10px rgba(110, 90, 139, 0); }
}

.table-card.needs-attention {
    border-color: var(--terracotta);
    background: var(--terracotta-bg);
    animation: pulseAttention 1s ease-in-out infinite;
}

@keyframes pulseAttention {
    0%, 100% { box-shadow: 0 0 0 0 rgba(184, 92, 74, 0.35); }
    50% { box-shadow: 0 0 0 10px rgba(184, 92, 74, 0); }
}

.table-card .table-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--brown);
}

.table-card .table-status {
    font-size: 14px;
    font-weight: 600;
    margin-top: 5px;
    color: var(--brown-mid);
}

/* Takeaway card — always-visible, distinct amber style */
.table-card.takeaway-card {
    border-color: var(--amber);
    background: linear-gradient(135deg, var(--amber-bg) 0%, #fff8ee 100%);
    position: relative;
    max-width: 220px;
}

.table-card.takeaway-card .table-number {
    font-size: 32px;
}

.takeaway-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--amber);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 8px;
    text-transform: uppercase;
}


/* Order Cards (Kitchen) — base tokens; kitchen.php layers a
   .kitchen-view-scoped refinement on top of these, so the two
   files now share one palette instead of fighting over it. */
.orders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.order-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border-left: 5px solid var(--brown);
    transition: var(--transition);
}

.order-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lift);
}

.order-card.urgent {
    border-left-color: var(--terracotta);
    background: var(--terracotta-bg);
    animation: urgentPulse 1.5s ease-in-out infinite;
}

@keyframes urgentPulse {
    0%, 100% { border-left-color: var(--terracotta); }
    50% { border-left-color: #D48C7C; }
}

.order-card .order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 5px;
}

.order-card .order-number {
    font-size: 20px;
    font-weight: 600;
    color: var(--brown);
}

.order-card .order-time {
    font-size: 14px;
    color: var(--muted);
}

.order-card .order-table {
    font-size: 16px;
    font-weight: 600;
    color: var(--brown);
    margin-bottom: 8px;
}

.order-card .order-items {
    margin: 10px 0;
}

.order-card .order-item {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid var(--cream-line);
}

.order-card .order-notes {
    background: var(--amber-bg);
    color: #7A5420;
    padding: 8px 12px;
    border-radius: 8px;
    margin: 10px 0;
    font-size: 14px;
    border-left: 3px solid var(--amber);
}

.order-card .order-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.order-card .order-actions .btn {
    flex: 1;
    min-width: 80px;
    padding: 10px;
    font-size: 13px;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.product-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
    position: relative;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lift);
}

.product-card .product-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 10px;
}

.product-card .product-image-placeholder {
    width: 100%;
    height: 150px;
    background: var(--cream);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 48px;
    color: var(--brown-soft);
    margin-bottom: 10px;
}

.product-card .product-name {
    font-weight: 600;
    font-size: 16px;
    margin: 5px 0;
}

.product-card .product-price {
    color: var(--brown);
    font-weight: 700;
    font-size: 18px;
}

.product-card .product-category {
    color: var(--muted);
    font-size: 13px;
}

.product-card .product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    z-index: 1;
}

.product-card .product-badge.available {
    background: var(--sage);
    color: white;
}

.product-card .product-badge.unavailable {
    background: var(--terracotta);
    color: white;
}

.product-card .product-actions {
    display: flex;
    gap: 5px;
    margin-top: 10px;
    justify-content: center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    min-height: 48px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 47, 28, 0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--brown);
    color: var(--white);
}

.btn-primary:hover {
    background: #3A250F;
}

/* Success / Danger / Warning — given the same vivid-gradient
   treatment as kitchen.php's .kitchen-view-scoped buttons, so any
   page or modal using the plain .btn-success/.btn-danger/.btn-warning
   classes (i.e. anywhere kitchen.php's extra scoping doesn't reach)
   matches the app's fintech-tool aesthetic instead of looking flat
   by comparison. Base --sage/--terracotta/--amber tokens are
   untouched — only referenced as one end of each gradient — so
   badges, borders, and anything else keyed off those variables are
   unaffected. */
.btn-success {
    background: linear-gradient(135deg, #6BCB8A, var(--sage));
    color: white;
    box-shadow: 0 4px 12px rgba(110, 139, 99, 0.35);
}

.btn-success:hover {
    background: linear-gradient(135deg, #7FDB9C, #5D7A54);
    box-shadow: 0 8px 20px rgba(110, 139, 99, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #E0A75A, var(--amber));
    color: white;
    box-shadow: 0 4px 12px rgba(201, 139, 59, 0.35);
}

.btn-warning:hover {
    background: linear-gradient(135deg, #EBBB78, #B37A2E);
    box-shadow: 0 8px 20px rgba(201, 139, 59, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #D97E6C, var(--terracotta));
    color: white;
    box-shadow: 0 4px 12px rgba(184, 92, 74, 0.35);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #E39383, #A34E3D);
    box-shadow: 0 8px 20px rgba(184, 92, 74, 0.4);
}

.btn-info {
    background: var(--plum);
    color: white;
}

.btn-info:hover {
    background: #5D4A78;
}

.btn-secondary {
    background: var(--cream);
    color: var(--brown);
    border: 1px solid var(--cream-line);
}

.btn-secondary:hover {
    background: var(--cream-alt);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    min-height: 32px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 14px;
    color: var(--black);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--cream-line);
    border-radius: 12px;
    font-size: 16px;
    transition: var(--transition);
    background: var(--cream);
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--brown);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(74, 47, 28, 0.1);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234A2F1C' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.alert-success {
    background: var(--sage-bg);
    color: #3F5238;
    border-color: var(--sage);
}

.alert-error {
    background: var(--terracotta-bg);
    color: #7A3A2E;
    border-color: var(--terracotta);
}

.alert-warning {
    background: var(--amber-bg);
    color: #7A5420;
    border-color: var(--amber);
}

.alert-info {
    background: var(--plum-bg);
    color: #453A5A;
    border-color: var(--plum);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(42, 29, 20, 0.55);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius);
    max-width: 600px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(42, 29, 20, 0.35);
    animation: slideUp 0.3s ease;
}

/* Opt-in width modifier: add class="modal modal-lg" to a .modal wrapper
   for modals whose content needs more horizontal room — e.g. a
   side-by-side form layout. Below 769px it has no effect, since
   .modal-content is already width:95% and a fixed max-width isn't
   the constraint on small screens. */
@media (min-width: 769px) {
    .modal-lg .modal-content {
        max-width: 900px;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--cream);
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--brown);
}

.modal-close {
    font-size: 28px;
    cursor: pointer;
    background: none;
    border: none;
    color: var(--muted);
    transition: var(--transition);
    padding: 0 8px;
}

.modal-close:hover {
    color: var(--brown);
    transform: rotate(90deg);
}

/* ===== STRUCTURED MODALS (header / scrolling body / sticky footer) =====
   Opt-in system: any modal that wraps its content in .modal-body (and
   optionally .modal-footer) gets a richer, app-branded treatment —
   a solid header bar, an internally-scrolling body so the footer is
   always reachable, and a footer pinned to the bottom for actions like
   Save/Cancel. Modals that just drop content straight into
   .modal-content (no .modal-body) are untouched and keep the simple
   whole-panel-scrolls behavior above, so nothing already using the
   plain structure needs to change.
   This is what kitchen.php's Tables and Edit Order modals use instead
   of defining their own popup chrome — one modal system for the whole
   app instead of a page-specific one. */
.modal-content:has(.modal-body) {
    display: flex;
    flex-direction: column;
    max-height: 85vh;
    padding: 0;
    overflow: hidden;
}

.modal-content:has(.modal-body) .modal-header {
    background: var(--brown);
    color: var(--white);
    margin-bottom: 0;
    padding: 18px 28px;
    border-bottom: none;
    border-radius: var(--radius) var(--radius) 0 0;
    flex-shrink: 0;
}

.modal-content:has(.modal-body) .modal-header h2 {
    color: var(--white);
}

.modal-content:has(.modal-body) .modal-close {
    color: rgba(255, 255, 255, 0.75);
}

.modal-content:has(.modal-body) .modal-close:hover {
    color: var(--white);
}

.modal-body {
    padding: 24px 28px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    background: var(--white);
    padding: 16px 28px;
    border-top: 1px solid var(--cream-line);
    box-shadow: 0 -6px 16px rgba(74, 47, 28, 0.08);
    border-radius: 0 0 var(--radius) var(--radius);
}

@media (max-width: 768px) {
    .modal-content:has(.modal-body) {
        max-height: 92vh;
    }
    .modal-content:has(.modal-body) .modal-header {
        padding: 14px 20px;
    }
    .modal-body {
        padding: 18px 20px;
    }
    .modal-footer {
        padding: 12px 20px;
    }
}

/* Notifications */
.notification-popup {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--white);
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-lift);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 9999;
    max-width: 400px;
    animation: slideInRight 0.3s ease;
    border-left: 4px solid var(--brown);
}

.notification-popup.notification-success {
    border-left-color: var(--sage);
}

.notification-popup.notification-error {
    border-left-color: var(--terracotta);
}

.notification-popup.notification-warning {
    border-left-color: var(--amber);
}

.notification-popup.notification-order {
    border-left-color: var(--plum);
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification-content i {
    font-size: 24px;
}

.notification-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    font-size: 18px;
    padding: 0 4px;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* Badges */
.badge {
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-info {
    background: var(--plum);
    color: white;
}

.badge-success {
    background: var(--sage);
    color: white;
}

.badge-warning {
    background: var(--amber);
    color: white;
}

.badge-danger {
    background: var(--terracotta);
    color: white;
}

/* Utilities */
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.ml-10 { margin-left: 10px; }
.mr-10 { margin-right: 10px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-10 { gap: 10px; }
.gap-20 { gap: 20px; }
.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.text-brown { color: var(--brown); }
.fw-bold { font-weight: 700; }
.w-100 { width: 100%; }

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--cream-line);
}

.empty-state i {
    font-size: 64px;
    color: var(--brown-soft);
    margin-bottom: 15px;
}

.empty-state h2 {
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--brown);
}

.empty-state p {
    color: var(--muted);
}

/* Categories List */
.categories-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.category-item {
    background: var(--white);
    padding: 16px 20px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.category-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-lift);
}

.category-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.category-name {
    font-weight: 600;
    font-size: 16px;
}

.category-order {
    color: var(--muted);
    font-size: 14px;
}

.category-actions {
    display: flex;
    gap: 8px;
}

/* Filters */
.filters-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.filters-bar .form-control {
    flex: 1;
    min-width: 200px;
}

/* History */
.history-item {
    background: var(--white);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.history-item:hover {
    box-shadow: var(--shadow-lift);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.history-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.history-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.order-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.order-server {
    color: var(--muted);
    font-size: 14px;
}

.history-item-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid var(--cream-line);
}

.history-total {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 2px solid var(--cream);
    text-align: right;
    font-size: 16px;
}

/* Settings */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.settings-card {
    background: var(--white);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.settings-card h2 {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--brown);
}

.settings-card p {
    margin-bottom: 15px;
    color: #666;
}

.activity-log {
    max-height: 500px;
    overflow-y: auto;
}

.log-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--cream-line);
}

.log-item:last-child {
    border-bottom: none;
}

.log-header {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    font-size: 14px;
}

.log-user {
    font-weight: 600;
}

.log-role {
    color: var(--muted);
    font-size: 12px;
}

.log-time {
    color: var(--muted);
    font-size: 12px;
    margin-left: auto;
}

.log-action {
    margin-top: 3px;
    font-size: 14px;
}

.log-details {
    color: #666;
}

.system-info {
    margin-top: 10px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--cream-line);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--muted);
}

.info-value {
    font-weight: 500;
}

/* Responsive */
@media (max-width: 1024px) {
    .nav-link span {
        display: none;
    }
    
    .nav-link i {
        font-size: 18px;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block !important;
    }
    
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        padding: 10px 0;
        background: var(--white);
        position: absolute;
        top: 100%;
        left: 0;
        box-shadow: 0 4px 20px rgba(74, 47, 28, 0.1);
        border-radius: 0 0 12px 12px;
        gap: 2px;
    }
    
    .nav-links.show {
        display: flex;
    }
    
    .nav-container {
        position: relative;
        flex-wrap: wrap;
    }
    
    .nav-user {
        margin-left: auto;
    }
    
    .nav-link {
        padding: 12px 20px;
        border-radius: 0;
        width: 100%;
    }
    
    .nav-link span {
        display: inline !important;
    }
    
    .brand-text {
        font-size: 16px;
    }
    
    .main-content {
        padding: 16px;
    }
    
    .page-title {
        font-size: 22px;
    }
    
    .orders-grid {
        grid-template-columns: 1fr;
    }
    
    .tables-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
    
    .login-box {
        padding: 24px;
    }
    
    .modal-content {
        padding: 20px;
        margin: 10px;
    }
    
    .history-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filters-bar {
        flex-direction: column;
    }
    
    .filters-bar .form-control {
        min-width: unset;
    }
}

@media (max-width: 480px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .tables-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    
    .order-card .order-actions .btn {
        font-size: 12px;
        padding: 8px;
        min-width: 60px;
    }
    
    .stat-card .stat-number {
        font-size: 24px;
    }
    
    .notification-popup {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: unset;
        font-size: 14px;
    }
}

/* Print Styles */
@media print {
    .navbar {
        display: none;
    }
    .btn {
        display: none !important;
    }
    .order-actions {
        display: none !important;
    }
    .main-content {
        padding: 0;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--cream);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--brown-soft);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--brown);
}

.product-item.sold-out .product-info {
    cursor: not-allowed;
    user-select: none;
}

/* QR Code button on table cards */
.table-card .table-actions {
    margin-top: 8px;
    display: flex;
    justify-content: center;
    gap: 6px;
}

.table-card .qr-btn {
    padding: 4px 10px;
    font-size: 12px;
    min-height: 30px;
    background: var(--brown);
    color: white;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.table-card .qr-btn:hover {
    background: var(--brown-dark);
    transform: scale(1.05);
}

@media (max-width: 480px) {
    .table-card .qr-btn {
        padding: 3px 8px;
        font-size: 10px;
        min-height: 24px;
    }
    .table-card .qr-btn span {
        display: none;
    }
}