/* ================================================================
   Pacer Tracker - Modern UI Theme
   ================================================================
   CHANGE: This stylesheet provides the overall "sleek + modern" UI.
   WHY: Cleaner spacing, consistent controls, and dark surfaces across the app.
   IMPACT: Visual-only. No PHP/JS behavior changes.
   NOTE: Quote PDF styling is separate and unaffected.
   ================================================================ */

:root{
  /* CHANGE: Always-on dark theme */
  /* WHY: You prefer the darker backgrounds of all elements (not OS-dependent) */
  /* IMPACT: Global palette is dark by default; light mode is no longer the default */

  --bg: #585b61; /*#0b1220; */
  --surface: #0f172a;
  --surface-2: #111c33;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --border: rgba(148, 163, 184, 0.18);

  --primary: #60a5fa;
  --primary-hover: #3b82f6;
  --primary-soft: rgba(96, 165, 250, 0.18);

  --danger: #fb7185;
  --danger-soft: rgba(251, 113, 133, 0.18);

  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.18);

  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.18);

  --radius-sm: 10px;
  --radius: 14px;

  --shadow-sm: 0 8px 18px rgba(0,0,0,0.35);
  --shadow: 0 18px 50px rgba(0,0,0,0.45);

  --nav-height: 56px;
  --transition-fast: 0.15s ease;
  --transition: 0.22s ease;
}

@media (prefers-color-scheme: dark){
  :root{
    --bg: #0b1220;
    --surface: #0f172a;
    --surface-2: #111c33;
    --text: #e5e7eb;
    --muted: #94a3b8;
    --border: rgba(148, 163, 184, 0.18);

    --primary: #60a5fa;
    --primary-hover: #3b82f6;
    --primary-soft: rgba(96, 165, 250, 0.18);

    --danger: #fb7185;
    --danger-soft: rgba(251, 113, 133, 0.18);

    --success: #34d399;
    --success-soft: rgba(52, 211, 153, 0.18);

    --warning: #fbbf24;
    --warning-soft: rgba(251, 191, 36, 0.18);

    --shadow-sm: 0 8px 18px rgba(0,0,0,0.35);
    --shadow: 0 18px 50px rgba(0,0,0,0.45);
  }
}

/* Base reset */
*,
*::before,
*::after{ box-sizing: border-box; }

html,
body{ height: 100%; }

