/* ============================================================
   MENU DIGITAL — root.css
   Variables, reset, dan komponen SHARED (dipakai admin & customer)
   Urutan import: root.css -> admin.css / customer.css -> responsive.css
   ============================================================ */

/* --- Variables & Reset ------------------------------------ */
:root {
    --primary:       #1D9E75;
    --primary-dark:  #0F6E56;
    --primary-light: #E1F5EE;
    --danger:        #E24B4A;
    --warning:       #EF9F27;
    --success:       #1D9E75;
    --gray-50:       #F8F9FA;
    --gray-100:      #F1F3F5;
    --gray-200:      #E9ECEF;
    --gray-400:      #ADB5BD;
    --gray-600:      #6C757D;
    --gray-800:      #343A40;
    --gray-900:      #212529;
    --white:         #FFFFFF;
    --radius-sm:     6px;
    --radius-md:     10px;
    --radius-lg:     14px;
    --radius-xl:     20px;
    --shadow-sm:     0 1px 3px rgba(0,0,0,.08);
    --shadow-md:     0 4px 12px rgba(0,0,0,.10);
    --shadow-lg:     0 8px 24px rgba(0,0,0,.12);
    --font:          'Inter', system-ui, -apple-system, sans-serif;
    --transition:    .18s ease;
}

[data-theme="dark"] {
    --gray-50:  #1a1d21;
    --gray-100: #212529;
    --gray-200: #2d3035;
    --gray-400: #6c757d;
    --gray-600: #adb5bd;
    --gray-800: #dee2e6;
    --gray-900: #f8f9fa;
    --white:    #2a2d31;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,.35);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body.page-template-core-menu-digital {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
}

body {
    font-family: var(--font);
    font-size: 15px;
    color: var(--gray-900);
    background: var(--gray-50);
    line-height: 1.6;
    transition: background var(--transition), color var(--transition);
}

a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; display: block; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}
.btn i { font-size: 16px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary   { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }

.btn-outline   { background: transparent; color: var(--gray-800); border-color: var(--gray-200); }
.btn-outline:hover { background: var(--gray-100); }

.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c53030; }

.btn-warning   { background: var(--warning); color: #fff; }
.btn-sm        { padding: 5px 10px; font-size: 12px; }
.btn-icon      { padding: 7px; border-radius: var(--radius-md); }

.btn-group { display: flex; gap: 6px; flex-wrap: wrap; }

/* ============================================================
   CARDS (base, dipakai admin & bisa dipakai di tempat lain)
   ============================================================ */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    padding: 20px;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-200);
}
.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-title i { color: var(--primary); font-size: 18px; }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 16px; }
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-800);
    margin-bottom: 5px;
}
.form-label .req { color: var(--danger); margin-left: 2px; }
.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--gray-900);
    background: var(--white);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(29,158,117,.12);
}
.form-control::placeholder { color: var(--gray-400); }
textarea.form-control { resize: vertical; min-height: 80px; }
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='%236C757D' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.form-hint { font-size: 12px; color: var(--gray-600); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; display: none; }

/* Input group */
.input-group { display: flex; }
.input-group .input-prefix {
    padding: 9px 12px;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-right: none;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    font-size: 13px;
    color: var(--gray-600);
    white-space: nowrap;
}
.input-group .form-control {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* Alergen tags input (dipakai di form admin item) */
.tag-input-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    min-height: 42px;
    cursor: text;
    background: var(--white);
}
.tag-input-wrap .tag-item {
    display: flex; align-items: center; gap: 4px;
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}
.tag-item .tag-remove {
    cursor: pointer; font-size: 14px; line-height: 1;
    color: var(--primary-dark); opacity: .7;
}
.tag-input-inner {
    border: none; outline: none;
    font-size: 13px;
    background: transparent;
    color: var(--gray-900);
    min-width: 80px;
}

