/**
 * The Autodok — Stylesheet
 */

/* ── Variables ─────────────────────────────────────────── */
:root {
  --sidebar-w: 200px;
  --sidebar-bg: #6b6b6b;
  --header-h: 60px;
  --page-bg: #f0f0f0;
  --welcome-grad-start: #6b6b6b;
  --welcome-grad-end: #000000;
  --avatar-bg: #555555;
  --theme-accent: #7a7a7a;
  --theme-accent-hover: #5a5a5a;
  --white: #ffffff;
  --text: #1a1a1a;
  --muted: #888888;
  --border: #e0e0e0;
  --radius: 12px;
  --shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

body.theme-prime {
  --sidebar-bg: #595959;
  --page-bg: #f7f4f5;
  --welcome-grad-start: #aa1a27;
  --welcome-grad-end: #aa1a27;
  --avatar-bg: #7f1320;
  --theme-accent: #aa1a27;
  --theme-accent-hover: #7f1320;
  --border: #e6d8db;
  background:
    radial-gradient(
      circle at 20% 20%,
      rgba(173, 25, 40, 0.28) 0%,
      rgba(173, 25, 40, 0.12) 22%,
      rgba(0, 0, 0, 0) 46%
    ),
    linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.96) 0%,
      rgba(22, 10, 12, 0.94) 15%,
      rgba(75, 10, 18, 0.9) 34%,
      rgba(124, 18, 30, 0.92) 52%,
      rgba(84, 11, 19, 0.88) 72%,
      rgba(0, 0, 0, 0.96) 100%
    );
  background-attachment: fixed;
  background-color: #111;
}

body.theme-prime .sidebar {
  background:
    radial-gradient(
      circle at 50% 12%,
      rgba(255, 255, 255, 0.08) 0%,
      rgba(255, 255, 255, 0) 28%
    ),
    linear-gradient(
      180deg,
      rgba(153, 27, 42, 0.98) 0%,
      rgba(123, 17, 33, 0.96) 20%,
      rgba(100, 13, 24, 0.95) 52%,
      rgba(70, 10, 18, 0.97) 100%
    );
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.06);
}

img,
svg,
video,
canvas {
  max-width: 100%;
  height: auto;
}

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

html,
body {
  height: 100%;
}

body {
  font-family:
    "Segoe UI",
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--page-bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ══════════════════════════════════════════════════════════
   LOGIN PAGE
══════════════════════════════════════════════════════════ */
body.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(
    ellipse at 20% 20%,
    #ffffff 0%,
    #c0c0c0 40%,
    #2a2a2a 100%
  );
}

body.login-body.theme-prime {
  background:
    radial-gradient(
      circle at 20% 30%,
      rgba(173, 25, 40, 0.38) 0%,
      rgba(173, 25, 40, 0.12) 20%,
      rgba(0, 0, 0, 0) 44%
    ),
    linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.96) 0%,
      rgba(22, 10, 12, 0.94) 15%,
      rgba(75, 10, 18, 0.9) 34%,
      rgba(124, 18, 30, 0.92) 52%,
      rgba(84, 11, 19, 0.88) 72%,
      rgba(0, 0, 0, 0.96) 100%
    );
  background-attachment: fixed;
}

.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 38px 36px 34px;
  width: 100%;
  max-width: 320px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #333;
  margin-bottom: 6px;
}

.input-wrap {
  display: flex;
  align-items: center;
  background: #f6f6f6;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  padding: 0 12px;
  margin-bottom: 16px;
  transition:
    border-color 0.2s,
    background 0.2s;
}

.input-wrap:focus-within {
  border-color: #888;
  background: #fafafa;
}

.input-wrap i {
  color: #aaa;
  font-size: 15px;
  margin-right: 9px;
  flex-shrink: 0;
}

.input-wrap input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  padding: 11px 0;
  font-size: 14px;
  color: #333;
}

.input-wrap input::placeholder {
  color: #c0c0c0;
}

