/* ═══════════════════════════════════════════════════════════
   OHTTEK — Page-specific styles
═══════════════════════════════════════════════════════════ */

/* ── Templates panel inputs — slider-track style ── */
.tmpl-left .fc {
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--border);
  border-radius: 0;
  padding: 5px 2px;
  transition: border-color .15s, box-shadow .15s;
}
.tmpl-left .fc:hover {
  border-bottom-color: var(--tx3);
}
.tmpl-left .fc:focus {
  border-bottom-color: var(--ac);
  box-shadow: 0 2px 0 0 var(--ac-bg);
  background: transparent;
}

/* ── Calendar ── */
#cal-grid { grid-template-columns: repeat(7, minmax(0, 1fr)) !important; }
.cal-hdr { font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--tx3); padding: 8px 4px; text-align: center; letter-spacing: .8px; min-width: 0; }
.cal-day { background: var(--s2); border: 1px solid var(--border); border-radius: 6px; min-height: 90px; padding: 6px; cursor: pointer; transition: border-color .12s; min-width: 0; overflow: hidden; }
.cal-day:hover { border-color: var(--border-l); }
.cal-day.today { border-color: var(--ac); }
.cal-day.cal-day-focused { box-shadow: 0 0 0 2px var(--ac), 0 0 24px var(--ac-glow); border-color: var(--ac); animation: cal-day-pulse 1.2s ease-out; }
@keyframes cal-day-pulse { 0% { transform: scale(1.04); } 100% { transform: scale(1); } }
.cal-day.other-month { opacity: .4; }
.cal-day.has-conflict { border-color: var(--red); }
.cal-day-num { font-size: 11px; font-weight: 600; color: var(--tx3); margin-bottom: 4px; }
.cal-day.today .cal-day-num { color: var(--ac); }
.cal-event { font-size: 10px; padding: 2px 5px; border-radius: 3px; margin-bottom: 2px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; color: var(--bg); }
.cal-event.is-job { opacity: 1; }
.cal-event.is-conflict { outline: 1px solid var(--red); }
.cal-event.is-continue { border-radius: 0 3px 3px 0; margin-left: -4px; padding-left: 4px; opacity: 0.85; }
.cal-event.is-end { border-radius: 3px 0 0 3px; }

@media (max-width: 768px) {
  #cal-grid { gap: 1px; }
  .cal-hdr { padding: 6px 1px; font-size: 9px; letter-spacing: .4px; }
  .cal-day { min-height: 68px; padding: 3px; border-radius: 4px; }
  .cal-day-num { font-size: 10px; margin-bottom: 2px; }
  .cal-event { font-size: 9px; padding: 1px 3px; margin-bottom: 1px; }
}

/* ── Notifications ── */
.notif-item { transition: background .1s; }
.notif-unread { background: rgba(255,255,255,.02); }

/* ── Bookkeeping ── */
.bk-tot td { font-weight: 700; border-top: 2px solid var(--border) !important; }

/* ── Expense bars ── */
.exp-bar-label { font-size: 11.5px; color: var(--tx2); width: 110px; flex-shrink: 0; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.exp-bar-track  { flex: 1; height: 6px; background: var(--s3); border-radius: 3px; overflow: hidden; }
.exp-bar-fill   { height: 100%; border-radius: 3px; transition: width .35s ease; }
.exp-bar-val    { font-size: 11.5px; font-family: var(--font-mono); color: var(--tx2); width: 60px; text-align: right; flex-shrink: 0; }

/* ── Quick-action strip ── */
.qa-strip { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; padding: 10px 14px; background: var(--s2); border: 1px solid var(--border); border-radius: var(--r); flex-wrap: wrap; }
.qa-btn { padding: 6px 12px; border-radius: var(--r); font-size: 12px; font-weight: 600; cursor: pointer; border: 1px solid var(--border); background: var(--s3); color: var(--tx2); transition: all .12s; }
.qa-btn:hover { background: var(--s4); color: var(--tx); border-color: var(--border-l); }
.qa-btn.ac { background: var(--ac-bg); color: var(--ac); border-color: rgba(255,255,255,.15); }
.qa-btn.ac:hover { background: var(--ac); color: var(--bg); }

/* ── Invoice preview ── */
.preview-wrap { background: var(--s1); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 12px; position: sticky; top: calc(var(--tb-h) + 14px); }
#ie-preview-pane { border-left: none; }
#inv-preview-frame { width: 100%; height: 820px; border: none; border-radius: var(--r); background: #e0e0e0; }

/* ── Template editor layout ── */
.tmpl-layout { display: flex; gap: 0; align-items: stretch; min-height: calc(100vh - 100px); }
.tmpl-left { width: 300px; min-width: 200px; max-width: 600px; flex-shrink: 0; overflow-y: auto; }
.tmpl-divider { width: 16px; flex-shrink: 0; cursor: col-resize; display: flex; align-items: center; justify-content: center; }
.tmpl-divider-grip { display: flex; flex-direction: column; gap: 3px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.tmpl-divider:hover .tmpl-divider-grip,
.tmpl-divider.dragging .tmpl-divider-grip { opacity: 1; }
.tmpl-divider-grip span { display: block; width: 3px; height: 3px; border-radius: 50%; background: var(--ac); }
.tmpl-right { flex: 1; min-width: 0; }

/* ── Tag pills ── */
.tag-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 4px; background: var(--ac-bg); border: 1px solid var(--border-l); font-size: 11px; font-weight: 600; color: var(--tx); white-space: nowrap; }
.tag-pill-remove { cursor: pointer; opacity: .5; font-size: 10px; border: none; background: none; color: inherit; padding: 0; line-height: 1; }
.tag-pill-remove:hover { opacity: 1; }

/* ── Contact type filter tabs ── */
.type-filter-tabs { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; min-width: 0; }
.type-filter-tab { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: var(--r); border: none; font-size: 12px; font-weight: 600; color: var(--tx3); background: var(--s2); cursor: pointer; transition: all .12s; white-space: nowrap; }
.type-filter-tab:hover { background: var(--s3); color: var(--tx); }
.type-filter-tab.is-active { background: var(--s4); color: var(--tx); }
.count-chip { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--s4); font-size: 10px; font-weight: 700; color: var(--tx3); font-family: var(--font-mono); }