/* Switch toggle */
.switch-wrap { display: flex; align-items: center; gap: 10px; }
.switch-wrap > div:first-child {
    flex: 1 1 auto;
    min-width: 0;
}
.switch {
    position: relative;
    display: inline-block;
    width: 40px; height: 22px;
    flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--gray-200);
    border-radius: 22px;
    transition: .2s;
}
.switch-slider::before {
    content: '';
    position: absolute;
    width: 16px; height: 16px;
    left: 3px; top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: .2s;
}
.switch input:checked + .switch-slider { background: var(--primary); }
.switch input:checked + .switch-slider::before { transform: translateX(18px); }

/* Photo upload preview (dipakai di form admin item) */
.photo-upload-wrap {
    position: relative;
    border: 2px dashed var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition);
}
.photo-upload-wrap:hover { border-color: var(--primary); }
.photo-upload-wrap .preview-img {
    width: 80px; height: 80px;
    object-fit: cover;
    border-radius: var(--radius-md);
    margin: 0 auto 8px;
    display: none;
}
.photo-upload-wrap .upload-icon { font-size: 32px; color: var(--gray-400); margin-bottom: 6px; }
.photo-upload-wrap .upload-hint { font-size: 12px; color: var(--gray-600); }

/* ============================================================
   BADGES & STATUS (dipakai admin & customer)
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
}
.badge-best   { background: #E1F5EE; color: #085041; }
.badge-spicy  { background: #FAECE7; color: #993C1D; }
.badge-veg    { background: #EAF3DE; color: #3B6D11; }
.badge-new    { background: #EBF4FF; color: #1a56db; }
.badge-promo  { background: #FFF3CD; color: #996600; }

.stok-tag {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
}
.stok-ada      { background: #E1F5EE; color: #085041; }
.stok-habis    { background: #FCEBEB; color: #7a1e1e; }
.stok-terbatas { background: #FFF3CD; color: #996600; }

.order-status-badge{display:inline-flex;align-items:center;gap:4px;padding:3px 10px;border-radius:20px;font-size:12px;font-weight:600;}
.order-status-badge.os-pending{background:#FEF3C7;color:#92400E;}
.order-status-badge.os-diproses{background:#DBEAFE;color:#1E40AF;}
.order-status-badge.os-selesai{background:#D1FAE5;color:#065F46;}
.order-status-badge.os-batal{background:#FEE2E2;color:#991B1B;}

/* ============================================================
   MODAL (base, dipakai admin & customer — detail modal customer
   ada styling tambahan di customer.css)
   ============================================================ */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.modal-backdrop.show { display: flex; animation: fadeIn .15s ease; }

.modal-box {
    background: var(--white);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: slideUp .2s ease;
}
.modal-box.modal-sm { max-width: 380px; }
.modal-box.modal-lg { max-width: 720px; }

.modal-header {
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.modal-title { font-size: 16px; font-weight: 600; color: var(--gray-900); }
.modal-close {
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-md);
    border: none; background: none;
    color: var(--gray-600);
    font-size: 20px;
    cursor: pointer;
}
.modal-close:hover { background: var(--gray-100); }

.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
    position: fixed;
    bottom: 20px; right: 20px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    background: var(--gray-900);
    color: #fff;
    font-size: 13.5px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: slideLeft .2s ease;
    max-width: 320px;
}
.toast i { font-size: 18px; flex-shrink: 0; }
.toast.success { background: var(--primary-dark); }
.toast.error   { background: var(--danger); }
.toast.warning { background: var(--warning); color: #333; }

/* ============================================================
   LAYOUT ADMIN
   ============================================================ */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar ---------------------------------------------- */
.sidebar {
    width: 240px;
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: transform var(--transition);
}

.sidebar-logo {
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar-logo .logo-icon {
    width: 36px; height: 36px;
    border-radius: var(--radius-md);
    background: var(--primary);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 18px;
}
.sidebar-logo .logo-text {
    font-size: 15px; font-weight: 600;
    color: var(--gray-900);
    line-height: 1.3;
}
.sidebar-logo .logo-sub {
    font-size: 11px; color: var(--gray-600);
}

.sidebar-nav { flex: 1; padding: 12px 8px; overflow-y: auto; }

.nav-section-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--gray-400);
    padding: 8px 12px 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-md);
    color: var(--gray-600);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    margin-bottom: 2px;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}