.login-error {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff2f2;
  border: 1px solid #ffd0d0;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #cc0000;
}

.btn-signin {
  display: block;
  width: 100%;
  padding: 11px;
  background: #787878;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 6px;
  letter-spacing: 0.2px;
}

.btn-signin:hover {
  background: #555;
}

/* ══════════════════════════════════════════════════════════
   DASHBOARD LAYOUT
══════════════════════════════════════════════════════════ */
.dashboard-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ───────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-brand {
  padding: 0 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--header-h);
}

.sidebar-logo {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  object-fit: contain;
  /* Removed filter to show logo in original black color */
}

.sidebar-brand-text {
  flex: 1;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1;
}

.sidebar-brand-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.2px;
  line-height: 1.2;
}

.sidebar-brand-sub {
  font-size: 9.5px;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 3px;
  line-height: 1.2;
  letter-spacing: 0.1px;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 12px 4px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  flex-shrink: 0;
}

.user-badge .badge-icon {
  font-size: 15px;
  flex-shrink: 0;
}

.announcement-trigger {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s;
  padding: 0;
}

.announcement-trigger:hover {
  background: #f0f0f0;
}

.announcement-trigger i {
  font-size: 16px;
}

.bell-wrap {
  margin-left: auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  transition: background 0.2s;
}

.bell-wrap:hover {
  background: #f0f0f0;
}

.bell-wrap i {
  font-size: 17px;
  color: var(--text);
}

.bell-dot {
  position: absolute;
  top: 1px;
  right: 1px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: #e74c3c;
  border-radius: 999px;
  border: 2px solid #fff;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
}

/* ── Notification Dropdown ─────────────────────────────── */
.notification-dropdown {
  position: fixed;
  width: 360px;
  max-height: 480px;
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
  border: 1px solid #e5e5e5;
  z-index: 2000 !important;
  display: none;
  flex-direction: column;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.toast-container,
#toastContainer,
.toast,
.notification-dropdown {
  z-index: 2000 !important;
}

.toast-container,
#toastContainer {
  pointer-events: none;
}

.toast-container .toast,
#toastContainer .toast {
  pointer-events: auto;
}

.toast-close {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.9;
  padding: 0;
}

.toast-close:hover,
.toast-close:focus {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  opacity: 1;
  outline: none;
}

.notification-dropdown.expanded {
  max-height: 700px;
}

.notification-dropdown.show {
  display: flex;
}

/* Defensive fallback: when no modal is actively open (body.modal-open absent),
   ensure any stray modal-backdrop does not intercept pointer events or darken UI.
   This prevents orphaned backdrops from blocking interaction after toasts. */
body:not(.modal-open) .modal-backdrop {
  pointer-events: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

/* Ensure correct stacking order for Bootstrap modal/backdrop so modal content remains above the dim overlay.
   This prevents stray global z-index changes from placing the backdrop above the dialog. */
.modal-backdrop {
  z-index: 1040 !important;
}
.modal {
  z-index: 1050 !important;
}
.modal .modal-dialog {
  z-index: 1050 !important;
  pointer-events: auto;
}

/* Make JO subitem modal (picker) sit above the parent modal if stacked */
#joSubItemSelectModal,
#joTechPickerModal,
#addPaymentModal {
  z-index: 1060 !important;
}

/* Defensive: ensure backdrops that are not associated with a visible modal do not intercept clicks */
.modal-backdrop[style*="display: block"] {
  pointer-events: auto;
}

.notification-header {
  padding: 14px 16px;
  border-bottom: 1px solid #e5e5e5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
}

.notification-header h6 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.notification-header-actions {
  display: flex;
  gap: 6px;
}

.btn-close-dropdown {
  background: none;
  border: none;
  color: #888;
  font-size: 12px;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.2s,
    color 0.2s;
}

.btn-close-dropdown:hover {
  background: #f0f0f0;
  color: #333;
}