body{
  margin: 0;
  background: radial-gradient(1200px 500px at 10% -10%, rgba(37, 99, 235, 0.14), transparent 60%),
              radial-gradient(900px 420px at 100% 0%, rgba(245, 158, 11, 0.10), transparent 55%),
              var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a{ color: inherit; }

.container{ width: 100%; }

.app-shell{
  min-height: 100vh;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.page-main,
.page{
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Top nav */
.top-nav{
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  /* CHANGE: Dark nav surface by default */
  /* WHY: You want darker backgrounds for all elements */
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
}

.nav-left{
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 160px;
}

.brand{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-decoration: none;
}

.brand-badge{
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: radial-gradient(circle at 30% 30%, var(--primary), rgba(245, 158, 11, 0.9));
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.nav-toggle{
  display: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 12px;
  width: 40px;
  height: 40px;
  font-size: 18px;
  cursor: pointer;
}

.nav-links{
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-item{ position: relative; }

.nav-link,
.nav-parent-toggle{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid rgba(0,0,0,0);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: transform var(--transition-fast), background var(--transition-fast), border var(--transition-fast);
  white-space: nowrap;
}

.nav-link:hover,
.nav-parent-toggle:hover{
  transform: translateY(-1px);
  background: rgba(37, 99, 235, 0.10);
  border-color: rgba(37, 99, 235, 0.18);
}

.nav-link-active{
  background: var(--primary-soft);
  border-color: rgba(37, 99, 235, 0.22);
}

.nav-caret{ font-size: 0.9em; opacity: 0.75; }

.nav-submenu{
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 6px;
  z-index: 50;
}

/* Keeps hover alive while moving from parent item down into submenu */
.nav-submenu::before{
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -8px;      /* must match your gap size */
  height: 8px;    /* must match your gap size */
}


.nav-item.has-submenu:hover > .nav-submenu{ display: block; }
.nav-item.has-submenu.open > .nav-submenu{ display: block; }

.nav-sub-link{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
}

.nav-sub-link:hover{ background: rgba(37, 99, 235, 0.10); }

.nav-user{
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--muted);
}

/* Mobile nav */
@media (max-width: 900px){
  .nav-toggle{ display: inline-flex; align-items: center; justify-content: center; }
  .nav-links{
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 0 12px;
  }
  .nav-links.nav-links-open{ display: flex; }
  .top-nav{
    height: auto;
    flex-wrap: wrap;
    padding: 10px 12px;
  }

  .nav-submenu{
    position: static;
    min-width: unset;
    box-shadow: none;
    border-radius: 12px;
  }

  .nav-item.has-submenu:hover > .nav-submenu{ display: none; }
  .nav-item.has-submenu.open > .nav-submenu{ display: block; }
}

/* Panels / cards */
.panel,
.card,
.auth-card{
  /* CHANGE: Dark panels/cards by default */
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.panel{ padding: 16px; }

.panel-header{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.panel-header h1,
.panel-header h2{
  margin: 0;
  font-size: 1.25rem;
}

.card{ padding: 14px; }

.card-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

/* Auth */
.auth-wrapper{
  min-height: calc(100vh - 140px);
  display: grid;
  place-items: center;
  padding: 18px 0;
}

.auth-card{
  width: min(520px, 96vw);
  padding: 18px;
}

.auth-card h1{ margin: 0 0 12px; }

/* Buttons */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 9px 14px;
  font-size: 0.92rem;
  font-weight: 600;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.btn:hover{
  transform: translateY(-1px);
  background: rgba(37, 99, 235, 0.08);
}

.btn:disabled{
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-primary{
  background: var(--primary);
  border-color: rgba(37, 99, 235, 0.55);
  color: #fff;
}

.btn-primary:hover{ background: var(--primary-hover); }

.btn-secondary{ background: rgba(148, 163, 184, 0.14); }

.btn-danger{
  background: var(--danger-soft);
  border-color: rgba(220, 38, 38, 0.35);
  color: var(--text);
}

.btn-link{
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--primary);
}

/* Alerts */
.alert{
  border-radius: var(--radius);
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.14);
  margin-bottom: 12px;
}

.alert-success{
  background: var(--success-soft);
  border-color: rgba(22, 163, 74, 0.35);
}

.alert-danger{
  background: var(--danger-soft);
  border-color: rgba(220, 38, 38, 0.35);
}

.alert-warning{
  background: var(--warning-soft);
  border-color: rgba(245, 158, 11, 0.35);
}

/* Forms */
.form{
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-grid{
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.one{ grid-template-columns: 1fr; }
.form-grid.two{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.three{ grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 900px){
  .form-grid{ grid-template-columns: 1fr; }
}

.form-label{
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.92rem;
}

.form-label span{
  color: var(--muted);
  font-weight: 650;
  letter-spacing: 0.1px;
}

.form-label input,
.form-label select,
.form-label textarea{
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 10px 11px;
  font-size: 0.96rem;
  outline: none;
  transition: border var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.form-label textarea{
  min-height: 84px;
  resize: vertical;
}

textarea::placeholder{ color: rgba(100, 116, 139, 0.85); }

.form-label input:focus,
.form-label select:focus,
.form-label textarea:focus{
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.22);
}

.form-actions{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.help-text{
  color: var(--muted);
  font-size: 0.92rem;
  margin: 6px 0 0;
}

/* Tables */
.table-responsive{
  width: 100%;
  overflow-x: auto;
}

table{
  width: 100%;
  border-collapse: collapse;
}

.data-table,
.table,
.quote-table,
.items-table{
  width: 100%;
  border-collapse: collapse;
  /* CHANGE: Dark table surfaces by default */
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.data-table th,
.data-table td,
.table th,
.table td,
.quote-table th,
.quote-table td,
.items-table th,
.items-table td{
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.data-table th,
.table th,
.quote-table th,
.items-table th{
  text-align: left;
  font-size: 0.86rem;
  color: var(--muted);
  background: rgba(148, 163, 184, 0.10);
}

.data-table tr:hover td,
.table tr:hover td,
.quote-table tr:hover td,
.items-table tr:hover td{
  background: rgba(37, 99, 235, 0.08);
}

/* Utility */
.text-muted{ color: var(--muted) !important; }
.text-right{ text-align: right; }

.truncate{
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Quote blocks */
.quote-page{
  display: grid;
  gap: 14px;
}

.quote-box{
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  /* CHANGE: Dark quote box by default */
  background: rgba(15, 23, 42, 0.62);
}

@media (prefers-color-scheme: dark){
  .quote-box{ background: rgba(15,23,42,0.62); }
}

.markup-box{
  padding: 12px;
  border: 1px dashed rgba(148, 163, 184, 0.45);
  border-radius: var(--radius);
  background: rgba(148, 163, 184, 0.08);
}

@media (prefers-color-scheme: dark){
  .markup-box{ background: rgba(148, 163, 184, 0.08); }
}

.title{
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.header-grid{
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 900px){
  .header-grid{ grid-template-columns: 1fr; }
}

.right{ margin-left: auto; }

.no-border td{ border-bottom: none !important; }

.password-wrapper{ position: relative; }

.toggle-password-visibility{
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.12);
  color: var(--text);
  border-radius: 12px;
  padding: 6px 10px;
  cursor: pointer;
}

/* jQuery UI datepicker tweaks */
.ui-datepicker{
  border-radius: 14px !important;
  border: 1px solid var(--border) !important;
  background: var(--surface) !important;
  box-shadow: var(--shadow) !important;
  padding: 8px !important;
}

.ui-datepicker .ui-datepicker-header{
  border-radius: 12px !important;
  background: rgba(148, 163, 184, 0.10) !important;
  border: 1px solid var(--border) !important;
}

.ui-state-default,
.ui-widget-content .ui-state-default{
  background: rgba(148, 163, 184, 0.12) !important;
  border-radius: 10px !important;
  border-color: rgba(0,0,0,0) !important;
}

.ui-state-hover,
.ui-widget-content .ui-state-hover{
  background: rgba(37, 99, 235, 0.14) !important;
  border-color: rgba(37, 99, 235, 0.18) !important;
}

.ui-state-active,
.ui-widget-content .ui-state-active{
  background: rgba(37, 99, 235, 0.25) !important;
  border-color: rgba(37, 99, 235, 0.22) !important;
}

/* ==========================================================================
   Quotes new page (quotes_new.php) — page-scoped layout polish
   --------------------------------------------------------------------------
   CHANGE: Modern, dense quote builder layout (dark surfaces + better spacing).
   WHY: Removes the bulky print-style layout and aligns with the rest of the UI.
   IMPACT: Visual/layout only. Does not change field names/IDs or JS logic.
   ========================================================================== */

.quote-new-panel .quote-heading{
  margin: 0 0 10px;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  color: var(--text);
}

.quote-new-panel .quote-new-top{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.quote-new-panel .quote-company{
  flex: 1 1 520px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.55);
}

@media (max-width: 900px){
  .quote-new-panel .quote-company{
    grid-template-columns: 1fr;
  }
}

.quote-new-panel .markup-box{
  flex: 0 0 240px;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px dashed rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.55);
}

.quote-new-panel .markup-box-title{
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 8px;
}

.quote-new-panel .markup-box input{
  width: 100%;
}

.quote-new-panel .quote-title{
  margin-top: 4px;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(96, 165, 250, 0.10);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.quote-new-panel .quote-meta{
  margin-top: 2px;
}

.quote-new-panel .quote-items{
  display: grid;
  gap: 10px;
}

.quote-new-panel .quote-items-toolbar{
  display: flex;
  justify-content: flex-end;
}

.quote-new-panel .quote-items-table{
  max-height: 420px;
  overflow: auto;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.55);
}

.quote-new-panel .quote-items-table table{
  border: 0; /* we already add border on the scroll container */
  border-radius: 0;
}

.quote-new-panel .quote-items-table thead th{
  position: sticky;
  top: 0;
  z-index: 1;
}

.quote-new-panel .quote-table td{
  vertical-align: middle;
}

.quote-new-panel .quote-table input{
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 12px;
}

.quote-new-panel .quote-table input[readonly]{
  background: rgba(148, 163, 184, 0.10);
}

.quote-new-panel td.no-border{
  border-bottom: none !important;
  background: transparent !important;
}

.quote-new-panel .quote-table tfoot td{
  background: rgba(148, 163, 184, 0.10);
  font-weight: 800;
}

.quote-new-panel .quote-notes{
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  align-items: start;
}

@media (max-width: 900px){
  .quote-new-panel .quote-notes{
    grid-template-columns: 1fr;
  }
}

.quote-new-panel .quote-conditions,
.quote-new-panel .quote-regards{
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.55);
}

.quote-new-panel .quote-conditions p,
.quote-new-panel .quote-regards p{
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.quote-new-panel .quote-conditions strong,
.quote-new-panel .quote-regards strong{
  color: var(--text);
}

.quote-new-panel .quote-actions{
  justify-content: flex-end;
}


/* === Domain renewals marquee (dashboard) === */

.renewal-marquee {
  background: var(--danger);
  color: #fff;
  border-radius: 10px;
  padding: 6px 0;
  margin: 0 0 10px 0;
  overflow: hidden;
}

.renewal-marquee__inner {
  display: flex;
  width: max-content;
  animation: renewal-marquee-scroll 25s linear infinite;
}

.renewal-marquee__track {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding-left: 14px;
  white-space: nowrap;
}

.renewal-marquee__label {
  font-weight: 700;
  white-space: nowrap;
}

.renewal-marquee__link {
  color: inherit;
  text-decoration: underline;
}

.renewal-marquee__item {
  white-space: nowrap;
}

.renewal-marquee__sep {
  opacity: 0.85;
}

@keyframes renewal-marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); } /* works because we duplicate the track twice */
}

@media (prefers-reduced-motion: reduce) {
  .renewal-marquee__inner {
    animation: none;
  }
}

/* ==========================================================================
   Dashboard layout spacing (3-up row + full-width open jobs)
   ========================================================================== */

/* CHANGE: Make dashboard cards lay out as 3 across (responsive), with better spacing */
/* WHY: You want Approx profit + Tech time + Draft quotes on one line, then Open jobs on its own line */
/* IMPACT: Only affects dashboards using the .dashboard-grid--cards modifier class */

.dashboard-grid.dashboard-grid--cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

/* Full-width row for Open Jobs */
.dashboard-grid.dashboard-grid--cards .card--full {
  grid-column: 1 / -1;
}

/* Keep cards tight (avoid double spacing if your theme adds margins) */
.dashboard-grid.dashboard-grid--cards .card {
  margin: 0;
}

/* Responsive breakpoints */
@media (max-width: 1100px) {
  .dashboard-grid.dashboard-grid--cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .dashboard-grid.dashboard-grid--cards {
    grid-template-columns: 1fr;
  }
}

/* Optional: ensure the Open Jobs table area scrolls nicely if it grows */
.dashboard-card-scroll {
  max-height: 520px;
  overflow: auto;
}

/* ==========================================================================
   Small helpers used by dashboard markup
   ========================================================================== */

/* CHANGE: Dashboard uses text-right + text-muted in places */
.text-right{ text-align: right; }
.text-muted{ color: var(--text-muted); font-size: 0.8rem; }

/* CHANGE: Dashboard uses btn-xs + btn-danger but they weren’t defined in style.css */
.btn-xs{
  padding: 4px 10px;
  font-size: 0.75rem;
}

.btn-danger{
  background: var(--danger);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.btn-danger:hover{
  filter: brightness(0.95);
}

/* Optional: make active scope toggle visibly “on” */
.btn-secondary.active{
  background: rgba(76, 201, 240, 0.14);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
}

/* ==========================================================================
   Quick Job Drawer (Dashboard)
   ========================================================================== */

.qj-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: flex-end;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
  z-index: 9999;
}

.qj-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.qj-drawer {
  width: min(460px, 94vw);
  height: 100%;
  background: #05080e;
  color: var(--text);
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.35);
  transform: translateX(100%);
  transition: transform 240ms ease;
  overflow: auto;
  padding: 16px;
}

.qj-overlay.is-open .qj-drawer {
  transform: translateX(0);
}

.qj-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.qj-close {
  width: 42px;
  height: 36px;
  padding: 0;
  font-size: 1.2rem;
  line-height: 1;
}

.qj-body {
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.qj-timer {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.qj-display {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 2.2rem;
  letter-spacing: 0.06em;
  text-align: center;
  padding: 14px 12px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.qj-overlay.is-running .qj-display {
  animation: qjPulse 1.25s ease-in-out infinite;
}

@keyframes qjPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(76, 201, 240, 0.0); }
  50%      { box-shadow: 0 0 0 10px rgba(76, 201, 240, 0.18); }
}

.qj-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.qj-stop {
  background: linear-gradient(135deg, #f39c12, #e74c3c);
  border-color: rgba(0, 0, 0, 0.08);
}

.qj-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.qj-error {
  display: none;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(231, 76, 60, 0.10);
  border: 1px solid rgba(231, 76, 60, 0.25);
  font-size: 0.9rem;
}

.qj-error.is-visible {
  display: block;
}

/* ===== SARS Logbook Calendar (page-scoped) ===== */

.sars-logbook-panel .panel-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sars-logbook-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0 12px;
}

.sars-logbook-month-label {
  min-width: 180px;
  text-align: center;
  font-weight: 700;
}

.sars-logbook-dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  margin: 8px 0 10px;
}

.sars-logbook-dow div {
  font-size: 12px;
  opacity: 0.7;
  padding: 0 6px;
}

.sars-logbook-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}

.sars-logbook-cell {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  padding: 10px;
  min-height: 92px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
}

.sars-logbook-cell:hover {
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.sars-logbook-cell.is-muted {
  opacity: 0.35;
  cursor: default;
}

.sars-logbook-date-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sars-logbook-date-num {
  font-weight: 800;
}

.sars-logbook-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sars-logbook-badge {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.sars-logbook-badge.exp {
  background: rgba(34, 211, 238, 0.12);
  border-color: rgba(34, 211, 238, 0.22);
}

/* ===== Modal ===== */

.sars-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 9999;
}

.sars-modal {
  width: min(980px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: rgba(17, 24, 39, 0.98);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.40);
}

.sars-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sars-modal-header h2 {
  margin: 6px 0;
  font-size: 18px;
}

.sars-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 12px;
}

@media (max-width: 860px) {
  .sars-split { grid-template-columns: 1fr; }
}

.sars-panel {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  padding: 12px;
}

.sars-form-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

@media (max-width: 860px) {
  .sars-form-grid { grid-template-columns: 1fr 1fr; }
}

.sars-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.sars-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sars-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  padding: 10px;
}

.sars-item .meta {
  font-size: 12px;
  opacity: 0.75;
  margin-top: 4px;
}

.sars-hint {
  font-size: 12px;
  opacity: 0.75;
  margin-top: 8px;
}


/* ===== SARS Logbook Modal: Tabs (desktop + mobile) ===== */

.sars-modal-tabs {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.sars-modal-tabs .btn {
  flex: 1;
  justify-content: center;
}

/* panes are tab-switched */
.sars-pane { display: none; }
.sars-pane.is-active { display: block; }

/* cleaner forms on small screens */
@media (max-width: 860px) {
  .sars-form-grid { grid-template-columns: 1fr; }
  .sars-form-grid > * { grid-column: 1 / -1 !important; }
}

/* ===== Collapsible "Saved" sections ===== */
.sars-details {
  margin-top: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
  overflow: hidden;
}

.sars-details > summary {
  cursor: pointer;
  padding: 10px 12px;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sars-details > summary::-webkit-details-marker { display: none; }

.sars-pill {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.sars-pill.exp {
  background: rgba(34, 211, 238, 0.12);
  border-color: rgba(34, 211, 238, 0.22);
}
/* ===== Mobile modal fix: tabbed panes + full-width form fields ===== */

.sars-modal-tabs {
  display: none;
  gap: 10px;
  margin-top: 10px;
}

.sars-modal-tabs .btn {
  flex: 1;
  justify-content: center;
}

.sars-pane {
  /* default desktop: show both panes */
}

@media (max-width: 860px) {
  /* Turn split columns into single view */
  .sars-split {
    display: block;
  }

  /* Show tabs on mobile */
  .sars-modal-tabs {
    display: flex;
  }

  /* Hide panes unless active */
  .sars-pane {
    display: none;
  }
  .sars-pane.is-active {
    display: block;
  }

  /* Make ALL fields full width (prevents cramped/overlapping grid spans) */
  .sars-form-grid {
    grid-template-columns: 1fr;
  }
  .sars-form-grid > * {
    grid-column: 1 / -1 !important;
  }
}

/* Extra spacing so saved items never look like they’re sitting on top of inputs */
#travelForms .sars-panel {
  margin-bottom: 12px;
}
.sars-list h3 {
  margin-top: 14px;
}

/* ===========================
   SARS Logbook – FIX TABS
   Put this at the VERY BOTTOM of style.css
   =========================== */

.sars-modal-tabs{
  display: flex !important;
}

.status-badge {
  display:inline-block;
  padding:4px 8px;
  border-radius:999px;
  font-size:12px;
  font-weight:600;
  line-height:1;
}
.status-pending  { background:#fff3cd; color:#856404; }
.status-accepted { background:#d4edda; color:#155724; }
.status-rejected { background:#f8d7da; color:#721c24; }


/* Dashboard: alternate My Open Jobs row pairs */
.page-main > section.panel:last-of-type .data-table tbody > tr.job-main:nth-of-type(4n+1) > td,
.page-main > section.panel:last-of-type .data-table tbody > tr.job-main:nth-of-type(4n+1) + tr.job-desc > td {
  background: rgba(255, 255, 255, 0.05) !important;
}

.page-main > section.panel:last-of-type .data-table tbody > tr.job-main:nth-of-type(4n+3) > td,
.page-main > section.panel:last-of-type .data-table tbody > tr.job-main:nth-of-type(4n+3) + tr.job-desc > td {
  background: rgba(59, 130, 246, 0.28) !important;
}
.page-main > section.panel:last-of-type .data-table tbody > tr.job-main > td {
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* Optional styling for the nested Duplicati group inside the Tools dropdown */
.nav-sub-group {
  margin: 4px 0;
  padding: 4px 0 4px 8px;
  border-left: 1px solid rgba(148, 163, 184, 0.22);
}

.nav-sub-heading {
  padding: 8px 10px 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.nav-sub-link-nested {
  padding-left: 18px;
}
