/* DG Fleet Manager — custom styles atop Tailwind
   Palette mirrors the Power Solutions logo:
     • Forest green   #0e4d24 / #176030 / #1f7a3a   — sidebar, headings
     • Lime green     #7ac143                        — success, accents
     • Orange         #f18e1e                        — primary CTAs, focus
*/

/* SIDEBAR -------------------------------------------------------------- */
aside {
  background: linear-gradient(180deg, #0a2914 0%, #06180c 100%);
  position: relative;
}
aside::after {
  content: "";
  position: absolute; top: 0; right: 0; bottom: 0; width: 1px;
  background: linear-gradient(180deg, rgba(122,193,67,.4), rgba(241,142,30,.2) 50%, transparent);
}

.nav-group {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(148,163,184,.72);
  padding: 14px 14px 5px;
}
.nav-group:first-child { padding-top: 4px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: rgb(203 213 225);
  cursor: pointer;
  transition: all .15s ease;
}
.nav-item:hover {
  background: rgba(122,193,67,.08);
  color: white;
}
.nav-item.active {
  background: linear-gradient(135deg, rgba(122,193,67,.22), rgba(241,142,30,.10));
  color: white;
  box-shadow: inset 0 0 0 1px rgba(122,193,67,.40),
              inset 3px 0 0 0 #f18e1e;
}
.nav-ico { font-size: 16px; }

/* Display face (Space Grotesk) for titles & numerals; tabular figures so
   numbers line up column-to-column in a data-heavy UI. */
#page-title { font-family: "Space Grotesk", Manrope, sans-serif; letter-spacing: -.01em; }

/* KPI CARDS ------------------------------------------------------------ */
.kpi-card {
  background: white;
  border: 1px solid #e6ebf0;
  border-radius: 12px;            /* less rounded than panels — deliberate variation */
  padding: 18px 20px 18px 22px;
  position: relative;
  overflow: hidden;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.kpi-card::before {                /* persistent thin spine, brightens on hover */
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, #7ac143, #1f7a3a);
  opacity: .35;
  transition: opacity .15s ease;
}
.kpi-card:hover { border-color: #c8e2cf; box-shadow: 0 8px 24px -8px rgba(14,77,36,.18); transform: translateY(-1px); }
.kpi-card:hover::before { opacity: 1; }

.kpi-label { font-size: 11px; font-weight: 600; color: rgb(100 116 139); text-transform: uppercase; letter-spacing: .06em; }
.kpi-value {
  font-family: "Space Grotesk", Manrope, sans-serif;
  font-variant-numeric: tabular-nums;
  font-size: 27px; font-weight: 600; color: rgb(14 77 36); margin-top: 7px; letter-spacing: -.02em;
}
.kpi-sub   { font-size: 12px; color: rgb(100 116 139); margin-top: 3px; }
.kpi-ico {
  position: absolute; top: 16px; right: 16px;
  width: 36px; height: 36px; border-radius: 9px;
  display: grid; place-items: center; font-size: 16px;
}

/* PANELS --------------------------------------------------------------- */
.panel {
  background: white;
  border: 1px solid #e6ebf0;
  border-radius: 14px;
  overflow: hidden;
}
.panel-h {
  padding: 15px 20px;
  border-bottom: 1px solid rgb(241 245 249);
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(180deg, #fafdfb 0%, white 100%);
}
.panel-h h3 { font-family: "Space Grotesk", Manrope, sans-serif; font-weight: 600; color: rgb(14 77 36); font-size: 15px; letter-spacing: -.01em; }
.panel-h p  { font-size: 12px; color: rgb(100 116 139); }

/* TABLES --------------------------------------------------------------- */
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl thead th {
  text-align: left; padding: 10px 14px;
  background: #f3f8f4;
  color: #0e4d24;
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700;
  border-bottom: 1px solid #d8e8dc;
}
table.tbl tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid rgb(241 245 249);
  color: rgb(30 41 59);
}
/* numeric columns get aligned, monospaced-width figures */
table.tbl td.text-right, table.tbl td.text-center,
table.tbl th.text-right, table.tbl th.text-center { font-variant-numeric: tabular-nums; }
table.tbl tbody tr:hover { background: #f7fbf8; }
table.tbl tbody tr.clickable { cursor: pointer; }

/* BADGES --------------------------------------------------------------- */
.badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
}
.badge-idle    { background: rgb(241 245 249); color: rgb(71 85 105); }
.badge-rented  { background: #e2f3c8; color: #346019; }      /* lime */
.badge-amc     { background: #cce6d2; color: #0e4d24; }      /* forest */
.badge-repair  { background: #fee2e2; color: rgb(153 27 27); }
.badge-sold    { background: #fce7f3; color: #9d174d; }      /* rose */
.badge-active  { background: #e2f3c8; color: #346019; }
.badge-closed  { background: rgb(241 245 249); color: rgb(71 85 105); }
.badge-expired { background: #fee2e2; color: rgb(153 27 27); }
.badge-warn    { background: #ffe6c5; color: #8a4708; }      /* orange */
.badge-sublease{ background: #ffd095; color: #5e3206; }      /* brand — hired-in / subleased */

/* th hover for sortable columns */
table.tbl thead th.cursor-pointer:hover {
  background: #eaf5ec;
  color: #0e4d24;
}

/* FORMS ---------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 600; color: rgb(71 85 105); }
.field input, .field select, .field textarea {
  padding: 10px 12px; border-radius: 8px; border: 1px solid rgb(203 213 225);
  font-size: 13.5px; background: white;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: #f18e1e;
  box-shadow: 0 0 0 3px rgba(241,142,30,.18);
}

#global-search:focus {
  outline: none; border-color: #f18e1e !important;
  box-shadow: 0 0 0 3px rgba(241,142,30,.18) !important;
}

/* BUTTONS -------------------------------------------------------------- */
.btn {
  padding: 8px 14px; border-radius: 8px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .12s ease; border: 1px solid transparent;
}
.btn-primary { background: #f18e1e; color: white; }
.btn-primary:hover { background: #d97713; }
.btn-ghost   { background: white; color: rgb(30 41 59); border-color: rgb(203 213 225); }
.btn-ghost:hover { background: #f7fbf8; border-color: #9fcfaa; }
.btn-danger  { background: #dc2626; color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* In dense list tables, the per-row Delete is QUIET by default (outlined, darker-red text that
   passes AA) and turns full-red only on hover/focus — so a column of solid-red buttons doesn't
   dominate the table or invite mis-clicks. The confirm dialog still guards the actual delete. */
table.tbl td .btn-danger.btn-sm {
  background: transparent; color: #b91c1c; border-color: #f1c6c6;
}
table.tbl td .btn-danger.btn-sm:hover,
table.tbl td .btn-danger.btn-sm:focus-visible {
  background: #dc2626; color: #fff; border-color: #dc2626;
}

/* Visible keyboard focus for mouse-invisible interactive elements (inputs already ring orange).
   Without this, keyboard users can't tell what's focused. */
.btn:focus-visible, #primary-action:focus-visible, #modal-save:focus-visible, .tab:focus-visible {
  outline: 2px solid #f18e1e; outline-offset: 2px;
}
table.tbl thead th.cursor-pointer:focus-visible { outline: 2px solid #f18e1e; outline-offset: -2px; }

/* Header primary action (Tailwind classes overridden) */
#primary-action {
  background: #f18e1e !important;
  box-shadow: 0 1px 0 rgba(0,0,0,.05), 0 4px 12px rgba(241,142,30,.30) !important;
}
#primary-action:hover { background: #d97713 !important; }

/* Modal save */
#modal-save {
  background: #f18e1e !important;
}
#modal-save:hover { background: #d97713 !important; }

.chip {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600; background: #eaf5ec; color: #0e4d24;
}

/* TABS (asset detail) ------------------------------------------------- */
.tabbar { display: flex; gap: 4px; border-bottom: 1px solid #e2e8f0; margin-bottom: 18px; }
.tab {
  padding: 9px 16px; font-size: 13px; font-weight: 600; color: #64748b;
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: all .12s ease; white-space: nowrap;
}
.tab:hover { color: #0e4d24; }
.tab.active { color: #0e4d24; border-bottom-color: #f18e1e; }

/* UPLOAD DROPZONE ----------------------------------------------------- */
.dropzone {
  border: 2px dashed #cbd5e1; border-radius: 14px; padding: 28px;
  text-align: center; cursor: pointer; transition: all .15s ease; background: #fafdfb;
}
.dropzone:hover, .dropzone.drag { border-color: #f18e1e; background: #fff8ef; }
.dropzone .dz-ico { font-size: 30px; }

/* DOCUMENT CARDS ------------------------------------------------------ */
.doc-card {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border: 1px solid #e2e8f0; border-radius: 12px; background: white;
  transition: all .12s ease;
}
.doc-card:hover { border-color: #9fcfaa; box-shadow: 0 4px 14px rgba(14,77,36,.06); }
.doc-thumb {
  width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center;
  font-size: 20px; shrink: 0; background: #f1f5f9;
}

/* doc-type badges */
.dt-purchase_invoice { background: #cce6d2; color: #0e4d24; }
.dt-purchase_order   { background: #e2f3c8; color: #346019; }
.dt-supplier_po      { background: #ffd095; color: #5e3206; }
.dt-service_report   { background: #dbeafe; color: #1e40af; }
.dt-expense_bill     { background: #ffe6c5; color: #8a4708; }
.dt-amc_document     { background: #ede9fe; color: #5b21b6; }
.dt-photo            { background: #fce7f3; color: #9d174d; }
.dt-other            { background: #f1f5f9; color: #475569; }

/* Section heading inside forms */
.form-section {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: #64748b; padding-bottom: 6px; border-bottom: 1px solid #f1f5f9; margin: 6px 0 2px;
}

/* Stat strip (financials) */
.stat-strip { display: grid; gap: 1px; background: #e2e8f0; border-radius: 14px; overflow: hidden; }
.stat-cell { background: white; padding: 16px 18px; }
.stat-cell .l { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: #64748b; }
.stat-cell .v { font-family: "Space Grotesk", Manrope, sans-serif; font-variant-numeric: tabular-nums; font-size: 22px; font-weight: 600; margin-top: 4px; letter-spacing: -.02em; }

/* SCROLLBAR ----------------------------------------------------------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c8e2cf; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #9fcfaa; }