.btn-mark-all-read,
.btn-clear-all {
  background: none;
  border: none;
  color: #666;
  font-size: 11px;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 6px;
  transition:
    background 0.2s,
    color 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-mark-all-read:hover {
  background: #f0f0f0;
  color: var(--text);
}

.btn-clear-all {
  color: #999;
}

.btn-clear-all:hover {
  background: #ffe0e0;
  color: #c0392b;
}

.btn-mark-all-read i,
.btn-clear-all i {
  font-size: 13px;
}

.notification-list {
  flex: 1;
  overflow-y: auto;
  max-height: 360px;
}

.notification-dropdown.expanded .notification-list {
  max-height: 580px;
}

.notification-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #f5f5f5;
  transition: background 0.2s;
  cursor: pointer;
}

.notification-item:last-child {
  border-bottom: none;
}

.notification-item:hover {
  background: #fafafa;
}

.notification-item.unread {
  background: #f8f9fa;
}

.notification-item.unread:hover {
  background: #f0f2f5;
}

.notification-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
  color: #fff;
}

.notification-icon.account_update {
  background: #555;
}
.notification-icon.cash_advance {
  background: #666;
}
.notification-icon.job_assigned {
  background: #777;
}
.notification-icon.job_status {
  background: #888;
}
.notification-icon.payment {
  background: #444;
}
.notification-icon.staff_update {
  background: #333;
}
.notification-icon.system {
  background: #999;
}

.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
  line-height: 1.3;
}

.notification-message {
  font-size: 11px;
  color: #666;
  line-height: 1.4;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.notification-time {
  font-size: 10px;
  color: #999;
}

.notification-actions {
  display: flex;
  gap: 2px;
  align-items: flex-start;
}

.notification-actions .btn-view,
.notification-actions .btn-mark-read {
  background: none;
  border: none;
  color: #999;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  transition:
    background 0.2s,
    color 0.2s;
}

.notification-actions .btn-view:hover,
.notification-actions .btn-mark-read:hover {
  background: #e0e0e0;
  color: #333;
}

.notification-loading,
.notification-empty {
  padding: 40px 20px;
  text-align: center;
  color: #999;
  font-size: 12px;
}

.notification-empty i {
  font-size: 28px;
  display: block;
  margin-bottom: 8px;
  opacity: 0.4;
}

.notification-footer {
  padding: 10px 16px;
  border-top: 1px solid #e5e5e5;
  text-align: center;
  background: var(--white);
}

/* Pinned announcement entry in notification dropdown */
.notification-item.announcement-entry.pinned {
  border-left: 3px solid #000;
  background: #fff;
}
.notification-item.announcement-entry.pinned
  .notification-icon.announcement-pin {
  background: #000;
  color: #fff;
}
.notification-item.announcement-entry.pinned .notification-title {
  color: #000;
  font-weight: 600;
}
.notification-item.announcement-entry.pinned .notification-message {
  color: #666;
  font-size: 11px;
}

.btn-view-more {
  background: none;
  border: none;
  color: #666;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 6px;
  transition:
    background 0.2s,
    color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-view-more:hover {
  background: #f0f0f0;
  color: var(--text);
}

.btn-view-more i {
  font-size: 12px;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 13.5px;
  font-weight: 400;
  transition:
    background 0.15s,
    color 0.15s;
  cursor: pointer;
  white-space: nowrap;
}

.nav-item i {
  font-size: 15px;
  width: 18px;
  flex-shrink: 0;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.nav-item.active {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  font-weight: 600;
}

.sidebar-footer {
  flex-shrink: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding: 8px 0 16px;
}

.nav-item.logout {
  color: rgba(255, 255, 255, 0.8);
}

.nav-item.logout:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

/* ── Main content ──────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  width: calc(100% - var(--sidebar-w));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--page-bg);
}

/* ── Header bar ────────────────────────────────────────── */
.topbar {
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 28px 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 900;
  flex-shrink: 0;
}

.hamburger-btn {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text);
  cursor: pointer;
  padding: 8px;
  margin-right: 12px;
  border-radius: 6px;
  transition: background 0.2s;
}

.hamburger-btn:hover {
  background: #f0f0f0;
}

.hamburger-btn i {
  display: block;
}

.topbar-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
  padding-top: 2px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 8px;
  border-left: 1px solid var(--border);
}

.topbar-user-link {
  text-decoration: none;
  border-radius: 8px;
  padding-right: 6px;
  transition: background 0.2s;
}

.topbar-user-link:hover {
  background: rgba(0, 0, 0, 0.04);
}

.topbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--avatar-bg);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.topbar-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* ── Page body ─────────────────────────────────────────── */
.page-body {
  padding: 24px 28px 40px;
  flex: 1;
}

