/* =========================================================================
   Restaurant Menu — dashboard theme (rm- prefix)
   Aligned to the app's dashboard standard (PaymentAnalytics /
   CommissionSetup / ModuleGroup / GlobalMenuBuilder): full-width #0F1412
   page, neutral #2E2E2E / #252927 borders, underline tabs, icon-box stat
   cards, gradient primary buttons, and the shared table style.
   Accent #2DD4BF (teal) / #22C55E (green).
   ========================================================================= */

/* ── Page container ─────────────────────────────────────────────── */
.rm-page {
    background: #0F1412;
    min-height: 100vh;
    padding-bottom: 2rem;
}

/* ── Page head (title bar) ──────────────────────────────────────── */
.rm-head {
    padding: 1.25rem;
    border-bottom: 2px solid #2E2E2E;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.rm-head h1 {
    color: #FFFFFF;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.625rem;
}
.rm-head h1 i { color: #2DD4BF; font-size: 1.25rem; }
.rm-sub { color: #6B7280; font-size: 0.813rem; margin-top: 4px; }

/* ── Tab bar (underline tabs) ───────────────────────────────────── */
.rm-tabs {
    display: flex;
    gap: 0;
    padding: 0 1.25rem;
    border-bottom: 2px solid #2E2E2E;
    background: #0F1412;
    overflow-x: auto;
}
.rm-tab {
    padding: 0.75rem 1.25rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: #6B7280;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
    white-space: nowrap;
    transition: color 0.2s, border-color 0.2s;
}
.rm-tab:hover { color: #D1D5DB; }
.rm-tab.active { color: #2DD4BF; border-bottom-color: #2DD4BF; }
.rm-tab i { font-size: 0.813rem; }

/* ── Body / sections ──────────────────────────────────────────── */
.rm-body { padding: 1.25rem; }
.rm-section { margin-top: 1.5rem; }
.rm-section:first-child { margin-top: 0; }
.rm-section-title {
    color: #FFFFFF; font-size: 1rem; font-weight: 700; margin: 0 0 0.875rem;
    display: flex; align-items: center; gap: 0.5rem;
}
.rm-section-title i { color: #2DD4BF; font-size: 1.125rem; }
.rm-section-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem;
}
.rm-section-head .rm-section-title { margin-bottom: 0; }

/* ── KPI / stat cards (matches .pa-kpi / .cs-stat-card) ─────────── */
.rm-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px;
    margin-bottom: 1.25rem;
}
.rm-kpi {
    background: #1A1D1C;
    border: 1px solid #2E2E2E;
    border-radius: 14px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.rm-kpi-icon {
    width: 44px; height: 44px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem; flex-shrink: 0;
    background: rgba(45, 212, 191, 0.12); color: #2DD4BF;
}
.rm-kpi.accent .rm-kpi-icon { background: rgba(139, 92, 246, 0.12); color: #8B5CF6; }
.rm-kpi.warn .rm-kpi-icon { background: rgba(245, 158, 11, 0.12); color: #F59E0B; }
.rm-kpi.danger .rm-kpi-icon { background: rgba(239, 68, 68, 0.12); color: #EF4444; }
.rm-kpi.good .rm-kpi-icon { background: rgba(34, 197, 94, 0.12); color: #22C55E; }
.rm-kpi-body { min-width: 0; }
.rm-kpi-value { color: #FFFFFF; font-size: 1.5rem; font-weight: 700; line-height: 1; }
.rm-kpi-label {
    color: #6B7280; font-size: 0.75rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.05em; margin-top: 6px;
}
.rm-kpi-sub { color: #6B7280; font-size: 0.75rem; margin-top: 2px; }

/* ── Toolbar / filter bar ──────────────────────────────────────── */
.rm-toolbar {
    display: flex; align-items: flex-end; gap: 0.75rem;
    flex-wrap: wrap; margin-bottom: 1rem;
}
.rm-field { display: flex; flex-direction: column; gap: 4px; }
.rm-field label {
    color: #6B7280; font-size: 0.75rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.04em;
}
.rm-input, .rm-select {
    padding: 0.5rem 0.75rem;
    background: #1A1D1C;
    border: 1px solid #2E2E2E;
    border-radius: 0.5rem;
    color: #FFFFFF;
    font-size: 0.875rem;
    outline: none;
    font-family: inherit;
    box-sizing: border-box;
    min-width: 150px;
    transition: border-color 0.2s;
}
.rm-input:focus, .rm-select:focus { border-color: #2DD4BF; box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.08); }
.rm-select { cursor: pointer; }
.rm-select option { background: #1A1D1C; }
.rm-search {
    position: relative;
}
.rm-search i {
    position: absolute; left: 0.7rem; top: 50%; transform: translateY(-50%);
    color: #6B7280; font-size: 0.813rem; pointer-events: none;
}
.rm-search .rm-input { padding-left: 2.1rem; min-width: 240px; }

/* ── Buttons (matches .pa-btn family) ──────────────────────────── */
.rm-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.375rem;
    cursor: pointer; font-weight: 700; font-size: 0.813rem;
    border-radius: 0.5rem; transition: all 0.15s; font-family: inherit;
    padding: 0.5rem 1rem; border: none;
    background: linear-gradient(135deg, #2DD4BF, #22C55E);
    color: #0F1412; box-shadow: 0 2px 8px rgba(45, 212, 191, 0.2);
}
.rm-btn:hover { box-shadow: 0 4px 16px rgba(45, 212, 191, 0.3); transform: translateY(-1px); }
.rm-btn.sm { padding: 0.4rem 0.75rem; font-size: 0.75rem; font-weight: 600; box-shadow: none; }
.rm-btn.sm:hover { transform: none; box-shadow: 0 2px 8px rgba(45, 212, 191, 0.2); }
.rm-btn.ghost {
    background: #252927; color: #D1D5DB; border: none; box-shadow: none; font-weight: 600;
}
.rm-btn.ghost:hover { background: #2E2E2E; transform: none; box-shadow: none; }
.rm-btn.danger { background: #EF4444; color: #fff; box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2); }
.rm-btn.danger:hover { background: #DC2626; box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3); }
.rm-btn.success { background: #22C55E; color: #0F1412; }
.rm-btn.success:hover { background: #16A34A; }
.rm-btn.amber { background: #F59E0B; color: #0F1412; }
.rm-btn.amber:hover { background: #D97706; }
.rm-btn.block { width: 100%; }
.rm-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ── Tables (matches .pa-table / .cs-table) ─────────────────────── */
.rm-table-wrap { overflow-x: auto; }
.rm-table {
    width: 100%; border-collapse: collapse;
    background: #1A1D1C; border-radius: 14px; overflow: hidden;
    min-width: 760px;
}
.rm-table thead th {
    background: #252927; color: #9CA3AF;
    font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
    padding: 14px 16px; text-align: left; white-space: nowrap;
}
.rm-table tbody td {
    padding: 14px 16px; color: #D1D5DB; font-size: 0.875rem;
    border-top: 1px solid #252927; vertical-align: middle;
}
.rm-table tbody tr { transition: background 0.15s; }
.rm-table tbody tr:hover { background: rgba(45, 212, 191, 0.04); }
.rm-table .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.rm-table .price { color: #2DD4BF; font-weight: 700; }
.rm-table .name { color: #FFFFFF; font-weight: 600; }
.rm-table .muted { color: #6B7280; }
.rm-table .actions { display: flex; gap: 6px; align-items: center; white-space: nowrap; }

.rm-thumb {
    width: 40px; height: 40px; border-radius: 10px; object-fit: cover;
    background: #252927; flex-shrink: 0;
}
.rm-thumb-placeholder {
    width: 40px; height: 40px; border-radius: 10px; background: #252927;
    display: flex; align-items: center; justify-content: center; color: #4B5563;
    flex-shrink: 0;
}
.rm-item-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.rm-item-cell .rm-item-name { color: #FFFFFF; font-weight: 600; font-size: 0.875rem; }
.rm-item-cell .rm-item-desc { color: #6B7280; font-size: 0.75rem; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }

/* ── Status / stock badges (matches .pa-badge) ─────────────────── */
.rm-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 10px;
    font-size: 0.75rem; font-weight: 600; text-transform: capitalize;
}
.rm-badge i { font-size: 0.625rem; }
.rm-badge.available, .rm-badge.active, .rm-badge.in { background: rgba(34, 197, 94, 0.12); color: #22C55E; }
.rm-badge.unavailable, .rm-badge.inactive, .rm-badge.out { background: rgba(239, 68, 68, 0.12); color: #EF4444; }
.rm-badge.low { background: rgba(245, 158, 11, 0.12); color: #F59E0B; }
.rm-badge.unlimited { background: rgba(107, 114, 128, 0.12); color: #9CA3AF; }
.rm-pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: 8px;
    font-size: 0.688rem; font-weight: 600;
    background: rgba(45, 212, 191, 0.1); color: #2DD4BF;
}

/* ── Availability toggle switch ────────────────────────────────── */
.rm-toggle {
    width: 42px; height: 24px; border-radius: 999px; border: none;
    background: #2E2E2E; cursor: pointer; position: relative;
    transition: background 0.2s; flex-shrink: 0; padding: 0;
}
.rm-toggle::after {
    content: ''; position: absolute; top: 3px; left: 3px;
    width: 18px; height: 18px; border-radius: 50%; background: #9CA3AF;
    transition: transform 0.2s, background 0.2s;
}
.rm-toggle.on { background: rgba(34, 197, 94, 0.5); }
.rm-toggle.on::after { transform: translateX(18px); background: #22C55E; }
.rm-toggle:hover { opacity: 0.85; }

/* ── Row icon action buttons ───────────────────────────────────── */
.rm-icon-btn {
    width: 32px; height: 32px; border-radius: 8px; border: none;
    background: rgba(255, 255, 255, 0.04); color: #9CA3AF; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.rm-icon-btn:hover { background: rgba(45, 212, 191, 0.15); color: #2DD4BF; }
.rm-icon-btn.danger:hover { background: rgba(239, 68, 68, 0.15); color: #EF4444; }

/* ── Card grids (categories / global items / custom dishes) ─────── */
.rm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.rm-card {
    background: #1A1D1C;
    border: 1px solid #2E2E2E;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s, transform 0.15s;
}
.rm-card:hover { border-color: #2E2E2E; }
.rm-card-media { width: 100%; height: 150px; object-fit: cover; background: #252927; display: block; }
.rm-card-media-placeholder {
    width: 100%; height: 150px; background: #252927;
    display: flex; align-items: center; justify-content: center; color: #4B5563; font-size: 2rem;
}
.rm-card-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.rm-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.rm-card-title { color: #FFFFFF; font-size: 1rem; font-weight: 700; margin: 0; line-height: 1.3; }
.rm-card-icon { font-size: 1.5rem; line-height: 1; }
.rm-card-desc { color: #9CA3AF; font-size: 0.813rem; line-height: 1.45; margin: 0;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rm-card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rm-card-meta .rm-pill i { font-size: 0.625rem; }
.rm-card-price { color: #2DD4BF; font-size: 1.125rem; font-weight: 700; }
.rm-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.rm-card-actions { display: flex; gap: 8px; }
.rm-card-actions .rm-btn { flex: 1; }

/* ── Category card (activation) ────────────────────────────────── */
.rm-cat-card {
    background: #1A1D1C;
    border: 1px solid #2E2E2E;
    border-radius: 14px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color 0.2s;
}
.rm-cat-card.activated { border-color: rgba(34, 197, 94, 0.35); }
.rm-cat-head { display: flex; align-items: flex-start; gap: 12px; }
.rm-cat-head .rm-card-icon { font-size: 2rem; }
.rm-cat-body { flex: 1; min-width: 0; }
.rm-cat-stats { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }

/* ── Panel (matches .pa-panel) ─────────────────────────────────── */
.rm-panel {
    background: #1A1D1C; border: 1px solid #2E2E2E;
    border-radius: 16px; padding: 20px;
}
.rm-panel h3 {
    color: #FFFFFF; font-size: 1rem; font-weight: 700; margin: 0 0 1rem;
    display: flex; align-items: center; gap: 0.5rem;
}
.rm-panel h3 i { color: #2DD4BF; font-size: 1.125rem; }
.rm-panel-muted { color: #6B7280; font-size: 0.875rem; }

/* ── Empty / loading (matches .pa-empty) ────────────────────────── */
.rm-empty { text-align: center; padding: 4rem 1rem; color: #6B7280; }
.rm-empty i { font-size: 2.5rem; margin-bottom: 0.75rem; display: block; color: #4B5563; }
.rm-empty p { color: #fff; font-size: 1.063rem; font-weight: 600; margin: 0 0 0.5rem; }
.rm-empty .rm-empty-desc { color: #6B7280; font-size: 0.875rem; font-weight: 400; }
.rm-loading { text-align: center; padding: 3rem 1rem; color: #6B7280; }
.rm-loading i { color: #2DD4BF; font-size: 2rem; margin-bottom: 0.75rem; display: block; }
.rm-loading p { color: #fff; font-size: 1rem; font-weight: 600; margin: 0; }

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .rm-head { padding: 1rem; }
    .rm-tabs { padding: 0 1rem; }
    .rm-body { padding: 1rem; }
    .rm-kpis { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
    .rm-kpis { grid-template-columns: 1fr; }
    .rm-toolbar { flex-direction: column; align-items: stretch; }
    .rm-input, .rm-select, .rm-search .rm-input { min-width: 0; width: 100%; }
}