/* =========================================================
   مكتبة أم القرى — Design System
   Matte black + neon orange/blue, glassmorphism, RTL Arabic
   ========================================================= */

@import url('../fonts/fonts.css');

:root{
  --bg-0:#0B0B0B;
  --bg-1:#101012;
  --panel:#141417;
  --panel-2:#191a1e;
  --glass: rgba(255,255,255,0.03);
  --glass-strong: rgba(255,255,255,0.05);
  --border: rgba(255,255,255,0.08);
  --border-blue: rgba(0,174,239,0.35);
  --orange:#FF7A00;
  --orange-soft: rgba(255,122,0,0.15);
  --blue:#00AEEF;
  --blue-soft: rgba(0,174,239,0.12);
  --cyan:#00E5FF;
  --green:#22C55E;
  --green-soft: rgba(34,197,94,0.15);
  --red:#EF4444;
  --red-soft: rgba(239,68,68,0.15);
  --text-0:#F5F6F7;
  --text-1:#B7BCC4;
  --text-2:#787E88;
  --radius-lg:22px;
  --radius-md:16px;
  --radius-sm:10px;
  --shadow-panel: 0 20px 60px rgba(0,0,0,0.55);
  --shadow-glow-orange: 0 0 0 1px rgba(255,122,0,0.25), 0 0 30px rgba(255,122,0,0.12);
  --shadow-glow-blue: 0 0 0 1px rgba(0,174,239,0.25), 0 0 30px rgba(0,174,239,0.10);
  --font-display: 'Tajawal', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

*{box-sizing:border-box; margin:0; padding:0;}
html{scroll-behavior:smooth;}
body{
  direction:rtl;
  font-family: var(--font-display);
  background:
    radial-gradient(1200px 700px at 85% -10%, rgba(0,174,239,0.10), transparent 60%),
    radial-gradient(1000px 600px at 10% 110%, rgba(255,122,0,0.08), transparent 55%),
    var(--bg-0);
  color: var(--text-0);
  min-height:100vh;
  overflow-x:hidden;
  -webkit-font-smoothing:antialiased;
}
img{max-width:100%; display:block;}
a{color:inherit; text-decoration:none;}
button{font-family:inherit; cursor:pointer; border:none;}
ul{list-style:none;}
::selection{ background: var(--orange); color:#0B0B0B; }

::-webkit-scrollbar{ width:8px; height:8px; }
::-webkit-scrollbar-track{ background:transparent; }
::-webkit-scrollbar-thumb{ background:#2a2b2f; border-radius:10px; }
::-webkit-scrollbar-thumb:hover{ background:#3a3b40; }

/* ---------- Layout shell ---------- */
/* Flexbox on purpose (not CSS Grid): with dir="rtl", implicit grid track
   assignment can hand the wrong track to the wrong element depending on
   source order, which is what caused the sidebar to render at the wrong
   width. Flexbox lets the sidebar own its width directly (flex-basis),
   independent of direction and independent of how wide the content next
   to it happens to be. */
.app-shell{
  display:flex;
  min-height:100vh;
  width:100%;
  max-width:100vw;
  overflow-x:hidden;
}
.main-col{
  display:flex; flex-direction:column;
  flex:1 1 auto;
  min-width:0;   /* prevents content (tables/charts) from forcing the column to overflow */
  width:100%;
  max-width:100%;
}
.page-content{
  padding:24px 28px 60px;
  display:flex; flex-direction:column; gap:22px;
  min-width:0;
}

/* ---------- Sidebar ---------- */
/* Desktop: expanded 260px / collapsed 72px. Width lives on the sidebar
   itself (flex-basis + width), so the main column simply gets "whatever
   is left" via flex:1 — there is nothing to keep in sync and nothing
   that can desync when the window is resized. */
.sidebar{
  background: linear-gradient(180deg, var(--panel), var(--bg-1) 85%);
  border-left:1px solid var(--border);
  padding:22px 16px;
  display:flex; flex-direction:column; gap:6px;
  position:sticky; top:0; height:100vh;
  flex:0 0 260px;
  width:260px;
  overflow:hidden;
  transition:flex-basis .3s ease, width .3s ease, transform .3s ease;
}
body.sidebar-collapsed .sidebar{ flex-basis:72px; width:72px; }
body.sidebar-collapsed .word, body.sidebar-collapsed .nav-item span, body.sidebar-collapsed .nav-group-label{ display:none; }
body.sidebar-collapsed .sidebar-logo{ justify-content:center; padding-left:0; padding-right:0; }
body.sidebar-collapsed .logo-link{ flex:none; }
body.sidebar-collapsed .sidebar-collapse-btn{ margin:0; }
body.sidebar-collapsed .sidebar-collapse-btn svg{ transform:rotate(180deg); }
body.sidebar-collapsed .nav-item{ justify-content:center; padding:11px; }

.sidebar-logo{
  display:flex; align-items:center; gap:10px; padding:6px 10px 22px;
}
.sidebar-logo .mark{
  width:40px; height:40px; border-radius:12px;
  background: linear-gradient(135deg, var(--orange), #ff9a3d);
  display:flex; align-items:center; justify-content:center;
  box-shadow: var(--shadow-glow-orange);
  font-weight:900; color:#0B0B0B; font-size:18px;
}
.sidebar-logo .word{ font-weight:900; font-size:16px; letter-spacing:.3px; }
.sidebar-logo .word span{ display:block; font-size:10px; font-weight:500; color:var(--text-2); letter-spacing:2px; }
.logo-link{ display:flex; align-items:center; gap:10px; text-decoration:none; color:inherit; min-width:0; flex:1; }
.logo-link:hover .mark{ box-shadow:0 0 26px rgba(255,122,0,.55); }

.nav-group{ display:flex; flex-direction:column; gap:2px; flex:1; overflow-y:auto; }
.nav-group-label{ font-size:10.5px; font-weight:700; color:var(--text-2); letter-spacing:1px; text-transform:uppercase; padding:14px 12px 6px; }
.nav-group-label:first-child{ padding-top:2px; }
.nav-item{
  display:flex; align-items:center; gap:12px;
  padding:11px 14px; border-radius:12px;
  color:var(--text-1); font-size:14px; font-weight:500;
  transition:.2s ease; position:relative;
}
.nav-item svg{ width:19px; height:19px; flex-shrink:0; opacity:.85; }
.nav-item:hover{ background:var(--glass-strong); color:var(--text-0); }
.nav-item.active{
  background: linear-gradient(90deg, rgba(255,122,0,0.16), rgba(255,122,0,0.02));
  color:#fff; box-shadow: inset 0 0 0 1px rgba(255,122,0,0.25);
}
.nav-item.active::before{
  content:""; position:absolute; right:0; top:10%; bottom:10%; width:3px;
  background:var(--orange); border-radius:3px; box-shadow:0 0 10px var(--orange);
}
.nav-item.active svg{ opacity:1; color:var(--orange); }
.nav-item span{ flex:1; }
.nav-lock{ flex:none !important; width:14px; height:14px; opacity:.6; }
.nav-lock svg{ width:14px; height:14px; opacity:1; }
.nav-divider{ height:1px; background:var(--border); margin:10px 6px; }
.nav-logout{ color:#ff8a8a; }

/* ---------- Topbar ---------- */
.topbar{
  display:flex; align-items:center; justify-content:space-between;
  padding:16px 28px; border-bottom:1px solid var(--border);
  background: rgba(11,11,11,0.6); backdrop-filter: blur(14px);
  position:sticky; top:0; z-index:20;
}
.topbar-title{ font-size:20px; font-weight:800; }
.topbar-title .sub{ display:block; font-size:12.5px; font-weight:500; color:var(--text-2); margin-top:2px; }
.topbar-right{ display:flex; align-items:center; gap:16px; }
.clock-box{
  display:flex; flex-direction:column; align-items:flex-end;
  font-family:var(--font-mono); line-height:1.25;
}
.clock-box .time{ font-size:16px; font-weight:700; color:var(--cyan); }
.clock-box .date{ font-size:11px; color:var(--text-2); }
.icon-btn{
  width:42px; height:42px; border-radius:14px;
  display:flex; align-items:center; justify-content:center;
  background:var(--glass); border:1px solid var(--border); color:var(--text-1);
  position:relative; transition:.2s;
}
.icon-btn:hover{ border-color:var(--border-blue); color:#fff; }
.icon-btn .dot{
  position:absolute; top:8px; left:8px; width:8px; height:8px; border-radius:50%;
  background:var(--orange); box-shadow:0 0 8px var(--orange);
}
.admin-chip{
  display:flex; align-items:center; gap:10px; padding:6px 8px 6px 14px;
  border-radius:14px; background:var(--glass); border:1px solid var(--border);
}
.admin-chip img{ width:34px; height:34px; border-radius:10px; object-fit:cover; }
.admin-chip .name{ font-size:13px; font-weight:700; }
.admin-chip .role{ font-size:11px; color:var(--text-2); }

/* ---------- Panels / Cards ---------- */
.panel{
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border:1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel);
  position:relative;
}
.panel-blue{ box-shadow: var(--shadow-panel), 0 0 0 1px var(--border-blue) inset; }
.panel-pad{ padding:22px; }

/* HUD corner brackets — signature motif */
.hud{ position:relative; }
.hud::before, .hud::after{
  content:""; position:absolute; width:16px; height:16px; pointer-events:none;
  border-color: rgba(0,174,239,0.55); opacity:.9;
}
.hud::before{ top:-1px; right:-1px; border-top:2px solid; border-right:2px solid; border-radius:0 var(--radius-lg) 0 0; }
.hud::after{ bottom:-1px; left:-1px; border-bottom:2px solid; border-left:2px solid; border-radius:0 0 0 var(--radius-lg); }

.section-head{ display:flex; align-items:center; justify-content:space-between; }
.section-head h2{ font-size:16.5px; font-weight:800; }
.section-head .link{ font-size:12.5px; color:var(--blue); font-weight:700; }

/* ---------- Stat cards ---------- */
.stat-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:16px; }
.stat-card{
  padding:18px 18px; border-radius:var(--radius-md);
  background: var(--panel); border:1px solid var(--border);
  display:flex; flex-direction:column; gap:10px;
  transition:.25s;
}
.stat-card:hover{ transform:translateY(-3px); border-color:var(--border-blue); }
.stat-card .top{ display:flex; align-items:center; justify-content:space-between; }
.stat-card .icon{
  width:38px; height:38px; border-radius:11px; display:flex; align-items:center; justify-content:center;
}
.icon-orange{ background:var(--orange-soft); color:var(--orange); }
.icon-blue{ background:var(--blue-soft); color:var(--blue); }
.icon-green{ background:var(--green-soft); color:var(--green); }
.icon-red{ background:var(--red-soft); color:var(--red); }
.stat-card .label{ font-size:12.5px; color:var(--text-2); font-weight:600; }
.stat-card .value{ font-size:24px; font-weight:800; font-family:var(--font-mono); }
.trend{ font-size:11.5px; font-weight:700; display:flex; align-items:center; gap:4px; }
.trend.up{ color:var(--green); }
.trend.down{ color:var(--red); }

/* ---------- Buttons ---------- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:12px 20px; border-radius:13px; font-size:13.5px; font-weight:700;
  transition:.2s; white-space:nowrap;
}
.btn svg{ width:16px; height:16px; }
.btn-primary{
  background: linear-gradient(135deg, var(--orange), #ff9433); color:#0B0B0B;
  box-shadow: 0 8px 24px rgba(255,122,0,0.35);
}
.btn-primary:hover{ filter:brightness(1.08); transform:translateY(-1px); }
.btn-outline{
  background:var(--glass); border:1px solid var(--border); color:var(--text-0);
}
.btn-outline:hover{ border-color:var(--border-blue); }
.btn-blue{ background:var(--blue-soft); color:var(--blue); border:1px solid var(--border-blue); }
.btn-red{ background:var(--red-soft); color:#ff8a8a; border:1px solid rgba(239,68,68,0.35); }
.btn-green{ background:var(--green-soft); color:#4ee08a; border:1px solid rgba(34,197,94,0.35); }
.btn-sm{ padding:8px 12px; font-size:12px; border-radius:10px; }
.btn-block{ width:100%; }
.btn-lg{ padding:16px 26px; font-size:15px; border-radius:16px; }
.btn:disabled{ opacity:.4; cursor:not-allowed; }

/* ---------- Badges / status ---------- */
.badge{
  display:inline-flex; align-items:center; gap:6px; padding:4px 10px; border-radius:20px;
  font-size:11.5px; font-weight:700;
}
.badge::before{ content:""; width:6px; height:6px; border-radius:50%; }
.badge-green{ background:var(--green-soft); color:#4ee08a; }
.badge-green::before{ background:var(--green); box-shadow:0 0 6px var(--green); }
.badge-red{ background:var(--red-soft); color:#ff8a8a; }
.badge-red::before{ background:var(--red); box-shadow:0 0 6px var(--red); }
.badge-orange{ background:var(--orange-soft); color:var(--orange); }
.badge-orange::before{ background:var(--orange); box-shadow:0 0 6px var(--orange); }
.badge-blue{ background:var(--blue-soft); color:var(--blue); }
.badge-blue::before{ background:var(--blue); box-shadow:0 0 6px var(--blue); }

/* ---------- Device cards ---------- */
.device-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:16px; }
.device-card{
  border-radius:var(--radius-md); padding:16px; background:var(--panel);
  border:1px solid var(--border); display:flex; flex-direction:column; gap:12px;
  transition:.25s;
}
.device-card:hover{ transform:translateY(-4px); }
.device-card.status-available{ box-shadow:0 0 0 1px rgba(34,197,94,0.3), 0 0 26px rgba(34,197,94,0.08); }
.device-card.status-busy{ box-shadow:0 0 0 1px rgba(239,68,68,0.3), 0 0 26px rgba(239,68,68,0.08); }
.device-card.status-paused{ box-shadow:0 0 0 1px rgba(255,122,0,0.3), 0 0 26px rgba(255,122,0,0.08); }
.device-thumb{
  height:110px; border-radius:12px; display:flex; align-items:center; justify-content:center;
  background: radial-gradient(120px 80px at 50% 20%, rgba(0,174,239,0.18), transparent), #0d0d10;
  border:1px solid var(--border);
}
.device-thumb svg{ width:56px; height:56px; color:var(--blue); filter:drop-shadow(0 0 12px rgba(0,174,239,0.5)); }
.device-head{ display:flex; align-items:center; justify-content:space-between; }
.device-name{ font-weight:800; font-size:14.5px; }
.device-timer{
  font-family:var(--font-mono); font-size:26px; font-weight:700; text-align:center;
  letter-spacing:1px; color:var(--text-0);
}
.device-meta{ display:flex; justify-content:space-between; font-size:12px; color:var(--text-2); }
.device-meta b{ color:var(--text-0); font-family:var(--font-mono); }
.device-customer{ font-size:12.5px; color:var(--text-1); display:flex; align-items:center; gap:6px; }
.device-actions{ display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.device-actions .full{ grid-column:1/-1; }

/* ---------- Tables ---------- */
.table-wrap{ overflow-x:auto; }
table{ width:100%; border-collapse:collapse; font-size:13px; }
thead th{
  text-align:right; padding:12px 14px; color:var(--text-2); font-weight:700; font-size:12px;
  border-bottom:1px solid var(--border); white-space:nowrap;
}
tbody td{ padding:13px 14px; border-bottom:1px solid rgba(255,255,255,0.05); white-space:nowrap; }
tbody tr{ transition:.15s; }
tbody tr:hover{ background:var(--glass-strong); }
.cell-user{ display:flex; align-items:center; gap:10px; }
.cell-user img{ width:32px; height:32px; border-radius:9px; object-fit:cover; }

/* ---------- Forms ---------- */
.field{ display:flex; flex-direction:column; gap:7px; }
.field label{ font-size:12.5px; font-weight:700; color:var(--text-1); }
.field input, .field select, .field textarea{
  background:var(--bg-1); border:1px solid var(--border); border-radius:12px;
  padding:12px 14px; color:var(--text-0); font-family:inherit; font-size:13.5px;
  outline:none; transition:.2s;
}
.field input:focus, .field select:focus, .field textarea:focus{ border-color:var(--blue); box-shadow:0 0 0 3px var(--blue-soft); }
.field textarea{ resize:vertical; min-height:80px; }
.form-grid{ display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.segmented{ display:flex; gap:8px; }
.segmented button{
  flex:1; padding:11px; border-radius:11px; background:var(--bg-1); border:1px solid var(--border);
  color:var(--text-1); font-weight:700; font-size:13px; transition:.2s;
}
.segmented button.active{ background:var(--orange-soft); color:var(--orange); border-color:rgba(255,122,0,.4); }

/* ---------- Modal ---------- */
.modal-backdrop{
  position:fixed; inset:0; background:rgba(0,0,0,0.65); backdrop-filter:blur(6px);
  display:flex; align-items:center; justify-content:center; z-index:100; padding:20px;
}
.modal{
  width:560px; max-width:100%; max-height:90vh; overflow-y:auto;
  background:linear-gradient(180deg,var(--panel),var(--panel-2));
  border:1px solid var(--border-blue); border-radius:var(--radius-lg);
  box-shadow:0 30px 90px rgba(0,0,0,0.6), 0 0 40px rgba(0,174,239,0.08);
  padding:26px;
}
.modal-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:20px; }
.modal-head h3{ font-size:18px; font-weight:800; }
.close-x{ width:34px; height:34px; border-radius:10px; background:var(--glass); display:flex; align-items:center; justify-content:center; color:var(--text-1); }

/* ---------- Utility ---------- */
.flex{ display:flex; }
.gap-8{ gap:8px; } .gap-10{ gap:10px; } .gap-12{ gap:12px; } .gap-16{ gap:16px; }
.items-center{ align-items:center; }
.justify-between{ justify-content:space-between; }
.text-muted{ color:var(--text-2); }
.text-blue{ color:var(--blue); }
.text-orange{ color:var(--orange); }
.text-green{ color:var(--green); }
.mono{ font-family:var(--font-mono); }
.grid-2{ display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.grid-3{ display:grid; grid-template-columns:1fr 1fr 1fr; gap:16px; }
.w-full{ width:100%; }
.stars{ display:flex; gap:6px; }
.stars svg{ width:34px; height:34px; color:#3a3b40; transition:.2s; cursor:pointer; }
.stars svg.active{ color:var(--orange); filter:drop-shadow(0 0 8px rgba(255,122,0,.6)); }

/* progress bars */
.bar{ height:8px; border-radius:6px; background:var(--bg-1); overflow:hidden; }
.bar > span{ display:block; height:100%; border-radius:6px; background:linear-gradient(90deg,var(--orange),#ffb066); }

/* fade in */
.fade-in{ animation:fadeIn .5s ease both; }
@keyframes fadeIn{ from{opacity:0; transform:translateY(8px);} to{opacity:1; transform:none;} }

@media (max-width: 1200px){
  .stat-grid{ grid-template-columns:repeat(2,1fr); }
  .device-grid{ grid-template-columns:repeat(2,1fr); }
}

/* breadcrumb */
.breadcrumb{ font-size:11.5px; color:var(--text-2); margin-bottom:2px; }
.breadcrumb a{ color:var(--text-2); }
.breadcrumb a:hover{ color:var(--blue); }
.breadcrumb .crumb-sep{ margin:0 4px; }

/* hamburger: hidden on desktop, shown on tablet/mobile */
.hamburger-btn{ display:none; }

/* sidebar collapse buttons (desktop collapse-to-icons / mobile close-X) */
.sidebar-logo{ position:relative; }
.sidebar-collapse-btn{
  margin-right:auto; width:30px; height:30px; border-radius:9px; background:var(--glass);
  border:1px solid var(--border); color:var(--text-1); display:flex; align-items:center; justify-content:center;
  transition:.2s; flex-shrink:0;
}
.sidebar-collapse-btn:hover{ color:#fff; border-color:var(--border-blue); }
.sidebar-close-btn{
  display:none; width:30px; height:30px; border-radius:9px; background:var(--glass);
  border:1px solid var(--border); color:var(--text-1); align-items:center; justify-content:center; flex-shrink:0;
}
.sidebar-close-btn svg{ width:15px; height:15px; }

.sidebar-overlay{ display:none; }

/* Tablet + mobile (<=1200px): sidebar leaves the flex flow entirely (position:fixed)
   and becomes an off-canvas panel — main-col automatically becomes full width
   with nothing to override, since it was already flex:1 in a flex row with only
   one remaining in-flow sibling. Hidden by default, opens as an overlay. */
@media (max-width: 1200px){
  .hamburger-btn{ display:flex; }
  .sidebar{
    position:fixed; top:0; right:0; height:100vh; width:260px; flex-basis:260px; z-index:120;
    transform:translateX(100%); transition:transform .3s ease; box-shadow:-10px 0 40px rgba(0,0,0,.5);
  }
  /* the desktop-only collapse-to-icons feature never applies below this breakpoint */
  body.sidebar-collapsed .sidebar{ width:260px; flex-basis:260px; }
  body.sidebar-collapsed .word, body.sidebar-collapsed .nav-item span, body.sidebar-collapsed .nav-group-label{ display:block; }
  body.sidebar-collapsed .nav-item{ justify-content:flex-start; padding:11px 14px; }
  body.sidebar-collapsed .sidebar-logo{ justify-content:flex-start; padding-left:10px; padding-right:10px; }
  body.sidebar-collapsed .logo-link{ flex:1; }

  .sidebar.mobile-open{ transform:translateX(0); }
  .sidebar-overlay{
    display:block; position:fixed; inset:0; background:rgba(0,0,0,.6); backdrop-filter:blur(3px);
    z-index:110; opacity:0; pointer-events:none; transition:opacity .25s ease;
  }
  .sidebar-overlay.show{ opacity:1; pointer-events:auto; }
  .sidebar-collapse-btn{ display:none; }
  .sidebar-close-btn{ display:flex; }
}

@media (max-width: 720px){
  .page-content{ padding:16px 14px 40px; }
  .stat-grid, .device-grid, .product-grid, .cust-grid, .emp-grid{ grid-template-columns:1fr 1fr !important; }
  .grid-2, .grid-3, .form-grid{ grid-template-columns:1fr !important; }
  .topbar{ padding:12px 14px; }
  .topbar-title{ font-size:16px; }
  .admin-chip .name, .admin-chip .role{ display:none; }
  .clock-box{ display:none; }
  .modal{ padding:18px; }
}
@media (max-width: 460px){
  .stat-grid, .device-grid, .product-grid, .cust-grid, .emp-grid{ grid-template-columns:1fr !important; }
}

/* ---------- Toasts ---------- */
.toast-wrap{
  position:fixed; top:20px; left:20px; z-index:400;
  display:flex; flex-direction:column; gap:10px; max-width:340px;
}
.toast{
  display:flex; align-items:center; gap:10px; padding:14px 16px; border-radius:14px;
  background:linear-gradient(180deg,var(--panel),var(--panel-2)); border:1px solid var(--border);
  box-shadow:0 20px 50px rgba(0,0,0,.5); font-size:13px; font-weight:600; color:var(--text-0);
  transform:translateX(-120%); opacity:0; transition:transform .3s ease, opacity .3s ease;
}
.toast.show{ transform:translateX(0); opacity:1; }
.toast.hide{ transform:translateX(-120%); opacity:0; }
.toast-icon{ width:20px; height:20px; flex-shrink:0; display:flex; }
.toast-icon svg{ width:20px; height:20px; }
.toast-success{ border-color:rgba(34,197,94,.4); } .toast-success .toast-icon{ color:var(--green); }
.toast-error{ border-color:rgba(239,68,68,.4); } .toast-error .toast-icon{ color:#ff6b6b; }
.toast-warning{ border-color:rgba(255,122,0,.4); } .toast-warning .toast-icon{ color:var(--orange); }
.toast-info{ border-color:rgba(0,174,239,.4); } .toast-info .toast-icon{ color:var(--blue); }
.toast-msg{ flex:1; line-height:1.5; }
.toast-close{ background:none; color:var(--text-2); font-size:13px; padding:2px; }
.toast-close:hover{ color:#fff; }

/* ---------- Form validation ---------- */
.field-error{ color:#ff8a8a; font-size:11.5px; min-height:14px; }
.field input.input-error, .field select.input-error, .field textarea.input-error{ border-color:#ef4444 !important; box-shadow:0 0 0 3px rgba(239,68,68,.12); }
.field-success{ color:#4ee08a; font-size:11.5px; }

/* ---------- Modal animation ---------- */
.modal-anim{ animation: modalIn .22s ease both; }
@keyframes modalIn{ from{ opacity:0; transform:translateY(14px) scale(.97);} to{ opacity:1; transform:none; } }
.modal-backdrop{ animation: backdropIn .18s ease both; }
.modal-backdrop.closing{ animation: backdropOut .16s ease both; }
.modal-backdrop.closing .modal{ animation: modalOut .16s ease both; }
@keyframes backdropIn{ from{opacity:0;} to{opacity:1;} }
@keyframes backdropOut{ from{opacity:1;} to{opacity:0;} }
@keyframes modalOut{ from{opacity:1; transform:none;} to{opacity:0; transform:translateY(10px) scale(.97);} }

/* ---------- Loading ---------- */
.spinner{ width:18px; height:18px; border-radius:50%; border:2.5px solid rgba(255,255,255,.25); border-top-color:#fff; animation:spin .7s linear infinite; display:inline-block; }
.btn.is-loading{ pointer-events:none; opacity:.75; }
.skeleton{ background:linear-gradient(90deg, var(--panel) 25%, var(--panel-2) 37%, var(--panel) 63%); background-size:400% 100%; animation:skeleton 1.4s ease infinite; border-radius:10px; }
@keyframes skeleton{ 0%{background-position:100% 50%;} 100%{background-position:0 50%;} }
.page-loading{ display:flex; align-items:center; justify-content:center; gap:12px; padding:80px 0; color:var(--text-2); font-size:13px; }

/* ---------- Row selection / action menu ---------- */
tbody tr.row-selected{ background:var(--blue-soft) !important; }
.row-check{ accent-color: var(--orange); }
.action-menu{ position:relative; display:inline-block; }
.action-menu-btn{ width:32px; height:32px; border-radius:9px; background:var(--glass); border:1px solid var(--border); color:var(--text-1); display:flex; align-items:center; justify-content:center; }
.action-menu-list{ position:absolute; left:0; top:38px; min-width:150px; background:var(--panel-2); border:1px solid var(--border); border-radius:12px; box-shadow:0 20px 50px rgba(0,0,0,.5); z-index:30; overflow:hidden; display:none; }
.action-menu-list.open{ display:block; }
.action-menu-list button{ display:flex; width:100%; align-items:center; gap:8px; padding:10px 14px; background:none; color:var(--text-0); font-size:12.5px; text-align:right; }
.action-menu-list button:hover{ background:var(--glass-strong); }
.action-menu-list button.danger{ color:#ff8a8a; }

/* ---------- Toggle switch (global, used across settings/memberships/coupons/etc.) ---------- */
.toggle{ width:46px; height:26px; border-radius:20px; background:var(--bg-1); border:1px solid var(--border); position:relative; cursor:pointer; flex-shrink:0; }
.toggle::after{ content:""; position:absolute; top:2px; right:2px; width:20px; height:20px; border-radius:50%; background:var(--text-2); transition:.2s; }
.toggle.on{ background:var(--orange-soft); border-color:rgba(255,122,0,.4); }
.toggle.on::after{ background:var(--orange); right:22px; box-shadow:0 0 8px var(--orange); }

/* ---------- Empty / loading states ---------- */
.empty-state-full{ display:flex; flex-direction:column; align-items:center; gap:14px; padding:60px 20px; text-align:center; }
.empty-state-full svg{ width:52px; height:52px; color:var(--text-2); opacity:.5; }
.empty-state-full .title{ font-weight:800; font-size:15px; }
.empty-state-full .sub{ font-size:12.5px; color:var(--text-2); max-width:320px; }

/* ---------- Pagination ---------- */
.pagination{ display:flex; align-items:center; justify-content:center; gap:6px; padding-top:16px; }
.pagination button{ min-width:32px; height:32px; border-radius:9px; background:var(--glass); border:1px solid var(--border); color:var(--text-1); font-size:12.5px; font-weight:700; }
.pagination button.active{ background:var(--orange-soft); color:var(--orange); border-color:rgba(255,122,0,.4); }
.pagination button:disabled{ opacity:.35; }