/* ── Welcome banner ────────────────────────────────────── */
.welcome-banner {
  background: linear-gradient(
    90deg,
    var(--welcome-grad-start) 0%,
    var(--welcome-grad-end) 100%
  );
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 20px;
  color: #fff;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.1px;
}

body.theme-prime .btn-dark,
body.theme-prime .btn-signin {
  background: var(--theme-accent);
  border-color: var(--theme-accent);
}

body.theme-prime .btn-dark:hover,
body.theme-prime .btn-signin:hover {
  background: var(--theme-accent-hover);
  border-color: var(--theme-accent-hover);
}

body.theme-prime .sidebar {
  background: #8f1e2f;
}

/* ── Quick nav ─────────────────────────────────────────── */
.quick-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.qnav-card {
  background: var(--white);
  border: 1px solid #e5e5e5;
  border-radius: var(--radius);
  padding: 18px 16px;
  display: flex;
  align-items: center;
  gap: 13px;
  box-shadow: none;
  color: var(--text);
  transition:
    transform 0.18s,
    border-color 0.18s;
}

.qnav-card:hover {
  transform: translateY(-2px);
  border-color: #d0d0d0;
  color: var(--text);
}

.qnav-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(90deg, #6b6b6b 0%, #000000 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  flex-shrink: 0;
}

/* Individual gradients for each quick nav card */
.qnav-card:nth-child(1) .qnav-icon {
  background: linear-gradient(90deg, #8a8a8a 0%, #4a4a4a 100%);
}

.qnav-card:nth-child(2) .qnav-icon {
  background: linear-gradient(90deg, #6b6b6b 0%, #2a2a2a 100%);
}

.qnav-card:nth-child(3) .qnav-icon {
  background: linear-gradient(90deg, #4a4a4a 0%, #1a1a1a 100%);
}

.qnav-card:nth-child(4) .qnav-icon {
  background: linear-gradient(90deg, #2a2a2a 0%, #000000 100%);
}

.qnav-label {
  font-size: 14px;
  font-weight: 500;
  flex: 1;
}

.qnav-arrow {
  color: #c0c0c0;
  font-size: 13px;
}

/* ── Income cards ──────────────────────────────────────── */
.income-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}

.income-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px 20px 20px;
  box-shadow: var(--shadow);
}

.income-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3px;
}

.income-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.income-chevron {
  color: #c0c0c0;
  font-size: 13px;
}

.income-sub {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}

.income-divider {
  border: none;
  border-top: 1px solid #eeeeee;
  margin-bottom: 14px;
}

.income-body {
  display: flex;
  align-items: center;
  gap: 14px;
}

.date-badge {
  background: #555;
  border-radius: 8px;
  padding: 8px 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 50px;
  color: #fff;
  flex-shrink: 0;
  line-height: 1;
}

.date-badge .db-top {
  font-size: 20px;
  font-weight: 700;
}

.date-badge .db-bot {
  font-size: 10px;
  opacity: 0.8;
  margin-top: 3px;
}

.income-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
  white-space: nowrap;
}

.income-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 20px;
  background: #ffe0e0;
  color: #c0392b;
  flex-shrink: 0;
}