/* ── Contact avatar ── */
.contact-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--s3); border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 11px; font-weight: 800; color: var(--tx3); flex-shrink: 0; }

/* ── Invoice totals box ── */
.totals-box { margin-left: auto; width: 240px; }
.tot-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.05); font-size: 13px; color: var(--tx2); }
.tot-grand { font-family: var(--font-display); font-size: 18px; font-weight: 800; color: var(--ac); border-top: 2px solid var(--ac); border-bottom: none; padding-top: 10px; margin-top: 4px; }

/* ── G-steps (Google settings) ── */
.g-step { background: var(--s2); border: 1px solid var(--border); border-radius: var(--r); padding: 14px; margin-bottom: 12px; }
.g-step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.g-step-num { width: 22px; height: 22px; border-radius: 50%; background: var(--ac); color: var(--bg); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.g-connected { background: rgba(52,211,153,.06); border-color: rgba(52,211,153,.25); }

/* ── Dashboard widget grid ── */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dash-widget { position: relative; }
.dash-widget[data-size="full"] { grid-column: 1 / -1; }
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } .dash-widget[data-size="full"] { grid-column: 1; } }

/* ── Dashboard edit mode ── */
.dash-edit .dash-widget .card {
  cursor: grab; outline: 2px dashed var(--border-l);
  outline-offset: -2px; transition: outline-color .12s, opacity .12s;
}
.dash-edit .dash-widget.drag-over .card { outline-color: var(--ac); opacity: .55; }
.dash-edit .dash-widget.dragging    .card { opacity: .35; }
.dash-widget-controls {
  display: none; position: absolute; top: 10px; right: 10px;
  gap: 4px; z-index: 10;
}
.dash-edit .dash-widget-controls { display: flex; }
.dash-ctrl-btn {
  width: 26px; height: 26px; border-radius: 6px;
  border: 1px solid var(--border-l); background: var(--s3);
  color: var(--tx2); font-size: 11px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .12s;
}
.dash-ctrl-btn:hover { background: var(--s4); color: var(--tx); }
.dash-ctrl-btn.danger:hover { background: var(--red-bg); color: var(--red); border-color: var(--red); }
.dash-drag-handle {
  display: none; position: absolute; top: 50%; left: 14px;
  transform: translateY(-50%); color: var(--tx3); font-size: 14px;
  cursor: grab; z-index: 10; pointer-events: none;
}
.dash-edit .dash-drag-handle { display: block; }
.dash-edit .card-title { padding-left: 26px; }

/* ── Widget size toggle ── */
.dash-size-half { grid-column: span 1; }
.dash-size-full { grid-column: 1 / -1; }

/* ── Add widget panel ── */
.dash-add-panel {
  grid-column: 1 / -1;
  background: var(--s2); border: 1px dashed var(--border-l);
  border-radius: var(--r-lg); padding: 18px;
}
.dash-add-panel-title { font-family: var(--font-display); font-size: 12px; font-weight: 700; color: var(--tx2); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; }
.dash-add-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.dash-add-card {
  background: var(--s3); border: 1px solid var(--border);
  border-radius: var(--r); padding: 12px 14px; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  transition: border-color .12s, background .12s;
}
.dash-add-card:hover { border-color: var(--ac); background: var(--s4); }
.dash-add-icon { width: 28px; height: 28px; border-radius: 6px; background: var(--ac-bg); color: var(--ac); display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; }
.dash-add-label { font-size: 12px; font-weight: 600; color: var(--tx); }
.dash-add-sub   { font-size: 10px; color: var(--tx3); margin-top: 1px; }

/* ── Revenue chart / chart containers ── */
.chart-container,
.revenue-chart,
#dwb-revenue-chart { min-height: 200px; }

/* ── Dashboard customize bar ── */
.dash-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.dash-toolbar-title { font-family: var(--font-display); font-size: 18px; font-weight: 800; color: var(--tx); flex: 1; }
