/* =====================================================================
   RestoPro theme – clean restaurant admin look (light + dark)
   ===================================================================== */
:root {
  --rp-primary: #FFA500;
  --rp-primary-rgb: 255, 165, 0;
  --rp-primary-dark: #E69500;
  --rp-primary-soft: #FFF6E5;
  --rp-primary-text: #B86E00; /* darker shade of #FFA500 for readable text/links on white */
  --rp-success: #22B07D; --rp-success-soft: #E4F7EF;
  --rp-info: #2F80ED;    --rp-info-soft: #E6F0FD;
  --rp-warning: #EAB308; --rp-warning-soft: #FEF9E1;
  --rp-danger: #F04B4B;  --rp-danger-soft: #FDEAEA;
  --rp-purple: #7B61FF;  --rp-purple-soft: #EFECFF;
  --rp-bg: #F6F6F9;
  --rp-surface: #FFFFFF;
  --rp-border: #EEEEF3;
  --rp-text: #1E1E2D;
  --rp-muted: #8A8A9E;
  --rp-side-w: 268px;
  --rp-radius: 18px;
  --rp-shadow: 0 4px 22px rgba(30, 30, 60, .06);

  --bs-body-font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bs-body-bg: var(--rp-bg);
  --bs-body-color: var(--rp-text);
  --bs-primary: var(--rp-primary);
  --bs-primary-rgb: var(--rp-primary-rgb);
  --bs-link-color: var(--rp-primary-text);
  --bs-link-color-rgb: var(--rp-primary-rgb);
  --bs-link-hover-color: var(--rp-primary-dark);
  --bs-border-color: var(--rp-border);
  --bs-secondary-color: var(--rp-muted);
  --bs-border-radius: 10px;
}
[data-bs-theme="dark"] {
  --rp-primary-text: #FFB733;
  --rp-bg: #14141F;
  --rp-surface: #1E1E2D;
  --rp-border: #2B2B3D;
  --rp-text: #E9E9F2;
  --rp-muted: #8D8DA6;
  --rp-primary-soft: rgba(255, 165, 0, .15);
  --rp-success-soft: rgba(34, 176, 125, .16); --rp-info-soft: rgba(47, 128, 237, .16);
  --rp-warning-soft: rgba(245, 165, 36, .16); --rp-danger-soft: rgba(240, 75, 75, .16); --rp-purple-soft: rgba(123, 97, 255, .18);
  --rp-shadow: 0 4px 22px rgba(0, 0, 0, .25);
  --bs-body-bg: var(--rp-bg);
  --bs-body-color: var(--rp-text);
  --bs-border-color: var(--rp-border);
  --bs-tertiary-bg: #25253A;
  --bs-secondary-bg: #25253A;
}
body { font-size: .9rem; background: var(--rp-bg); color: var(--rp-text); }
a { text-decoration: none; }
::selection { background: rgba(var(--rp-primary-rgb), .25); }

