/* COLORJET ERP - Custom Styles */
:root {
  --navy: #1A237E;
  --navy-dark: #121858;
  --navy-light: #3949AB;
  --orange: #F57C00;
  --orange-light: #FFF3E0;
  --sky-blue: #E3F2FD;
  --card-shadow: 0 2px 12px rgba(26, 35, 126, 0.10);
  --sidebar-width: 260px;
  --top-nav-height: 60px;
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  background: #f5f6fa;
  color: #2c3e50;
  font-size: 14px;
}

/* ── Sidebar ─────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--navy);
  position: fixed;
  top: 0; left: 0;
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: transform 0.3s ease;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-header {
  padding: 20px 16px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 38px; height: 38px;
  background: var(--orange);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  font-size: 14px;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.brand-name {
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.5px;
}

.brand-sub {
  color: rgba(255,255,255,0.6);
  font-size: 11px;
}

.sidebar-user {
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

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

.user-name {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  color: rgba(255,255,255,0.6);
  font-size: 11px;
}

.sidebar-nav {
  list-style: none;
  margin: 0;
  padding: 8px 0;
  flex: 1;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 13.5px;
  transition: all 0.2s;
  border-radius: 0;
  white-space: nowrap;
}

.sidebar-nav .nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}

.sidebar-nav .nav-link.active {
  color: #fff;
  background: rgba(245,124,0,0.25);
  border-right: 3px solid var(--orange);
  font-weight: 600;
}

.sidebar-nav .nav-link i {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.text-danger-light { color: #ff6b6b !important; }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.4);
  font-size: 11px;
  text-align: center;
}

/* ── Sidebar Overlay (mobile) ───────────────────────────────────── */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1039;
  display: none;
}

.sidebar-overlay.show { display: block; }

/* ── Page Content ──────────────────────────────────────────────── */
#page-content-wrapper {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Top Navbar ────────────────────────────────────────────────── */
.top-navbar {
  height: var(--top-nav-height);
  background: #fff;
  border-bottom: 1px solid #e8edf2;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

/* ── Avatar ─────────────────────────────────────────────────────── */
.avatar-sm {
  width: 32px; height: 32px;
  background: var(--navy);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

/* ── Cards ──────────────────────────────────────────────────────── */
.card {
  border: none;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
}

.card-header {
  background: #fff;
  border-bottom: 1px solid #f0f0f5;
  border-radius: 12px 12px 0 0 !important;
  padding: 14px 20px;
  font-weight: 600;
}

/* ── Stat Cards ─────────────────────────────────────────────────── */
.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--card-shadow);
  border: 1px solid rgba(26,35,126,0.06);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26,35,126,0.15);
  color: inherit;
}

.stat-card .stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-card .stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
}

.stat-card .stat-label {
  font-size: 12px;
  color: #8a94a6;
  margin-top: 2px;
}

.stat-card .stat-change {
  font-size: 12px;
  margin-top: 6px;
}