/* ── Chart card ────────────────────────────────────────── */
.chart-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px 22px 20px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.chart-head-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.chart-head-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.chart-wrap {
  margin-top: 16px;
  height: 280px;
  position: relative;
}

/* ── Generic card ──────────────────────────────────────── */
.card {
  background: var(--white);
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-header {
  background: var(--white);
  border-bottom: 1px solid #f0f0f0;
  border-radius: var(--radius) var(--radius) 0 0 !important;
  padding: 14px 18px;
  font-weight: 600;
  font-size: 14px;
}

.card-body {
  padding: 18px;
}

/* ── Tables ────────────────────────────────────────────── */
.table-responsive {
  border-radius: 10px;
  overflow: hidden;
  width: 100%;
}

.table {
  margin-bottom: 0;
}

.table thead th {
  background: #f7f7f7;
  border-bottom: 2px solid #eeeeee;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.4px;
  color: #888;
  padding: 12px 14px;
}

.table tbody td {
  padding: 11px 14px;
  vertical-align: middle;
}

.table tbody tr:hover {
  background: #fafafa;
}

/* ── Buttons ───────────────────────────────────────────── */
.btn {
  border-radius: 8px;
  padding: 7px 16px;
  font-weight: 500;
  font-size: 13px;
  transition: all 0.18s;
}

/* Grayscale Button Theme */
.btn-primary {
  background: #2a2a2a;
  border-color: #2a2a2a;
  color: #fff;
}

.btn-primary:hover {
  background: #000;
  border-color: #000;
  color: #fff;
}

.btn-secondary {
  background: #888;
  border-color: #888;
  color: #fff;
}

.btn-secondary:hover {
  background: #666;
  border-color: #666;
  color: #fff;
}

.btn-success {
  background: #444;
  border-color: #444;
  color: #fff;
}

.btn-success:hover {
  background: #222;
  border-color: #222;
  color: #fff;
}

.btn-danger {
  background: #666;
  border-color: #666;
  color: #fff;
}

.btn-danger:hover {
  background: #444;
  border-color: #444;
  color: #fff;
}

.btn-warning {
  background: #aaa;
  border-color: #aaa;
  color: #333;
}

.btn-warning:hover {
  background: #888;
  border-color: #888;
  color: #fff;
}

.btn-info {
  background: #999;
  border-color: #999;
  color: #fff;
}

.btn-info:hover {
  background: #777;
  border-color: #777;
  color: #fff;
}

.btn-outline-primary {
  background: transparent;
  border: 1px solid #2a2a2a;
  color: #2a2a2a;
}

.btn-outline-primary:hover {
  background: #2a2a2a;
  border-color: #2a2a2a;
  color: #fff;
}

.btn-outline-warning {
  background: transparent;
  border: 1px solid #888;
  color: #888;
}

.btn-outline-warning:hover {
  background: #888;
  border-color: #888;
  color: #fff;
}

.btn-outline-danger {
  background: transparent;
  border: 1px solid #666;
  color: #666;
}

.btn-outline-danger:hover {
  background: #666;
  border-color: #666;
  color: #fff;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}

.btn-icon i {
  font-size: 13px;
}

.staff-action-group .btn {
  padding: 4px 8px;
  min-width: 34px;
}

.staff-action-group .btn:not(:last-child) {
  margin-right: 4px;
}

.action-dropdown .btn {
  min-width: 34px;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 8px !important;
}

.table-responsive.table-responsive-actions {
  overflow: visible;
}

.action-dropdown .action-menu-btn {
  min-width: 34px;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 8px !important;
  background: transparent;
  border: 1px solid #6c757d;
  color: #6c757d;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.action-dropdown .action-menu-btn:hover,
.action-dropdown .action-menu-btn:focus,
.action-dropdown .action-menu-btn.show {
  background: #6c757d;
  border-color: #6c757d;
  color: #fff;
  box-shadow: none;
}

.action-dropdown .action-menu-btn::after {
  display: none;
}

.action-dropdown .action-menu-btn i {
  font-size: 16px;
  line-height: 1;
}

.action-dropdown .dropdown-menu {
  min-width: 120px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  padding: 4px 0;
  z-index: 1100;
}

.action-dropdown-menu {
  min-width: 150px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  padding: 4px 0;
  z-index: 1100;
}

body > .action-dropdown-menu {
  position: fixed;
  margin: 0;
}

.action-dropdown .dropdown-item,
.action-dropdown-menu .dropdown-item {
  border-radius: 0;
  padding: 8px 14px;
  font-size: 13px;
}

.action-dropdown .dropdown-item i,
.action-dropdown-menu .dropdown-item i {
  width: 18px;
  text-align: center;
  margin-right: 8px;
  font-size: 14px;
}

/* ── Forms ─────────────────────────────────────────────── */
.form-control,
.form-select {
  border-radius: 8px;
  border: 1.5px solid #e0e0e0;
  padding: 8px 12px;
  font-size: 14px;
  background: #f9f9f9;
  transition:
    border-color 0.18s,
    background 0.18s;
}

.form-control:focus,
.form-select:focus {
  border-color: #888;
  background: #fff;
  box-shadow: none;
}

.input-group-text {
  border-radius: 8px 0 0 8px;
  background: #f5f5f5;
  border: 1.5px solid #e0e0e0;
  color: #888;
}

/* ── Status badges ─────────────────────────────────────── */
.badge {
  padding: 4px 9px;
  font-weight: 500;
  border-radius: 6px;
  font-size: 11px;
}

/* Grayscale Status Badges */
.status-pending {
  background: #e0e0e0;
  color: #333;
  border: 1px solid #bbb;
}
.status-in_progress {
  background: #888888;
  color: #fff;
  border: 1px solid #666;
}
.status-completed {
  background: #2a2a2a;
  color: #fff;
  border: 1px solid #000;
}
.status-cancelled {
  background: #f5f5f5;
  color: #666;
  border: 1px solid #ccc;
  text-decoration: line-through;
}

/* Payment Status Badges - Grayscale */
.bg-success {
  background: #2a2a2a !important;
  color: #fff !important;
}
.bg-warning {
  background: #c0c0c0 !important;
  color: #333 !important;
}
.bg-danger {
  background: #666666 !important;
  color: #fff !important;
}
.bg-info {
  background: #888888 !important;
  color: #fff !important;
}
.bg-primary {
  background: #444444 !important;
  color: #fff !important;
}
.bg-secondary {
  background: #999999 !important;
  color: #fff !important;
}

/* Statistics Card Icons - Grayscale Override */
.text-primary {
  color: #2a2a2a !important;
}
.text-success {
  color: #2a2a2a !important;
}
.text-warning {
  color: #666666 !important;
}
.text-danger {
  color: #888888 !important;
}

/* ── Alerts ────────────────────────────────────────────── */
.alert {
  border-radius: 10px;
  border: none;
  font-size: 13.5px;
}

/* ── Modals ────────────────────────────────────────────── */
.modal-content {
  border-radius: 14px;
  border: none;
}

.modal-header {
  border-bottom: 1px solid #f0f0f0;
  border-radius: 14px 14px 0 0;
}

.app-confirm-close {
  background: transparent;
  border: none;
  color: #777;
  font-size: 24px;
  line-height: 1;
  padding: 0;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.app-confirm-close:hover {
  background: #f3f3f3;
  color: #333;
}

.modal-footer {
  border-top: 1px solid #f0f0f0;
}

.toast-close {
  background: transparent;
  border: none;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0.85;
  padding: 0;
}

.toast-close:hover {
  background: rgba(255, 255, 255, 0.18);
  opacity: 1;
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 1100px) {
  .quick-nav {
    grid-template-columns: repeat(2, 1fr);
  }

  .page-body {
    padding: 20px;
  }

  .topbar-title {
    font-size: 18px;
  }
}

@media (max-width: 900px) {
  .income-grid {
    grid-template-columns: 1fr;
  }

  .welcome-banner {
    font-size: 20px;
    padding: 22px 24px;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: min(84vw, 320px);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 1000;
    max-height: 100dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 14px;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
  }
  .main-content {
    margin-left: 0;
    width: 100%;
  }
  .hamburger-btn {
    display: block;
  }
  .topbar {
    padding: 0 16px;
    gap: 8px;
  }

  .topbar-actions {
    gap: 4px;
  }
  .topbar-title {
    font-size: 17px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 48vw;
  }
  .topbar-name {
    display: none;
  }

  .topbar-user {
    border-left: none;
    padding-left: 0;
  }

  .topbar-avatar {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }
  .page-body {
    padding: 16px;
  }
  .quick-nav {
    grid-template-columns: repeat(2, 1fr);
  }
  .income-value {
    font-size: 22px;
  }

  .card-body,
  .card-header {
    padding-left: 14px;
    padding-right: 14px;
  }

  .welcome-banner {
    border-radius: 10px;
    font-size: 18px;
    padding: 18px;
  }

  .qnav-card {
    padding: 14px;
  }

  .qnav-icon {
    width: 38px;
    height: 38px;
    font-size: 16px;
  }

  .btn {
    min-height: 36px;
  }

  .btn-group,
  .btn-group-sm {
    flex-wrap: wrap;
    gap: 4px;
  }

  .form-control,
  .form-select {
    font-size: 13px;
    min-height: 36px;
  }

  .table thead th,
  .table tbody td {
    padding: 9px 10px;
    font-size: 12px;
    white-space: nowrap;
  }

  .table-responsive {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
  }

  .action-dropdown .action-menu-btn {
    min-height: 34px;
  }

  .table {
    min-width: 640px;
  }

  .modal-dialog {
    margin: 10px;
  }

  .modal-dialog.modal-xl,
  .modal-dialog.modal-lg,
  .modal-dialog.modal-md {
    max-width: calc(100% - 12px);
    margin: 6px;
  }

  .modal-body {
    padding: 12px;
  }

  .modal-footer {
    flex-wrap: wrap;
    gap: 8px;
  }

  .modal-footer .btn {
    width: 100%;
  }

  .notification-dropdown {
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    max-height: 70vh;
  }

  .notification-list {
    max-height: 52vh;
  }

  .page-body .d-flex.justify-content-between.align-items-center {
    flex-wrap: wrap;
    gap: 10px;
  }

  .page-body .d-flex.justify-content-between.align-items-center > * {
    width: 100%;
  }

  .page-body form.row.gx-2.gy-2.align-items-center .col-auto {
    width: 100%;
  }

  .page-body form.row.gx-2.gy-2.align-items-center .form-control,
  .page-body form.row.gx-2.gy-2.align-items-center .btn {
    width: 100%;
  }

  .sidebar::-webkit-scrollbar {
    width: 6px;
  }

  .sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.28);
    border-radius: 6px;
  }
}

@media (max-width: 576px) {
  :root {
    --header-h: 56px;
  }

  body {
    font-size: 13px;
  }

  .page-body {
    padding: 12px;
  }

  .quick-nav {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .chart-wrap {
    height: 220px;
  }

  .income-card {
    padding: 14px 14px 16px;
  }

  .income-value {
    font-size: 20px;
  }

  .date-badge {
    min-width: 44px;
    padding: 7px 9px;
  }

  .date-badge .db-top {
    font-size: 17px;
  }

  .modal-content {
    border-radius: 12px;
  }

  .login-card {
    max-width: 100%;
    padding: 28px 20px 24px;
    border-radius: 14px;
  }

  .login-shell {
    padding: 12px;
  }

  .customer-check-floating {
    top: 10px;
    left: 10px;
    width: calc(100vw - 20px);
  }

  .table thead th,
  .table tbody td {
    font-size: 11px;
    padding: 8px;
  }
}
