/*
 * StudyBox panel design system — shared by the branch (admin) and student panels.
 * Built on Bootstrap 5.3. Layout: fixed sidebar + top bar + content.
 */

:root {
  --sb-font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --sb-brand: #2563eb;
  --sb-brand-600: #1d4ed8;
  --sb-brand-50: #eff6ff;
  --sb-brand-100: #dbeafe;

  --sb-ink: #0f172a;
  --sb-ink-2: #475569;
  --sb-ink-3: #94a3b8;
  --sb-bg: #f4f6fa;
  --sb-surface: #ffffff;
  --sb-border: #e5e9f0;
  --sb-border-strong: #d4dae3;

  --sb-success: #16a34a;
  --sb-success-50: #ecfdf3;
  --sb-warning: #d97706;
  --sb-warning-50: #fffbeb;
  --sb-danger: #dc2626;
  --sb-danger-50: #fef2f2;
  --sb-info: #0891b2;
  --sb-info-50: #ecfeff;

  --sb-sidebar-w: 256px;
  --sb-topbar-h: 64px;
  --sb-sidebar-bg: #0f172a;
  --sb-sidebar-ink: #cbd5e1;
  --sb-sidebar-muted: #64748b;
  --sb-sidebar-hover: rgba(255, 255, 255, .06);

  --sb-radius: 12px;
  --sb-radius-sm: 8px;
  --sb-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .06);
  --sb-shadow-lg: 0 10px 30px rgba(15, 23, 42, .12);

  --bs-primary: var(--sb-brand);
  --bs-primary-rgb: 37, 99, 235;
  --bs-body-font-family: var(--sb-font);
  --bs-body-color: var(--sb-ink);
  --bs-border-color: var(--sb-border);
}

html, body { height: 100%; }
body {
  font-family: var(--sb-font);
  font-size: 14px;
  color: var(--sb-ink);
  background: var(--sb-bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--sb-brand); text-decoration: none; }
a:hover { color: var(--sb-brand-600); }
h1, h2, h3, h4, h5, h6 { color: var(--sb-ink); font-weight: 600; letter-spacing: -.01em; }

/* ------------------------------------------------------------------ Shell */

.app { min-height: 100vh; }

