:root {
  --green: #1D9E75; --green-dark: #0F6E56; --green-light: #E1F5EE;
  --bg: #f5f4f0; --bg2: #ffffff; --bg3: #efefeb;
  --text: #1a1a18; --text2: #6b6b67; --text3: #9c9a94;
  --border: rgba(0,0,0,0.1); --border2: rgba(0,0,0,0.18);
  --radius: 8px; --radius-lg: 12px;
  --red: #A32D2D; --red-light: #FCEBEB;
  --amber: #854F0B; --amber-light: #FAEEDA;
  --blue: #185FA5; --blue-light: #E6F1FB;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
.app { display: flex; height: 100vh; }

/* Sidebar */
.sidebar { width: 210px; flex-shrink: 0; background: var(--bg2); border-right: 0.5px solid var(--border); display: flex; flex-direction: column; overflow-y: auto; }
.logo { padding: 16px; font-size: 15px; font-weight: 600; border-bottom: 0.5px solid var(--border); }
.logo span { color: var(--green); }
.nav-section { font-size: 10px; color: var(--text3); padding: 10px 16px 3px; text-transform: uppercase; letter-spacing: .06em; }
.nav-item { display: flex; align-items: center; gap: 9px; padding: 8px 16px; font-size: 13px; color: var(--text2); cursor: pointer; border-left: 3px solid transparent; transition: all .12s; }
.nav-item:hover { background: var(--bg3); color: var(--text); }
.nav-item.active { background: var(--accent-light); color: var(--accent-dark); border-left-color: var(--accent); font-weight: 600; }
.nav-item svg { width: 14px; height: 14px; flex-shrink: 0; opacity: .7; }
.nav-item.active svg { opacity: 1; }

/* Quick actions */
.quick-actions { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 16px; }
.qa-btn { background: var(--bg2); border: 0.5px solid var(--border); border-radius: var(--radius-lg); padding: 14px 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; font-size: 11px; font-family: inherit; color: var(--text2); transition: all .15s; font-weight: 500; }
.qa-btn:hover { background: var(--accent-light); color: var(--accent-dark); border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.qa-btn:active { transform: translateY(0); }
.qa-btn svg { width: 20px; height: 20px; color: var(--accent); flex-shrink: 0; }
.sync-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-left: auto; }
.sync-dot.offline { background: var(--red); }

/* Main */
.main { flex: 1; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.topbar { background: var(--bg2); border-bottom: 0.5px solid var(--border); padding: 0 20px; height: 50px; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.topbar-title { font-size: 14px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.sync-status { font-size: 11px; color: var(--text3); }
.content { flex: 1; overflow-y: auto; padding: 20px; }
.page { display: none; } .page.active { display: block; }

/* Buttons */
.btn { padding: 6px 14px; font-size: 12px; border-radius: var(--radius); cursor: pointer; border: 0.5px solid var(--border2); background: transparent; color: var(--text); transition: all .12s; font-family: inherit; }
.btn:hover { background: var(--bg3); }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--green); color: #fff; border-color: var(--green); }
.btn-primary:hover { background: var(--green-dark); border-color: var(--green-dark); }
.btn-sm { padding: 4px 10px; font-size: 11px; }
.btn-danger { background: transparent; color: var(--red); border-color: var(--red); }
.btn-danger:hover { background: var(--red-light); }

/* Cards & Tables */
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; margin-bottom: 16px; }
.mc { background: var(--bg2); border: 0.5px solid var(--border); border-radius: var(--radius); padding: 14px; }
.ml { font-size: 11px; color: var(--text2); margin-bottom: 5px; }
.mv { font-size: 22px; font-weight: 600; }
.ms { font-size: 11px; color: var(--green); margin-top: 3px; }
.card { background: var(--bg2); border: 0.5px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 14px; }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; border-bottom: 0.5px solid var(--border); gap: 8px; flex-wrap: wrap; }
.card-title { font-size: 13px; font-weight: 600; white-space: nowrap; }
table { width: 100%; border-collapse: collapse; font-size: 12px; table-layout: fixed; }
th { text-align: left; padding: 9px 18px; font-size: 11px; font-weight: 600; color: var(--text2); border-bottom: 0.5px solid var(--border); background: var(--bg3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
td { padding: 9px 18px; border-bottom: 0.5px solid var(--border); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr.cr:hover td { background: var(--bg3); cursor: pointer; }
.empty-row td { text-align: center; color: var(--text3); padding: 24px; }

/* Badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 500; }
.b-green { background: #E1F5EE; color: #0F6E56; }
.b-amber { background: #FAEEDA; color: #854F0B; }
.b-red { background: #FCEBEB; color: #A32D2D; }
.b-gray { background: #F1EFE8; color: #5F5E5A; }
.b-blue { background: #E6F1FB; color: #185FA5; }

/* Forms */
.fcard { background: var(--bg2); border: 0.5px solid var(--border); border-radius: var(--radius-lg); padding: 20px; max-width: 680px; }
.fg { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ff { grid-column: 1/-1; }
.fgrp { display: flex; flex-direction: column; gap: 5px; }
.fl { font-size: 11px; font-weight: 600; color: var(--text2); }
.fi { padding: 8px 10px; font-size: 13px; border: 0.5px solid var(--border2); border-radius: var(--radius); background: var(--bg3); color: var(--text); font-family: inherit; }
.fi:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 2px rgba(29,158,117,.15); }
.fsect { margin-bottom: 18px; }
.fst { font-size: 13px; font-weight: 600; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 0.5px solid var(--border); }
.success-banner { background: var(--green-light); border: 0.5px solid #5DCAA5; border-radius: var(--radius); padding: 10px 14px; font-size: 12px; color: var(--green-dark); margin-bottom: 12px; display: none; }
.error-banner { background: var(--red-light); border: 0.5px solid #F09595; border-radius: var(--radius); padding: 10px 14px; font-size: 12px; color: var(--red); margin-bottom: 12px; display: none; }
.si { padding: 6px 10px; font-size: 12px; border: 0.5px solid var(--border2); border-radius: var(--radius); background: var(--bg3); color: var(--text); font-family: inherit; }

/* Detail view */
.back { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text2); cursor: pointer; margin-bottom: 14px; }
.back:hover { color: var(--text); }
.dg { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.dcard { background: var(--bg2); border: 0.5px solid var(--border); border-radius: var(--radius-lg); padding: 16px; }
.dcard-full { grid-column: 1/-1; }
.dst { font-size: 12px; font-weight: 600; color: var(--text2); margin-bottom: 10px; padding-bottom: 7px; border-bottom: 0.5px solid var(--border); }
.dr { display: flex; justify-content: space-between; padding: 4px 0; font-size: 12px; }
.dr span:first-child { color: var(--text2); }
.dr span:last-child { font-weight: 500; }
.av { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 600; flex-shrink: 0; }
.cav { display: flex; align-items: center; gap: 8px; }

/* Filter buttons */
.fb-row { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.filter-btn { padding: 4px 12px; font-size: 11px; border: 0.5px solid var(--border2); border-radius: 20px; cursor: pointer; background: transparent; color: var(--text2); font-family: inherit; transition: all .12s; }
.filter-btn.active { background: var(--green); color: #fff; border-color: var(--green); }
.svc-pill input { accent-color: var(--accent); }
.svc-pill.checked { background: var(--accent-light); border-color: var(--accent) !important; color: var(--accent-dark); font-weight: 500; }
table td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table td.wrap { white-space: normal; }

/* Progress */
.prog-bar { height: 5px; background: var(--bg3); border-radius: 3px; overflow: hidden; margin-top: 3px; }
.prog-fill { height: 100%; border-radius: 3px; background: var(--green); }

/* Packages */
/* ── Accent colour system ── */
:root {
  --accent: #1D9E75; --accent-dark: #0F6E56; --accent-light: #E1F5EE;
  --green: var(--accent); --green-dark: var(--accent-dark); --green-light: var(--accent-light);
}
body.dark-mode {
  --bg: #141414; --bg2: #1e1e1e; --bg3: #272727;
  --text: #e8e6e0; --text2: #9c9a92; --text3: #5a5955;
  --border: rgba(255,255,255,0.09); --border2: rgba(255,255,255,0.15);
  --red-light: #3a1a1a; --amber-light: #2e1f08; --blue-light: #0d1e35;
}
/* ── Packages ── */
.pkg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-bottom: 14px; }
.pkg-card { background: var(--bg2); border: 0.5px solid var(--border); border-radius: var(--radius-lg); padding: 16px; display: flex; flex-direction: column; gap: 0; }
.pkg-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 4px; }
.pkg-name { font-size: 14px; font-weight: 600; }
.pkg-price { font-size: 22px; font-weight: 600; color: var(--accent); margin-bottom: 4px; }
.pkg-dur { font-size: 11px; color: var(--text2); margin-bottom: 10px; }
.pkg-feats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 10px; margin-bottom: 10px; }
.pkg-feat-item { font-size: 11px; color: var(--text2); line-height: 1.55; display: flex; gap: 5px; }
.pkg-feat-item::before { content: "·"; color: var(--accent); flex-shrink: 0; }
.pkg-section-label { font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text3); margin: 8px 0 4px; grid-column: 1/-1; }
.pkg-badge { display: inline-block; padding: 2px 7px; border-radius: 20px; font-size: 10px; font-weight: 500; background: var(--accent-light); color: var(--accent-dark); margin: 2px 2px 0 0; }
.pkg-del-btn { background: none; border: none; cursor: pointer; color: var(--text3); font-size: 16px; padding: 0; line-height: 1; flex-shrink: 0; border-radius: 4px; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; }
.pkg-del-btn:hover { color: var(--red); background: var(--red-light); }
/* ── Settings colour swatches ── */
.swatch-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.swatch { width: 28px; height: 28px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: all .15s; }
.swatch.active, .swatch:hover { border-color: var(--text); transform: scale(1.1); }
.mode-toggle { display: flex; gap: 8px; }
.mode-btn { padding: 6px 16px; font-size: 12px; border-radius: var(--radius); cursor: pointer; border: 0.5px solid var(--border2); background: transparent; color: var(--text2); font-family: inherit; transition: all .12s; }
.mode-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Schedule / calendar */
.cal-day { min-height:52px; border-radius:6px; padding:4px; cursor:pointer; transition:background .1s; position:relative; font-size:11px; }
.cal-day:hover { background:var(--bg3); }
.cal-day.today { background:var(--accent-light); }
.cal-day.other-month { opacity:.35; }
.cal-day-num { font-size:11px; font-weight:500; color:var(--text2); }
.cal-day.today .cal-day-num { color:var(--accent-dark); font-weight:700; }
.cal-dot { width:6px; height:6px; border-radius:50%; margin:2px auto 0; }
.cal-shoot-pill { font-size:9px; padding:1px 4px; border-radius:3px; margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.recent-shoot-item { padding:10px 14px; border-bottom:0.5px solid var(--border); }
.recent-shoot-item:last-child { border-bottom:none; }
.quick-item { padding:10px 14px; border-bottom:0.5px solid var(--border); display:flex;gap:10px;align-items:center; }
.quick-item:last-child { border-bottom:none; }
.quick-date-box { width:36px;text-align:center;flex-shrink:0; }
.quick-date-day { font-size:18px;font-weight:700;line-height:1;color:var(--text); }
.quick-date-mon { font-size:9px;text-transform:uppercase;letter-spacing:.06em;color:var(--text3); }
/* Client sort active */
th.sort-active { color:var(--accent-dark); }

/* Notification bell + panel */
.notif-bell { position:relative; background:none; border:none; cursor:pointer; padding:6px; border-radius:var(--radius); color:var(--text2); transition:all .12s; display:flex; align-items:center; }
.notif-bell:hover { background:var(--bg3); color:var(--text); }
.notif-badge { position:absolute; top:2px; right:2px; width:16px; height:16px; border-radius:50%; background:var(--red); color:#fff; font-size:9px; font-weight:700; display:flex; align-items:center; justify-content:center; }
.notif-panel { position:fixed; top:50px; right:0; width:360px; height:calc(100vh - 50px); background:var(--bg2); border-left:0.5px solid var(--border); z-index:200; display:flex; flex-direction:column; box-shadow:-4px 0 20px rgba(0,0,0,.1); }
.notif-panel-header { padding:14px 16px; border-bottom:0.5px solid var(--border); display:flex; align-items:center; justify-content:space-between; flex-shrink:0; }
.notif-card { padding:12px 16px; border-bottom:0.5px solid var(--border); display:flex; gap:10px; align-items:flex-start; }
.notif-card:last-child { border-bottom:none; }
.notif-dot { width:10px; height:10px; border-radius:50%; flex-shrink:0; margin-top:3px; }
.notif-dot-red { background:var(--red); }
.notif-dot-amber { background:#F39C12; }
.notif-dot-green { background:var(--green); }
.notif-dot-blue { background:#185FA5; }
.notif-title { font-size:12px; font-weight:600; color:var(--text); margin-bottom:2px; }
.notif-body { font-size:11px; color:var(--text2); line-height:1.55; }
.notif-time { font-size:10px; color:var(--text3); margin-top:3px; }
.notif-dismiss { background:none; border:none; cursor:pointer; color:var(--text3); font-size:14px; padding:0; flex-shrink:0; line-height:1; }
.notif-dismiss:hover { color:var(--red); }
/* Company */
.company-card { background:var(--bg2); border:0.5px solid var(--border); border-radius:var(--radius-lg); padding:1.25rem; margin-bottom:10px; cursor:pointer; transition:border-color .12s; }
.company-card:hover { border-color:var(--accent); }
.company-name { font-size:14px; font-weight:600; color:var(--text); margin-bottom:3px; }
.company-meta { font-size:12px; color:var(--text2); }
.company-contacts { margin-top:10px; padding-top:10px; border-top:0.5px solid var(--border); }
/* Todo */
.todo-item { display:flex; align-items:center; gap:10px; padding:8px 0; border-bottom:0.5px solid var(--border); }
.todo-item:last-child { border-bottom:none; }
.todo-check { width:16px; height:16px; border-radius:4px; border:1.5px solid var(--border2); cursor:pointer; flex-shrink:0; display:flex; align-items:center; justify-content:center; transition:all .12s; background:transparent; }
.todo-check.done { background:var(--accent); border-color:var(--accent); }
.todo-text { flex:1; font-size:12px; color:var(--text); }
.todo-text.done { text-decoration:line-through; color:var(--text3); }
.todo-priority { width:6px; height:6px; border-radius:50%; flex-shrink:0; }
.todo-del { background:none; border:none; cursor:pointer; color:var(--text3); font-size:13px; padding:0; }
.todo-del:hover { color:var(--red); }
/* Dashboard 2-col layout */
.dash-bottom { display:grid; grid-template-columns:1fr 420px; gap:14px; margin-top:14px; align-items:start; }

/* Invoice */
.inv-layout { display: grid; grid-template-columns: 1fr 440px; gap: 16px; align-items: start; }
.inv-form-card { background: var(--bg2); border: 0.5px solid var(--border); border-radius: var(--radius-lg); padding: 14px; margin-bottom: 10px; }
.inv-prev-wrap { background: var(--bg3); border: 0.5px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; position: sticky; top: 0; }
.inv-ptop { padding: 8px 14px; border-bottom: 0.5px solid var(--border); display: flex; align-items: center; justify-content: space-between; background: var(--bg2); }
/* A4 paper preview: 210mm:297mm = 1:1.414. We render the invoice at 794px wide (screen A4)
   then scale it down to fit a 420px container => scale factor 420/794 = 0.529 */
.inv-preview-scaler {
  width: 794px;
  transform-origin: top left;
  transform: scale(0.529);
  background: #fff;
}
.inv-preview-outer {
  width: 420px;
  height: calc(420px * 1.414);
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,.1);
  margin: 14px auto 14px;
  border-radius: 2px;
}
#inv-preview { font-size: 11px; color: #1a1a1a; background: #fff; }
.li-row { display: grid; grid-template-columns: 1fr 50px 70px 22px; gap: 6px; align-items: center; margin-bottom: 6px; }
.rmv { background: none; border: none; cursor: pointer; color: var(--text2); font-size: 16px; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; border-radius: 4px; }
.rmv:hover { color: var(--red); background: var(--red-light); }

/* Loading overlay */
.loading { display: none; position: fixed; inset: 0; background: rgba(255,255,255,.8); align-items: center; justify-content: center; z-index: 100; flex-direction: column; gap: 12px; font-size: 13px; color: var(--text2); }
.loading.show { display: flex; }
.spinner { width: 28px; height: 28px; border: 2.5px solid var(--border); border-top-color: var(--green); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast */
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--text); color: #fff; padding: 10px 18px; border-radius: var(--radius); font-size: 13px; z-index: 200; opacity: 0; transition: opacity .25s; pointer-events: none; }
.toast.show { opacity: 1; }
.toast.error { background: var(--red); }

/* Code block */
.code-block { background: var(--bg3); border: 0.5px solid var(--border); border-radius: var(--radius); padding: 12px; font-family: monospace; font-size: 11px; line-height: 1.7; overflow-x: auto; white-space: pre; margin: 8px 0; }
.step-row { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; }
.step-num { width: 24px; height: 24px; border-radius: 50%; background: var(--green); color: #fff; font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 2px; }
.step-body .step-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.step-body p { font-size: 12px; color: var(--text2); line-height: 1.65; }
.callout { background: var(--bg3); border-left: 3px solid var(--green); border-radius: 0 var(--radius) var(--radius) 0; padding: 10px 14px; font-size: 12px; line-height: 1.65; margin: 8px 0; }
.warn-box { background: var(--amber-light); border: 0.5px solid #EF9F27; border-radius: var(--radius); padding: 10px 14px; font-size: 12px; color: var(--amber); line-height: 1.65; margin: 8px 0; }