/* ---------- Layout shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { padding: 1.75rem; flex: 1; }
.footer { padding: 1rem 1.75rem; color: var(--rp-muted); font-size: .8rem; }

/* ---------- Sidebar ---------- */
.sidebar { width: var(--rp-side-w); background: var(--rp-surface); border-right: 1px solid var(--rp-border);
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; flex-shrink: 0; z-index: 1040; transition: width .2s, left .2s; }
.brand { display: flex; align-items: center; gap: .75rem; padding: 1.4rem 1.5rem 1.1rem; color: var(--rp-text); }
.brand-logo { width: 44px; height: 44px; border-radius: 14px; background: linear-gradient(135deg, #FFC04D, var(--rp-primary)); color: #fff;
  display: grid; place-items: center; font-size: 1.35rem; box-shadow: 0 8px 18px rgba(var(--rp-primary-rgb), .35); flex-shrink: 0; }
.brand-text { font-weight: 700; font-size: 1.05rem; line-height: 1.15; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.brand-text small { display: block; font-weight: 400; font-size: .72rem; color: var(--rp-muted); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: .25rem 1rem 1rem; scrollbar-width: thin; }
.sidebar .nav-group { font-size: .68rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--rp-muted); padding: 1rem .9rem .4rem; }
.sidebar .nav-link { display: flex; align-items: center; gap: .85rem; padding: .62rem .9rem; margin: 2px 0; border-radius: 12px;
  color: var(--rp-muted); font-weight: 500; transition: background .15s, color .15s; white-space: nowrap; }
.sidebar .nav-link i { font-size: 1.12rem; width: 1.3rem; text-align: center; }
.sidebar .nav-link:hover { color: var(--rp-primary); background: var(--rp-primary-soft); }
.sidebar .nav-link.active { background: var(--rp-primary); color: #fff; box-shadow: 0 8px 18px rgba(var(--rp-primary-rgb), .3); }
.sidebar .nav-link.d-none-search { display: none; }
.sidebar-card { margin: 0 1rem 1rem; padding: 1rem; border-radius: 16px; color: #fff;
  background: linear-gradient(135deg, var(--rp-primary), #FFC04D); position: relative; overflow: hidden; }
.sidebar-card::after { content: ''; position: absolute; width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.12); right: -40px; top: -40px; }
.sidebar-card .btn-light { border: 0; font-weight: 600; color: var(--rp-primary); }

/* collapsed (mini) sidebar on desktop */
@media (min-width: 992px) {
  .sb-mini .sidebar { width: 88px; }
  .sb-mini .sidebar .brand { justify-content: center; padding-inline: .5rem; }
  .sb-mini .sidebar .brand-text, .sb-mini .sidebar .nav-link span, .sb-mini .sidebar .sidebar-card, .sb-mini .sidebar .nav-group { display: none; }
  .sb-mini .sidebar .nav-link { justify-content: center; padding: .7rem; }
}
@media (max-width: 991.98px) {
  .sidebar { position: fixed; left: calc(-1 * var(--rp-side-w) - 10px); box-shadow: var(--rp-shadow); }
  .sidebar.show { left: 0; }
  .sidebar.show + .sidebar-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 1030; }
  .content { padding: 1rem; }
}

/* ---------- Top bar ---------- */
.topbar { background: var(--rp-surface); border-bottom: 1px solid var(--rp-border); padding: .9rem 1.75rem; display: flex; align-items: center; gap: 1rem;
  position: sticky; top: 0; z-index: 1020; }
.page-heading h1 { font-size: 1.35rem; font-weight: 700; margin: 0; }
.page-heading .sub { font-size: .78rem; color: var(--rp-muted); }
.top-search { align-items: center; gap: .5rem; background: var(--rp-bg); border-radius: 12px; padding: .5rem .9rem; width: 300px; margin-left: 1.5rem; }
.top-search input { border: 0; outline: 0; background: transparent; width: 100%; color: var(--rp-text); font-size: .85rem; }
.top-search i { color: var(--rp-muted); }
.icon-btn { width: 42px; height: 42px; border-radius: 12px; border: 0; background: var(--rp-bg); color: var(--rp-text);
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--rp-primary-soft); color: var(--rp-primary); }
.dot-count { position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--rp-danger);
  color: #fff; font-size: .65rem; font-weight: 600; display: grid; place-items: center; border: 2px solid var(--rp-surface); }
.user-chip { display: flex; align-items: center; gap: .65rem; border: 0; background: transparent; color: var(--rp-text); padding: .25rem .4rem; border-radius: 14px; }
.user-chip:hover { background: var(--rp-bg); }
.avatar { width: 42px; height: 42px; border-radius: 12px; background: var(--rp-primary-soft); color: var(--rp-primary); font-weight: 700; display: grid; place-items: center; }
.notif-menu { width: 360px; max-height: 440px; overflow: auto; }
.mini-icon { width: 32px; height: 32px; border-radius: 10px; display: inline-grid; place-items: center; flex-shrink: 0; }

/* ---------- Cards ---------- */
.card { --bs-card-bg: var(--rp-surface); border: 0; border-radius: var(--rp-radius); box-shadow: var(--rp-shadow); }
.card-header { background: transparent; border-bottom: 1px solid var(--rp-border); padding: 1.05rem 1.35rem; font-weight: 600; font-size: .98rem; }
.card-header:first-child { border-radius: var(--rp-radius) var(--rp-radius) 0 0; }
.card-body { padding: 1.35rem; }
.card-footer { background: transparent; border-top: 1px solid var(--rp-border); padding: .9rem 1.35rem; }
.card > .table-responsive:last-child, .card > .table:last-child { border-radius: 0 0 var(--rp-radius) var(--rp-radius); }
.card > .table:first-child, .card > .table-responsive:first-child { border-radius: var(--rp-radius); }
.card > .table-responsive { overflow-x: auto; }
.card > .table:first-child thead th:first-child, .card > .table-responsive:first-child thead th:first-child { border-top-left-radius: var(--rp-radius); }
.card > .table:first-child thead th:last-child, .card > .table-responsive:first-child thead th:last-child { border-top-right-radius: var(--rp-radius); }

/* stat cards (used across modules) */
.stat { padding: 1.25rem 1.35rem; position: relative; overflow: hidden; height: 100%; }
.stat .label { color: var(--rp-muted); font-size: .76rem; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: 1.55rem; font-weight: 700; margin-top: .2rem; line-height: 1.2; }
.stat::after { content: ''; position: absolute; width: 90px; height: 90px; border-radius: 50%; right: -30px; bottom: -40px; background: var(--rp-primary-soft); }
.stat-icon { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 1.45rem; flex-shrink: 0; }
.stat-flex { display: flex; align-items: center; gap: 1rem; }
.stat-flex .stat-body { min-width: 0; }

/* soft colour helpers */
.soft-primary { background: var(--rp-primary-soft); color: var(--rp-primary); }
.soft-success { background: var(--rp-success-soft); color: var(--rp-success); }
.soft-info    { background: var(--rp-info-soft);    color: var(--rp-info); }
.soft-warning { background: var(--rp-warning-soft); color: #D48806; }
.soft-danger  { background: var(--rp-danger-soft);  color: var(--rp-danger); }
.soft-purple  { background: var(--rp-purple-soft);  color: var(--rp-purple); }

/* welcome banner */
.hero-banner { border-radius: var(--rp-radius); padding: 1.6rem 1.8rem; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(120deg, var(--rp-primary) 0%, #FFB733 60%, #FFCF66 100%); box-shadow: 0 12px 28px rgba(var(--rp-primary-rgb), .28); }
.hero-banner h2 { font-weight: 700; font-size: 1.45rem; margin-bottom: .25rem; }
.hero-banner p { opacity: .9; margin: 0; }
.hero-banner .hero-art { position: absolute; right: 1.5rem; bottom: -12px; font-size: 7rem; opacity: .22; line-height: 1; }
.hero-banner .btn-light { color: var(--rp-primary); font-weight: 600; border: 0; }

/* ---------- Buttons ---------- */
.btn { border-radius: 10px; font-weight: 500; padding: .5rem 1rem; }
.btn-sm { border-radius: 9px; padding: .32rem .7rem; }
.btn-lg { border-radius: 12px; padding: .75rem 1.25rem; }
.btn-primary { --bs-btn-bg: var(--rp-primary); --bs-btn-border-color: var(--rp-primary); --bs-btn-hover-bg: var(--rp-primary-dark);
  --bs-btn-hover-border-color: var(--rp-primary-dark); --bs-btn-active-bg: var(--rp-primary-dark); --bs-btn-active-border-color: var(--rp-primary-dark);
  --bs-btn-disabled-bg: var(--rp-primary); --bs-btn-disabled-border-color: var(--rp-primary); box-shadow: 0 6px 14px rgba(var(--rp-primary-rgb), .25); }
.btn-outline-primary { --bs-btn-color: var(--rp-primary); --bs-btn-border-color: var(--rp-primary); --bs-btn-hover-bg: var(--rp-primary);
  --bs-btn-hover-border-color: var(--rp-primary); --bs-btn-active-bg: var(--rp-primary); --bs-btn-active-border-color: var(--rp-primary); }
.btn-success { --bs-btn-bg: var(--rp-success); --bs-btn-border-color: var(--rp-success); --bs-btn-hover-bg: #1A9A6C; --bs-btn-hover-border-color: #1A9A6C; }
.btn-warning { --bs-btn-bg: var(--rp-warning); --bs-btn-border-color: var(--rp-warning); --bs-btn-color: #fff; --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #CA9A06; --bs-btn-hover-border-color: #CA9A06; }
.btn-dark { --bs-btn-bg: #1E1E2D; --bs-btn-border-color: #1E1E2D; }
.btn-light { --bs-btn-bg: var(--rp-bg); --bs-btn-border-color: var(--rp-bg); --bs-btn-color: var(--rp-text); --bs-btn-hover-bg: var(--rp-primary-soft); --bs-btn-hover-color: var(--rp-primary); --bs-btn-hover-border-color: transparent; }
.btn-outline-dark { --bs-btn-color: var(--rp-text); --bs-btn-border-color: var(--rp-border); --bs-btn-hover-bg: var(--rp-primary); --bs-btn-hover-border-color: var(--rp-primary); --bs-btn-active-bg: var(--rp-primary); --bs-btn-active-border-color: var(--rp-primary); background: var(--rp-surface); }
.btn-outline-secondary { --bs-btn-color: var(--rp-text); --bs-btn-border-color: var(--rp-border); --bs-btn-hover-bg: var(--rp-bg); --bs-btn-hover-color: var(--rp-primary); --bs-btn-hover-border-color: var(--rp-border); background: var(--rp-surface); }
.btn-link { color: var(--rp-primary-text); }

/* ---------- Forms ---------- */
.form-control, .form-select { border-radius: 10px; border-color: var(--rp-border); background-color: var(--rp-surface); color: var(--rp-text); }
.form-control:focus, .form-select:focus { border-color: rgba(var(--rp-primary-rgb), .6); box-shadow: 0 0 0 .2rem rgba(var(--rp-primary-rgb), .15); }
.form-control-lg, .form-select-lg { border-radius: 12px; }
.form-label { font-weight: 500; color: var(--rp-text); }
.form-check-input:checked, input[type=checkbox]:checked { accent-color: var(--rp-primary); }
input[type=checkbox] { accent-color: var(--rp-primary); }

/* ---------- Tables ---------- */
.table { --bs-table-bg: transparent; --bs-table-hover-bg: var(--rp-primary-soft); margin-bottom: 0; color: var(--rp-text); }
.table > :not(caption) > * > * { padding: .75rem .9rem; border-bottom-color: var(--rp-border); }
.table-sm > :not(caption) > * > * { padding: .55rem .75rem; }
.table thead th { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--rp-muted); background: var(--rp-bg); border-bottom: 0; white-space: nowrap; }
.table-light, .table thead.table-light th { --bs-table-bg: var(--rp-bg); --bs-table-color: var(--rp-text); }
.table tfoot th, .table tfoot td { font-weight: 600; }
.table-secondary { --bs-table-bg: var(--rp-bg); --bs-table-color: var(--rp-muted); }
.table-danger  { --bs-table-bg: var(--rp-danger-soft);  --bs-table-color: var(--rp-text); }
.table-success { --bs-table-bg: var(--rp-success-soft); --bs-table-color: var(--rp-text); }
.table-warning { --bs-table-bg: var(--rp-warning-soft); --bs-table-color: var(--rp-text); }
.table td, .table th { vertical-align: middle; }
.sticky-top.bg-white { background: var(--rp-surface) !important; }

/* ---------- Badges (soft) ---------- */
.badge { font-weight: 600; padding: .38em .7em; border-radius: 7px; font-size: .72em; }
.text-bg-primary   { background: var(--rp-primary-soft) !important; color: var(--rp-primary-text) !important; }
.text-bg-success   { background: var(--rp-success-soft) !important; color: var(--rp-success) !important; }
.text-bg-info      { background: var(--rp-info-soft) !important;    color: var(--rp-info) !important; }
.text-bg-warning   { background: var(--rp-warning-soft) !important; color: #C27C04 !important; }
.text-bg-danger    { background: var(--rp-danger-soft) !important;  color: var(--rp-danger) !important; }
.text-bg-secondary { background: var(--rp-bg) !important;           color: var(--rp-muted) !important; }
.text-bg-light     { background: var(--rp-bg) !important;           color: var(--rp-text) !important; }
.text-bg-dark      { background: #2B2B3D !important; color: #fff !important; }
.text-primary { color: var(--rp-primary-text) !important; }
.text-success { color: var(--rp-success) !important; }
.text-danger  { color: var(--rp-danger) !important; }
.bg-danger { background: var(--rp-danger) !important; }

/* ---------- Nav pills/tabs ---------- */
.nav-pills .nav-link { border-radius: 10px; color: var(--rp-muted); font-weight: 500; }
.nav-pills .nav-link.active { background: var(--rp-primary); color: #fff; }
.nav-tabs { border-bottom-color: var(--rp-border); }
.nav-tabs .nav-link { border: 0; color: var(--rp-muted); font-weight: 500; border-bottom: 2px solid transparent; }
.nav-tabs .nav-link.active { color: var(--rp-primary); background: transparent; border-bottom-color: var(--rp-primary); }
.card-header-tabs { margin-bottom: -1.05rem; }

/* ---------- Alerts / dropdowns / modals ---------- */
.alert { border: 0; border-radius: 14px; }
.alert-success { background: var(--rp-success-soft); color: #137A56; }
.alert-danger  { background: var(--rp-danger-soft);  color: #B42323; }
.alert-warning { background: var(--rp-warning-soft); color: #93600A; }
.alert-info    { background: var(--rp-info-soft);    color: #1B5DB8; }
.alert-light   { background: var(--rp-bg); color: var(--rp-text); }
[data-bs-theme="dark"] .alert-success, [data-bs-theme="dark"] .alert-danger, [data-bs-theme="dark"] .alert-warning, [data-bs-theme="dark"] .alert-info { color: var(--rp-text); }
.dropdown-menu { border: 0; border-radius: 14px; box-shadow: 0 12px 34px rgba(20, 20, 50, .14); padding: .4rem; background: var(--rp-surface); }
.dropdown-item { border-radius: 9px; padding: .5rem .8rem; }
.dropdown-item:hover { background: var(--rp-primary-soft); color: var(--rp-primary); }
.modal-content { border: 0; border-radius: var(--rp-radius); background: var(--rp-surface); }
.list-group-item { background: transparent; border-color: var(--rp-border); color: var(--rp-text); }

/* ---------- POS floor plan ---------- */
.table-tile { display: block; border-radius: 18px; padding: 1.1rem 1.2rem; min-height: 132px; background: var(--rp-surface); color: var(--rp-text);
  box-shadow: var(--rp-shadow); border: 2px solid transparent; position: relative; transition: transform .12s, border-color .12s; }
.table-tile:hover { transform: translateY(-3px); color: var(--rp-text); border-color: rgba(var(--rp-primary-rgb), .4); }
.table-tile .tname { font-size: 1.45rem; font-weight: 700; }
.table-tile::before { content: ''; position: absolute; top: 16px; right: 16px; width: 12px; height: 12px; border-radius: 50%; }
.table-tile.free::before   { background: var(--rp-success); box-shadow: 0 0 0 5px var(--rp-success-soft); }
.table-tile.busy::before   { background: var(--rp-danger);  box-shadow: 0 0 0 5px var(--rp-danger-soft); }
.table-tile.served::before { background: var(--rp-warning); box-shadow: 0 0 0 5px var(--rp-warning-soft); }
.table-tile.busy   { background: linear-gradient(180deg, var(--rp-danger-soft), var(--rp-surface) 70%); }
.table-tile.served { background: linear-gradient(180deg, var(--rp-warning-soft), var(--rp-surface) 70%); }
.table-tile .fw-bold { color: var(--rp-primary); font-size: 1.05rem; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: .35rem; }

.menu-btn { text-align: left; min-height: 78px; border-radius: 14px !important; border: 1px solid var(--rp-border) !important; background: var(--rp-surface) !important;
  color: var(--rp-text) !important; padding: .75rem .9rem; transition: all .12s; }
.menu-btn:hover { border-color: var(--rp-primary) !important; background: var(--rp-primary-soft) !important; transform: translateY(-1px); }
.menu-btn .fw-semibold::before { content: '\F4FE'; font-family: 'bootstrap-icons'; color: var(--rp-primary); margin-right: .35rem; font-weight: 400; }

/* ---------- Kitchen display ---------- */
.kds-ticket { border-top: 5px solid var(--rp-info); }
.kds-ticket.late { border-top-color: var(--rp-danger); }

/* ---------- Dashboard chart bars ---------- */
.bar-chart { display: flex; align-items: flex-end; gap: .8rem; height: 200px; }
.bar-chart .bar-col { flex: 1; text-align: center; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.bar-chart .bar { border-radius: 10px 10px 4px 4px; background: linear-gradient(180deg, #FFC04D, var(--rp-primary)); min-height: 4px; transition: height .4s; }
.bar-chart .bar.muted { background: var(--rp-primary-soft); }
.bar-chart .bar-label { font-size: .75rem; color: var(--rp-muted); margin-top: .4rem; }
.bar-chart .bar-val { font-size: .72rem; font-weight: 600; margin-bottom: .25rem; }
.progress { background: var(--rp-bg); border-radius: 8px; }
.progress-bar { background: var(--rp-primary); border-radius: 8px; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: linear-gradient(140deg, var(--rp-primary) 0%, #FFB733 55%, #FFDB8A 100%); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art .big-icon { font-size: 15rem; opacity: .18; position: absolute; right: -2rem; bottom: -3rem; line-height: 1; }
.login-art h1 { font-weight: 700; font-size: 2.3rem; max-width: 460px; }
.login-art .feat { display: flex; gap: .6rem; align-items: center; margin: .35rem 0; opacity: .95; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 2rem; background: var(--rp-surface); }
.login-form form { width: 100%; max-width: 380px; }
@media (max-width: 860px) { .login-wrap { grid-template-columns: 1fr; } .login-art { display: none; } }

.text-end-num { text-align: right; font-variant-numeric: tabular-nums; }
.display-6 { font-weight: 700; }
@media print {
  body { background: #fff; } .card { box-shadow: none; } .content { padding: 0; }
  .topbar, .sidebar, .footer { display: none !important; }
}

/* ---------- Normalisers ---------- */
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { color: inherit; }
.btn { background-image: none; }
.stat > * { position: relative; z-index: 1; }
.stat::after { z-index: 0; }
.input-group-text { border-color: var(--rp-border); color: var(--rp-muted); border-radius: 10px; }
.input-group > .form-control-lg { font-size: 1rem; }