.app-sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 1040;
  width: var(--sb-sidebar-w);
  background: var(--sb-sidebar-bg);
  color: var(--sb-sidebar-ink);
  display: flex; flex-direction: column;
  transition: transform .2s ease;
}
.app-brand {
  height: var(--sb-topbar-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  color: #fff; font-weight: 700; font-size: 17px;
}
.app-brand:hover { color: #fff; }
.app-brand img { width: 34px; height: 34px; object-fit: contain; background: #fff; border-radius: 8px; padding: 3px; }
.app-brand small { display: block; font-size: 11px; font-weight: 500; color: var(--sb-sidebar-muted); letter-spacing: .02em; }

.app-nav { flex: 1; overflow-y: auto; padding: 14px 12px 20px; }
.app-nav-label {
  padding: 16px 12px 6px;
  font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--sb-sidebar-muted);
}
.app-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; margin-bottom: 2px;
  border-radius: var(--sb-radius-sm);
  color: var(--sb-sidebar-ink); font-weight: 500;
}
.app-nav a i { width: 18px; text-align: center; font-size: 15px; color: var(--sb-sidebar-muted); }
.app-nav a:hover { background: var(--sb-sidebar-hover); color: #fff; }
.app-nav a:hover i { color: #fff; }
.app-nav a.active { background: var(--sb-brand); color: #fff; }
.app-nav a.active i { color: #fff; }

.app-sidebar-foot { padding: 12px; border-top: 1px solid rgba(255, 255, 255, .06); }
.app-sidebar-foot a { color: var(--sb-sidebar-ink); display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--sb-radius-sm); }
.app-sidebar-foot a:hover { background: var(--sb-sidebar-hover); color: #fff; }

.app-main { margin-left: var(--sb-sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }

.app-topbar {
  position: sticky; top: 0; z-index: 1030;
  height: var(--sb-topbar-h);
  display: flex; align-items: center; gap: 16px;
  padding: 0 28px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--sb-border);
}
.app-topbar-title { font-size: 16px; font-weight: 600; margin: 0; }
.app-menu-toggle { display: none; border: 0; background: transparent; font-size: 20px; color: var(--sb-ink); padding: 4px 8px; }

.app-user { margin-left: auto; }
.app-user > button {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--sb-border); background: var(--sb-surface);
  padding: 5px 12px 5px 5px; border-radius: 999px; color: var(--sb-ink); font-weight: 500;
}
.app-user > button:hover { border-color: var(--sb-border-strong); }
.app-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--sb-brand-100); color: var(--sb-brand-600); font-weight: 600; font-size: 13px;
}
.app-user .dropdown-menu { min-width: 220px; padding: 6px; border-color: var(--sb-border); box-shadow: var(--sb-shadow-lg); border-radius: var(--sb-radius); }
.app-user .dropdown-item { border-radius: 6px; padding: 8px 10px; display: flex; gap: 10px; align-items: center; }
.app-user .dropdown-item i { width: 16px; color: var(--sb-ink-3); }
.app-user .dropdown-header { padding: 8px 10px; }

.app-content { flex: 1; padding: 28px; }
.app-footer { padding: 16px 28px; color: var(--sb-ink-3); font-size: 12px; border-top: 1px solid var(--sb-border); background: var(--sb-surface); }

.app-backdrop { display: none; }

@media (max-width: 991.98px) {
  .app-sidebar { transform: translateX(-100%); }
  .app.nav-open .app-sidebar { transform: none; box-shadow: var(--sb-shadow-lg); }
  .app.nav-open .app-backdrop { display: block; position: fixed; inset: 0; z-index: 1035; background: rgba(15, 23, 42, .45); }
  .app-main { margin-left: 0; }
  .app-menu-toggle { display: inline-block; }
  .app-topbar, .app-content { padding-left: 16px; padding-right: 16px; }
  .app-user > button .app-user-name { display: none; }
}

/* Pages are written as .content-body > .container-fluid; the shell already provides the padding. */
.content-body, .content-body > .container-fluid { padding: 0; margin: 0; max-width: none; }

/* ------------------------------------------------------------------ Page header */

.page-titles {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  margin: 0 0 20px !important; padding: 0;
  background: transparent; border: 0;
}
.page-titles > [class*="col-"] { width: auto; flex: 0 0 auto; padding: 0 !important; margin: 0 !important; }
.page-titles .welcome-text h4, .page-titles h4 { font-size: 22px; font-weight: 700; margin: 0; }
.page-titles .welcome-text p { margin: 2px 0 0; color: var(--sb-ink-2); }
.breadcrumb { margin: 0; font-size: 13px; background: transparent; padding: 0; }
.breadcrumb-item a { color: var(--sb-ink-2); }
.breadcrumb-item.active a, .breadcrumb-item.active { color: var(--sb-ink-3); }

.page-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.page-header h1 { font-size: 22px; font-weight: 700; margin: 0; }
.page-header p { margin: 2px 0 0; color: var(--sb-ink-2); }

/* ------------------------------------------------------------------ Cards */

.card {
  background: var(--sb-surface);
  border: 1px solid var(--sb-border);
  border-radius: var(--sb-radius);
  box-shadow: var(--sb-shadow);
  margin-bottom: 24px;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: transparent; border-bottom: 1px solid var(--sb-border);
  padding: 16px 20px;
}
.card-header:first-child { border-radius: var(--sb-radius) var(--sb-radius) 0 0; }
.card-title, .card-header h4, .card-header h5 { font-size: 15px; font-weight: 600; margin: 0; color: var(--sb-ink); }
.card-body { padding: 20px; }
.card-footer { background: #fafbfc; border-top: 1px solid var(--sb-border); padding: 14px 20px; }

/* Stat tiles */
.stat {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 20px; height: 100%;
  background: var(--sb-surface); border: 1px solid var(--sb-border); border-radius: var(--sb-radius); box-shadow: var(--sb-shadow);
  color: var(--sb-ink);
}
a.stat:hover { border-color: var(--sb-brand-100); box-shadow: 0 4px 14px rgba(37, 99, 235, .10); color: var(--sb-ink); }
.stat-icon { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 19px; flex: 0 0 auto; }
.stat-label { color: var(--sb-ink-2); font-size: 13px; font-weight: 500; }
.stat-value { font-size: 24px; font-weight: 700; line-height: 1.2; letter-spacing: -.02em; }
.tone-brand   { background: var(--sb-brand-50);   color: var(--sb-brand); }
.tone-success { background: var(--sb-success-50); color: var(--sb-success); }
.tone-warning { background: var(--sb-warning-50); color: var(--sb-warning); }
.tone-danger  { background: var(--sb-danger-50);  color: var(--sb-danger); }
.tone-info    { background: var(--sb-info-50);    color: var(--sb-info); }

/* Quick action tiles (student dashboard) */
.action-tile {
  display: flex; flex-direction: column; gap: 10px; height: 100%;
  padding: 22px; border-radius: var(--sb-radius);
  background: var(--sb-surface); border: 1px solid var(--sb-border); box-shadow: var(--sb-shadow); color: var(--sb-ink);
}
.action-tile:hover { border-color: var(--sb-brand); color: var(--sb-ink); }
.action-tile h3 { font-size: 16px; margin: 4px 0 0; }
.action-tile p { margin: 0; color: var(--sb-ink-2); }
.action-tile .link { margin-top: auto; font-weight: 600; color: var(--sb-brand); }

.empty-state { text-align: center; padding: 40px 20px; color: var(--sb-ink-2); }
.empty-state i { font-size: 32px; color: var(--sb-ink-3); margin-bottom: 10px; display: block; }

/* ------------------------------------------------------------------ Forms */

.form-group { margin-bottom: 18px; }
.form-label { font-weight: 500; font-size: 13px; color: var(--sb-ink); margin-bottom: 6px; }
.require, .form-label b.require { color: var(--sb-danger); font-weight: 600; margin-left: 2px; }
.form-control, .form-select {
  min-height: 40px;
  border: 1px solid var(--sb-border-strong);
  border-radius: var(--sb-radius-sm);
  font-size: 14px; color: var(--sb-ink);
  background-color: var(--sb-surface);
  box-shadow: none;
}
textarea.form-control { min-height: 84px; }
.form-control:focus, .form-select:focus { border-color: var(--sb-brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
.form-control[readonly] { background-color: #f8fafc; }
.form-control::placeholder { color: var(--sb-ink-3); }
.form-check-input:checked { background-color: var(--sb-brand); border-color: var(--sb-brand); }
.form-check { margin-bottom: 6px; }
.error, span.error, label.error, .invalid-feedback { color: var(--sb-danger); font-size: 12px; margin-top: 4px; display: block; }
.is-invalid { border-color: var(--sb-danger) !important; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ Buttons */

.btn { font-weight: 500; font-size: 14px; border-radius: var(--sb-radius-sm); padding: 8px 16px; }
.btn-sm { font-size: 13px; padding: 5px 10px; }
.btn-primary { --bs-btn-bg: var(--sb-brand); --bs-btn-border-color: var(--sb-brand); --bs-btn-hover-bg: var(--sb-brand-600); --bs-btn-hover-border-color: var(--sb-brand-600); --bs-btn-active-bg: var(--sb-brand-600); --bs-btn-active-border-color: var(--sb-brand-600); --bs-btn-disabled-bg: var(--sb-brand); --bs-btn-disabled-border-color: var(--sb-brand); }
.btn-secondary, .btn-light { --bs-btn-color: var(--sb-ink); --bs-btn-bg: var(--sb-surface); --bs-btn-border-color: var(--sb-border-strong); --bs-btn-hover-color: var(--sb-ink); --bs-btn-hover-bg: #f1f5f9; --bs-btn-hover-border-color: var(--sb-border-strong); --bs-btn-active-bg: #e2e8f0; --bs-btn-active-color: var(--sb-ink); }
.btn-outline-primary { --bs-btn-color: var(--sb-brand); --bs-btn-border-color: var(--sb-brand); --bs-btn-hover-bg: var(--sb-brand); --bs-btn-hover-border-color: var(--sb-brand); }
.btn-danger.light, .btn.light { background: var(--sb-danger-50); color: var(--sb-danger); border-color: transparent; }

/* ------------------------------------------------------------------ Badges (also maps Bootstrap 4 badge-* used in pages) */

.badge { font-weight: 600; font-size: 12px; padding: 5px 9px; border-radius: 6px; line-height: 1.2; }
a.badge, button.badge, span.badge[role="button"], .badge[onclick] { cursor: pointer; border: 0; text-decoration: none; }
.badge-primary, .badge.bg-primary   { background: var(--sb-brand-50) !important;   color: var(--sb-brand) !important; }
.badge-success, .badge.bg-success   { background: var(--sb-success-50) !important; color: var(--sb-success) !important; }
.badge-danger,  .badge.bg-danger    { background: var(--sb-danger-50) !important;  color: var(--sb-danger) !important; }
.badge-warning, .badge.bg-warning   { background: var(--sb-warning-50) !important; color: var(--sb-warning) !important; }
.badge-info,    .badge.bg-info      { background: var(--sb-info-50) !important;    color: var(--sb-info) !important; }
.badge-secondary, .badge.bg-secondary { background: #f1f5f9 !important; color: var(--sb-ink-2) !important; }
a.badge-success:hover, button.badge-success:hover { background: #d1fadf !important; }
a.badge-danger:hover, button.badge-danger:hover, span.badge-danger[role="button"]:hover { background: #fee2e2 !important; }
a.badge-primary:hover, button.badge-primary:hover { background: var(--sb-brand-100) !important; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; }
.status-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ------------------------------------------------------------------ Tables + DataTables */

.table-responsive { border-radius: var(--sb-radius-sm); }
.table { --bs-table-bg: transparent; margin-bottom: 0; color: var(--sb-ink); font-size: 13.5px; vertical-align: middle; }
.table > thead th, table.dataTable thead th {
  background: #f8fafc; color: var(--sb-ink-2);
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em;
  border-bottom: 1px solid var(--sb-border) !important; white-space: nowrap;
  padding: 11px 14px !important;
}
.table > tbody td { padding: 11px 14px; border-color: var(--sb-border); }
.table-bordered > :not(caption) > * > * { border-width: 0 0 1px 0; }
.table-bordered > :not(caption) > * { border-width: 0; }
.table > tbody tr:hover > td { background: #fafbfd; }
table.dataTable { border-collapse: collapse !important; width: 100% !important; }
table.dataTable.no-footer { border-bottom: 1px solid var(--sb-border) !important; }
.dataTables_wrapper { font-size: 13px; }
.dataTables_wrapper .dataTables_length, .dataTables_wrapper .dataTables_filter { margin-bottom: 14px; color: var(--sb-ink-2); }
.dataTables_wrapper .dataTables_filter input, .dataTables_wrapper .dataTables_length select {
  border: 1px solid var(--sb-border-strong); border-radius: var(--sb-radius-sm);
  padding: 6px 10px; min-height: 36px; margin-left: 6px; background: var(--sb-surface); outline: none;
}
.dataTables_wrapper .dataTables_filter input:focus { border-color: var(--sb-brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
.dataTables_wrapper .dataTables_info { color: var(--sb-ink-3); padding-top: 14px !important; }
.dataTables_wrapper .dataTables_paginate { padding-top: 10px !important; }
.dataTables_wrapper .dataTables_paginate .paginate_button {
  border: 1px solid var(--sb-border) !important; border-radius: 6px !important; margin-left: 4px !important;
  padding: 5px 11px !important; background: var(--sb-surface) !important; color: var(--sb-ink-2) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover { background: var(--sb-brand) !important; border-color: var(--sb-brand) !important; color: #fff !important; }
.dataTables_wrapper .dataTables_paginate .paginate_button:hover { background: #f1f5f9 !important; color: var(--sb-ink) !important; }
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled { opacity: .5; }
.dt-buttons { margin-bottom: 14px; display: inline-flex; gap: 6px; margin-right: 12px; }
.dt-buttons .dt-button, button.dt-button {
  background: var(--sb-surface) !important; border: 1px solid var(--sb-border-strong) !important; border-radius: var(--sb-radius-sm) !important;
  padding: 6px 12px !important; font-size: 13px !important; color: var(--sb-ink) !important; margin: 0 !important; box-shadow: none !important;
}
.dt-buttons .dt-button:hover { background: #f1f5f9 !important; }
.dataTables_scrollHead, .dataTables_scrollBody { border-color: var(--sb-border) !important; }

/* ------------------------------------------------------------------ Chosen (multi-select) */

.chosen-container { width: 100% !important; font-size: 14px; }
.chosen-container-multi .chosen-choices, .chosen-container-single .chosen-single {
  min-height: 40px; border: 1px solid var(--sb-border-strong) !important; border-radius: var(--sb-radius-sm) !important;
  background: var(--sb-surface) !important; box-shadow: none !important; padding: 4px 6px;
}
.chosen-container-active .chosen-choices { border-color: var(--sb-brand) !important; box-shadow: 0 0 0 3px rgba(37, 99, 235, .15) !important; }
.chosen-container-multi .chosen-choices li.search-choice {
  background: var(--sb-brand-50) !important; border: 1px solid var(--sb-brand-100) !important; color: var(--sb-brand-600);
  border-radius: 6px !important; box-shadow: none !important; padding: 4px 22px 4px 8px; margin: 3px 4px 3px 0;
}
.chosen-container .chosen-drop { border-color: var(--sb-border-strong); border-radius: 0 0 var(--sb-radius-sm) var(--sb-radius-sm); box-shadow: var(--sb-shadow-lg); }
.chosen-container .chosen-results li.highlighted { background: var(--sb-brand) !important; }

/* ------------------------------------------------------------------ Modals, alerts */

.modal-content { border: 0; border-radius: var(--sb-radius); box-shadow: var(--sb-shadow-lg); }
.modal-header { border-bottom: 1px solid var(--sb-border); padding: 16px 20px; }
.modal-title { font-size: 16px; font-weight: 600; }
.modal-body { padding: 20px; }
.modal-footer { border-top: 1px solid var(--sb-border); }

/* Flash messages render as a toast in the top-right corner. */
.login_hide_show, .app-toast { position: fixed; top: 76px; right: 24px; z-index: 1090; max-width: 420px; }
.login_hide_show .alert, .app-toast .alert {
  margin: 0; border: 1px solid; border-radius: var(--sb-radius); box-shadow: var(--sb-shadow-lg);
  padding: 12px 16px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start;
}
.login_hide_show .alert p, .app-toast .alert p { margin: 0; }
.alert-success { background: var(--sb-success-50) !important; border-color: #bbf7d0 !important; color: #166534 !important; }
.alert-danger { background: var(--sb-danger-50) !important; border-color: #fecaca !important; color: #991b1b !important; }
.alert-success strong, .alert-danger strong { color: inherit !important; }

/* ------------------------------------------------------------------ Misc */

.text-muted { color: var(--sb-ink-2) !important; }
.fw-semibold { font-weight: 600 !important; }
hr { border-color: var(--sb-border); opacity: 1; }
.list-group-item { border-color: var(--sb-border); }
.datepicker { border-radius: var(--sb-radius-sm); }
.datepicker table tr td.active, .datepicker table tr td.active:hover { background: var(--sb-brand) !important; }
.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; border: 1px solid var(--sb-border); }
.no-data-img { max-width: 160px; opacity: .8; }

/* Hide the old theme's loading overlay if a page still contains it. */
#preloader { display: none !important; }

/* ------------------------------------------------------------------ Auth pages */

.auth {
  min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr;
  background: var(--sb-surface);
}
.auth-aside {
  position: relative; overflow: hidden;
  background: linear-gradient(150deg, #1e3a8a 0%, #2563eb 55%, #3b82f6 100%);
  color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
}
.auth-aside::after {
  content: ''; position: absolute; right: -120px; bottom: -120px; width: 380px; height: 380px; border-radius: 50%;
  background: rgba(255, 255, 255, .08);
}
.auth-aside h2 { color: #fff; font-size: 30px; font-weight: 700; line-height: 1.25; max-width: 420px; }
.auth-aside p { color: rgba(255, 255, 255, .8); max-width: 420px; font-size: 15px; }
.auth-aside .auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: #fff; }
.auth-aside .auth-brand img { width: 40px; height: 40px; background: #fff; border-radius: 10px; padding: 4px; object-fit: contain; }
.auth-points { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 12px; position: relative; z-index: 1; }
.auth-points li { display: flex; gap: 10px; align-items: center; color: rgba(255, 255, 255, .92); }
.auth-points i { width: 28px; height: 28px; border-radius: 8px; background: rgba(255, 255, 255, .15); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--sb-bg); }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .card-body { padding: 32px; }
.auth-card h1 { font-size: 22px; font-weight: 700; margin: 0 0 4px; }
.auth-card .sub { color: var(--sb-ink-2); margin-bottom: 24px; }
.auth-card .btn-primary { width: 100%; min-height: 42px; }
.auth-foot { text-align: center; margin-top: 18px; color: var(--sb-ink-2); }
.auth-mobile-brand { display: none; align-items: center; gap: 10px; justify-content: center; margin-bottom: 20px; font-weight: 700; font-size: 18px; color: var(--sb-ink); }
.auth-mobile-brand img { width: 36px; height: 36px; object-fit: contain; }
.input-icon { position: relative; }
.input-icon .toggle-pass { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--sb-ink-3); padding: 6px 8px; }
.input-icon .form-control { padding-right: 40px; }
.auth .login_hide_show { top: 24px; }

@media (max-width: 991.98px) {
  .auth { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-mobile-brand { display: flex; }
}

/* Single centred message pages (thank you, payment result) */
.result-card { max-width: 520px; margin: 40px auto; text-align: center; }
.result-card .card-body { padding: 40px 32px; }
.result-icon { width: 64px; height: 64px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 28px; margin-bottom: 16px; }
.result-card h1 { font-size: 22px; margin-bottom: 8px; }
.result-card p { color: var(--sb-ink-2); }
.min-w-0 { min-width: 0; }

/* DataTables' own zebra / sorted-column shading clashes with the panel tables. */
table.dataTable tbody tr, table.dataTable.display tbody tr.odd, table.dataTable.display tbody tr.even,
table.dataTable.stripe tbody tr.odd { background-color: transparent !important; }
table.dataTable tbody tr > .sorting_1, table.dataTable.display tbody tr > .sorting_1,
table.dataTable.order-column tbody tr > .sorting_1 { background-color: transparent !important; box-shadow: none !important; }
table.dataTable tbody tr:hover > * { background-color: #fafbfd !important; box-shadow: none !important; }
table.dataTable thead .sorting, table.dataTable thead .sorting_asc, table.dataTable thead .sorting_desc { background-position: center right 6px; }
.form-check-input { border-color: #b6c0ce; width: 1.05em; height: 1.05em; margin-top: .2em; }
.img-placeholder { width: 44px; height: 44px; border-radius: 8px; background: #f1f5f9; color: var(--sb-ink-3); display: inline-flex; align-items: center; justify-content: center; }
.price-old { color: var(--sb-ink-3); text-decoration: line-through; font-size: 12px; display: block; }
table.dataTable thead th.sorting, table.dataTable thead th.sorting_asc, table.dataTable thead th.sorting_desc { padding-right: 26px !important; }

/* Client-side pagination (My Orders) */
.pagination-wrap { display: flex; justify-content: center; gap: 6px; margin-top: 24px; flex-wrap: wrap; }
.pagination-wrap button { min-width: 36px; height: 36px; border: 1px solid var(--sb-border); background: var(--sb-surface); border-radius: var(--sb-radius-sm); color: var(--sb-ink-2); font-size: 14px; }
.pagination-wrap button:hover:not(:disabled) { border-color: var(--sb-brand); color: var(--sb-brand); }
.pagination-wrap button.active { background: var(--sb-brand); border-color: var(--sb-brand); color: #fff; }
.pagination-wrap button:disabled { opacity: .5; }

/* Product image with icon fallback (product_thumb helper) */
.img-wrap { position: relative; display: inline-flex; flex: 0 0 auto; overflow: hidden; border-radius: 8px; }
.img-wrap img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #fff; }
.img-wrap .img-placeholder { width: 100%; height: 100%; }
.thumb { width: 44px; height: 44px; }
.thumb-sm { width: 32px; height: 32px; border-radius: 6px; font-size: 13px; }
.thumb-lg { width: 120px; height: 120px; border-radius: 12px; font-size: 32px; }
.img-placeholder.thumb, .img-placeholder.thumb-sm, .img-placeholder.thumb-lg { flex: 0 0 auto; }
.product-cell { display: flex; align-items: center; gap: 10px; }

/* Product list */
.thumb-md { width: 56px; height: 56px; border-radius: 10px; font-size: 18px; border: 1px solid var(--sb-border); }
.thumb-btn { padding: 0; border: 0; background: transparent; cursor: zoom-in; border-radius: 10px; flex: 0 0 auto; }
.thumb-btn:hover .img-wrap { box-shadow: 0 0 0 2px var(--sb-brand); }
.product-table td { vertical-align: middle; }
.product-table .product-cell { min-width: 240px; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 320px; font-size: 13px; }
.thumb-md img, .thumb-sm img { object-fit: contain !important; padding: 3px; }

/* Order link share box (Order Links page) */
.share-link { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.share-link code { background: var(--sb-brand-50); color: var(--sb-brand-600); padding: 5px 9px; border-radius: 6px; font-size: 12.5px; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.share-link .btn { white-space: nowrap; }

/* Icon action buttons (tables) */
.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--sb-radius-sm); border: 1px solid var(--sb-border); background: var(--sb-surface); color: var(--sb-ink-2); font-size: 14px; cursor: pointer; transition: background .15s, color .15s, border-color .15s; text-decoration: none; padding: 0; }
.btn-icon:hover { background: var(--sb-brand-50); color: var(--sb-brand); border-color: var(--sb-brand-100); }
.btn-icon.danger:hover { background: var(--sb-danger-50); color: var(--sb-danger); border-color: #fecaca; }
.btn-icon:disabled { opacity: .6; cursor: wait; }
.row-actions { display: inline-flex; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; }

/* All orders page */
.status-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.status-tab { border: 1px solid var(--sb-border); background: var(--sb-surface); color: var(--sb-ink-2); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer; }
.status-tab span { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: #f1f5f9; color: var(--sb-ink-2); font-size: 12px; text-align: center; }
.status-tab:hover { border-color: var(--sb-border-strong); color: var(--sb-ink); }
.status-tab.active { background: var(--sb-brand); border-color: var(--sb-brand); color: #fff; }
.status-tab.active span { background: rgba(255, 255, 255, .22); color: #fff; }
.orders-wrap .dt-top, .orders-wrap .dt-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 20px; }
.orders-wrap .dt-bottom { border-top: 1px solid var(--sb-border); }
.orders-wrap .dt-right { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.orders-wrap .dataTables_filter, .orders-wrap .dataTables_length, .orders-wrap .dt-buttons, .orders-wrap .dataTables_info { margin: 0 !important; }
.orders-wrap .dataTables_filter input { min-width: 240px; margin-left: 0 !important; }
.orders-table { min-width: 860px; }
.orders-table th { white-space: nowrap; }
.orders-table td, .orders-table th { padding: 12px 16px; vertical-align: middle; }
.orders-table th:first-child, .orders-table td:first-child { padding-left: 20px; }
.orders-table .addr { max-width: 260px; }
/* Actions column stays visible while the table scrolls sideways */
.orders-table .col-actions { position: sticky; right: 0; background: var(--sb-surface); z-index: 2; text-align: right; padding-right: 20px; box-shadow: -8px 0 8px -8px rgba(15, 23, 42, .12); }
.orders-table thead .col-actions { background: #f8fafc; }
.orders-table tbody tr:hover td, .orders-table tbody tr:hover .col-actions { background: #f8fafc; }
.status-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 0; cursor: pointer; }
.status-btn i { font-size: 10px; color: var(--sb-ink-3); }
.status-btn:hover .badge { filter: brightness(.96); box-shadow: 0 0 0 2px var(--sb-border); }
.status-choices { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.status-choice { display: flex; align-items: center; gap: 10px; border: 1px solid var(--sb-border); border-radius: var(--sb-radius-sm); padding: 10px 12px; cursor: pointer; margin: 0; }
.status-choice:has(input:checked) { border-color: var(--sb-brand); background: var(--sb-brand-50); }
.status-choice input { accent-color: var(--sb-brand); }
.table-total td { background: #f8fafc; }
@media (max-width: 575.98px) {
  .orders-wrap .dataTables_filter input { min-width: 0; width: 100%; }
  .orders-wrap .dt-right, .orders-wrap .dataTables_filter { width: 100%; }
}
.orders-table thead th:first-child { padding-left: 20px !important; }