/* Icon background colors */
.icon-navy { background: rgba(26,35,126,0.1); color: var(--navy); }
.icon-orange { background: rgba(245,124,0,0.1); color: var(--orange); }
.icon-success { background: rgba(40,167,69,0.1); color: #28a745; }
.icon-danger { background: rgba(220,53,69,0.1); color: #dc3545; }
.icon-info { background: rgba(23,162,184,0.1); color: #17a2b8; }
.icon-warning { background: rgba(255,193,7,0.1); color: #ffc107; }
.icon-purple { background: rgba(102,16,242,0.1); color: #6610f2; }
.icon-teal { background: rgba(32,201,151,0.1); color: #20c997; }

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn-navy {
  background: var(--navy);
  color: #fff;
  border: none;
}
.btn-navy:hover { background: var(--navy-dark); color: #fff; }
.btn-orange {
  background: var(--orange);
  color: #fff;
  border: none;
}
.btn-orange:hover { background: #e65100; color: #fff; }

/* ── Tables ──────────────────────────────────────────────────────── */
.table {
  font-size: 13.5px;
}

.table thead th {
  background: #f8f9fc;
  font-weight: 600;
  color: #5a6679;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid #e8edf2;
  padding: 10px 12px;
}

.table tbody td { padding: 10px 12px; vertical-align: middle; }
.table-hover tbody tr:hover { background: #f8f9fc; }

/* ── Forms ──────────────────────────────────────────────────────── */
.form-control, .form-select {
  border-radius: 8px;
  border-color: #d8dce6;
  font-size: 14px;
  padding: 8px 12px;
}

.form-control:focus, .form-select:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(26,35,126,0.1);
}

.form-label {
  font-size: 13px;
  font-weight: 500;
  color: #4a5568;
  margin-bottom: 4px;
}

/* ── Login Page ──────────────────────────────────────────────────── */
.login-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--navy) 0%, #3949AB 50%, #1E88E5 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.login-logo .brand-icon {
  width: 48px; height: 48px;
  font-size: 18px;
}

/* ── Daily Ledger ────────────────────────────────────────────────── */
.ledger-in { color: #28a745; font-weight: 600; }
.ledger-out { color: #dc3545; font-weight: 600; }
.ledger-balance { color: var(--navy); font-weight: 700; font-size: 16px; }

/* ── Agreement Preview ───────────────────────────────────────────── */
.agreement-preview {
  background: #fff;
  border: 1px solid #ddd;
  padding: 40px;
  font-size: 14px;
  line-height: 1.8;
  font-family: 'Times New Roman', serif;
}

.agreement-preview h2 {
  text-align: center;
  color: var(--navy);
  font-size: 20px;
  margin-bottom: 20px;
}

/* ── Print Styles ───────────────────────────────────────────────── */
@media print {
  .sidebar, .top-navbar, .no-print, .btn, nav { display: none !important; }
  #page-content-wrapper { margin-left: 0 !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}

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

/* ── Status Timeline ─────────────────────────────────────────────── */
.timeline { position: relative; padding-left: 20px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 6px; top: 0; bottom: 0;
  width: 2px;
  background: #e8edf2;
}
.timeline-item { position: relative; margin-bottom: 16px; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -18px;
  top: 4px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--navy);
  border: 2px solid #fff;
}

/* ── Progress Bars ────────────────────────────────────────────────── */
.progress { height: 8px; border-radius: 4px; }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.show {
    transform: translateX(0);
  }
  #page-content-wrapper {
    margin-left: 0 !important;
  }
}

/* ── Misc ────────────────────────────────────────────────────────── */
.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--orange);
  display: inline-block;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
}

.text-navy { color: var(--navy) !important; }
.text-orange { color: var(--orange) !important; }
.bg-navy { background: var(--navy) !important; }
.bg-navy-light { background: rgba(26,35,126,0.08); }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #8a94a6;
}
.empty-state i { font-size: 48px; margin-bottom: 12px; display: block; }

/* v1.1.0: original brand asset + service workflow */
.brand-image{width:42px;height:42px;object-fit:contain;border-radius:10px;background:#fff;padding:2px;flex:0 0 auto}
.ticket-action-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(132px,1fr));gap:.65rem}.ticket-action-grid form{margin:0}.ticket-action-grid .btn{width:100%;min-height:42px;font-size:.84rem}.service-photo-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(116px,1fr));gap:.75rem}.service-photo-grid a{display:block;border:1px solid #e2e8f0;border-radius:.65rem;overflow:hidden;background:#f8fafc}.service-photo-grid img{display:block;width:100%;height:104px;object-fit:cover}.service-photo-grid small{display:block;padding:.35rem;color:#475569}.signature-box{border:1px solid #cbd5e1;border-radius:.55rem;background:#fff;overflow:hidden}.signature-canvas{width:100%;height:160px;display:block;touch-action:none;cursor:crosshair}.print-brand-logo{width:54px;height:54px;object-fit:contain}.status-timeline{border-left:2px solid #cbd5e1;margin-left:.5rem;padding-left:1rem}.status-timeline .entry{position:relative;padding-bottom:.8rem}.status-timeline .entry:before{content:'';width:10px;height:10px;border-radius:50%;background:#0ea5e9;position:absolute;left:-1.36rem;top:.35rem}@media(max-width:575px){.ticket-action-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.page-header{gap:.5rem;align-items:flex-start}.page-header .d-flex{flex-wrap:wrap}.brand-image{width:36px;height:36px}}

/* v1.2 Business Command Center refinements */
.text-sky { color: #0284c7 !important; }
.section-title { display:flex; justify-content:space-between; align-items:center; gap:12px; margin:24px 0 12px; font-weight:700; color:#0f172a; font-size:15px; }
.section-title > span:first-child { position:relative; padding-left:12px; }
.section-title > span:first-child:before { content:""; position:absolute; left:0; top:3px; bottom:3px; width:4px; border-radius:5px; background:#0ea5e9; }
.section-title a { color:#0369a1; font-size:12px; text-decoration:none; font-weight:600; }
.dashboard-card, .command-card { min-height: 154px; position:relative; overflow:hidden; transition:transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.dashboard-card:hover, .command-card:hover { transform:translateY(-2px); box-shadow:0 10px 24px rgba(15,23,42,.09); border-color:#7dd3fc; }
.dashboard-card .stat-icon, .command-card .stat-icon { margin-bottom:12px; }
.dashboard-card .stat-value, .command-card .stat-value { font-size:clamp(18px, 2.2vw, 24px); letter-spacing:-.03em; word-break:break-word; }
.command-sync-banner { background:linear-gradient(90deg,#e0f2fe,#f8fafc); color:#0f172a; }
.business-switcher-item { display:flex; gap:12px; align-items:center; padding:14px; border:1px solid #bae6fd; border-radius:14px; background:#f0f9ff; }
.business-switcher-icon { width:42px; height:42px; border-radius:12px; display:grid; place-items:center; background:#0284c7; color:#fff; font-size:20px; }
.mini-kpi { min-height:76px; border:1px solid #e2e8f0; border-radius:12px; padding:10px; background:#fff; }
.mini-kpi span { display:block; color:#64748b; font-size:11px; margin-bottom:4px; }
.mini-kpi strong { display:block; color:#0f172a; font-size:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.empty-state { text-align:center; max-width:620px; margin:18px auto; padding:32px 18px; }
.empty-state > i { display:block; color:#0ea5e9; font-size:46px; margin-bottom:12px; }
.empty-state h3 { font-size:20px; margin:0 0 10px; color:#0f172a; }
.empty-state p { color:#64748b; margin:0 auto 10px; }
@media (max-width: 575.98px) {
  .page-header { align-items:flex-start; gap:12px; flex-direction:column; }
  .page-header .btn { width:100%; }
  .section-title { margin-top:18px; }
  .dashboard-card, .command-card { min-height:142px; padding:14px; }
  .stat-card .stat-value { font-size:18px !important; }
  .mini-kpi strong { font-size:12px; }
}
@media print {
  .sidebar, .topbar, .page-header .btn, form, .btn, .no-print, .command-sync-banner { display:none !important; }
  #page-content-wrapper, .container-fluid { margin:0 !important; padding:0 !important; width:100% !important; }
  .card, .stat-card { box-shadow:none !important; border:1px solid #cbd5e1 !important; break-inside:avoid; }
  .section-title { margin-top:14px; }
}


/* v1.4.0 — high-volume customer transaction tables */
.customer-control-table-wrap { max-height: calc(100vh - 270px); min-height: 360px; overflow: auto; }
.customer-control-table { min-width: 1260px; font-size: .82rem; }
.customer-control-table thead th { position: sticky; top: 0; z-index: 2; background: #f8fafc; white-space: nowrap; box-shadow: 0 1px 0 #e2e8f0; }
.customer-control-table tbody tr:hover { background: #f0f9ff; }
.max-cell-180 { max-width: 180px; }
.max-cell-260 { max-width: 260px; white-space: normal; }
@media (max-width: 575.98px) {
  .customer-control-table-wrap { max-height: none; min-height: 0; }
  .customer-control-table { font-size: .78rem; }
  .customer-control-table td, .customer-control-table th { padding: .55rem .5rem; }
}