.nav-item i { font-size: 18px; width: 20px; flex-shrink: 0; }
.nav-item:hover { background: var(--gray-100); color: var(--gray-900); }
.nav-item.active {
    background: var(--primary-light);
    color: var(--primary-dark);
}
.nav-item .badge-count {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.sidebar-footer {
    padding: 12px 8px;
    border-top: 1px solid var(--gray-200);
}

/* --- Main Content ----------------------------------------- */
.main-content {
    margin-left: 240px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 90;
}
.topbar-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
    flex: 1;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.page-body { padding: 24px; flex: 1; }

/* --- Hamburger (mobile) ----------------------------------- */
.btn-hamburger {
    display: none;
    background: none; border: none;
    font-size: 22px; cursor: pointer;
    color: var(--gray-700);
    padding: 4px;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-600);
}
.empty-state i { font-size: 48px; color: var(--gray-200); margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ============================================================
   THEME TOGGLE (dark/light — dipakai di halaman customer, generic)
   ============================================================ */
.theme-toggle {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 50;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    font-size: 18px;
    transition: all var(--transition);
}
.theme-toggle:hover {
    box-shadow: var(--shadow-md);
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes slideUp { from { transform: translateY(16px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }
@keyframes slideLeft { from { transform: translateX(40px); opacity: 0 } to { transform: translateX(0); opacity: 1 } }

/* ============================================================
   LOADING SKELETON
   ============================================================ */
.skeleton {
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
    background-size: 200% 100%;
    animation: skeleton-anim 1.2s infinite;
    border-radius: var(--radius-md);
}
@keyframes skeleton-anim { from { background-position: 200% 0 } to { background-position: -200% 0 } }

.dt-wrapper { overflow-x: auto; }

table.dataTable {
    width: 100% !important;
    border-collapse: collapse;
    font-size: 13.5px;
}
table.dataTable thead th {
    background: var(--gray-50);
    color: var(--gray-600);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 10px 14px;
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
}
table.dataTable tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-800);
    vertical-align: middle;
}
table.dataTable tbody tr:hover td {
    background: var(--gray-50);
}
table.dataTable .item-thumb {
    width: 42px; height: 42px;
    border-radius: var(--radius-md);
    object-fit: cover;
    background: var(--gray-100);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
table.dataTable .item-name-wrap { display: flex; align-items: center; gap: 10px; }
table.dataTable .item-name { font-weight: 500; color: var(--gray-900); }
table.dataTable .item-desc { font-size: 12px; color: var(--gray-600); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }

.dt-top-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}
.dt-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.dt-search-box {
    padding: 7px 12px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--gray-900);
    background: var(--white);
    width: 220px;
}
.dt-filter-select {
    padding: 7px 28px 7px 10px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--gray-900);
    background: var(--white);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%236C757D' d='M5 7L0 2h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

div.dataTables_info,
div.dataTables_paginate { font-size: 13px; color: var(--gray-600); }
.paginate_button {
    padding: 4px 10px !important;
    border-radius: var(--radius-sm) !important;
    margin: 0 2px !important;
    cursor: pointer;
    border: 1px solid transparent !important;
    font-size: 13px !important;
}
.paginate_button.current {
    background: var(--primary) !important;
    color: #fff !important;
    border-color: var(--primary) !important;
}
.paginate_button:hover:not(.current) {
    background: var(--gray-100) !important;
    color: var(--gray-900) !important;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.modal-backdrop.show { display: flex; animation: fadeIn .15s ease; }

.modal-box {
    background: var(--white);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: slideUp .2s ease;
}
.modal-box.modal-sm { max-width: 380px; }
.modal-box.modal-lg { max-width: 720px; }

.modal-header {
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.modal-title { font-size: 16px; font-weight: 600; color: var(--gray-900); }
.modal-close {
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-md);
    border: none; background: none;
    color: var(--gray-600);
    font-size: 20px;
    cursor: pointer;
}
.modal-close:hover { background: var(--gray-100); }

.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0;
}