/* style.css - Established Slate / Emerald Design Tokens (Phase E implementation) */
:root {
  --bg-primary: #0f172a;       /* Slate 900 */
  --bg-secondary: #1e293b;     /* Slate 800 */
  --bg-tertiary: #334155;      /* Slate 700 */
  --border-color: #334155;     /* Slate 700 */
  --border-subtle: #475569;    /* Slate 600 */
  --text-primary: #f8fafc;     /* Slate 50 */
  --text-secondary: #94a3b8;   /* Slate 400 */
  --text-muted: #64748b;       /* Slate 500 */
  --accent-primary: #10b981;   /* Emerald 500 */
  --accent-hover: #059669;     /* Emerald 600 */
  --accent-secondary: #8b5cf6; /* Violet 500 */
  --danger-color: #ef4444;     /* Red 500 */
  --danger-hover: #dc2626;     /* Red 600 */
  --warning-color: #f59e0b;    /* Amber 500 */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
}
.app-layout {
  display: flex;
  min-height: 100vh;
}
/* Sidebar */
.sidebar {
  width: 260px;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  flex-shrink: 0;
}
.brand {
  margin-bottom: 16px;
  padding: 0 8px;
}
.brand-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #fff;
}
.brand-subtitle {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-secondary);
  font-weight: 600;
}
.sidebar-status-container {
  margin-bottom: 20px;
  padding: 0 8px;
}
.network-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}
.network-status-pill.online {
  border-color: rgba(16, 185, 129, 0.3);
  color: #a7f3d0;
}
.network-status-pill.offline {
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}
.status-indicator-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
}
.network-status-pill.online .status-indicator-dot {
  background: var(--accent-primary);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}
.network-status-pill.offline .status-indicator-dot {
  background: var(--danger-color);
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.15s ease;
}
.nav-item:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}
.nav-item.active {
  background-color: var(--accent-primary);
  color: #fff;
}
.nav-tag {
  margin-left: auto;
  font-size: 0.65rem;
  background: rgba(255, 255, 255, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
}
.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}
.version-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}
/* Main Content */
.main-content {
  flex: 1;
  padding: 32px 40px;
  overflow-y: auto;
  max-width: 1400px;
}
.app-view {
  display: none;
}
.app-view.active {
  display: block;
}
.view-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
}
.view-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
}
.view-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 4px;
}
/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.metric-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
}
.metric-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  font-weight: 600;
}
.metric-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  margin: 6px 0 2px;
}
.metric-footnote {
  font-size: 0.7rem;
  color: var(--text-muted);
}
/* Section Cards */
.section-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 28px;
}
.filter-card {
  padding: 20px 24px;
}
.section-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: #fff;
}
.section-description {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}
/* Dashboard Punch Status Wrapper */
.dashboard-punch-status-wrapper {
  margin-top: 6px;
  min-height: 48px;
}
.dash-punch-active {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dash-punch-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dash-punch-time {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-primary);
  font-size: 1.15rem;
}
.dash-punch-task {
  font-size: 0.9rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-punch-meta {
  font-size: 0.75rem;
}
.dash-punch-action {
  margin-top: 4px;
}
.dash-punch-idle-msg {
  font-size: 0.9rem;
  margin-top: 4px;
}
/* Timesheet Filter Grid */
.timesheet-filter-grid {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 1.2fr 1.5fr auto;
  gap: 16px;
  align-items: flex-end;
}
.filter-actions-group {
  display: flex;
  padding-bottom: 2px;
}
/* Focused Current Invoice */
.invoice-focused-card {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-top: 16px;
}
.focused-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 16px;
  margin-bottom: 20px;
}
.focused-invoice-number {
  font-family: var(--font-mono);
  font-size: 1.7rem;
  font-weight: 700;
  color: #fff;
  margin: 6px 0 2px;
}
.focused-client-title {
  color: var(--text-secondary);
  font-size: 1rem;
}
.focused-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.focused-item {
  display: flex;
  flex-direction: column;
}
.focused-item .label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.focused-item .val {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 4px;
}
.highlight-total {
  color: var(--accent-primary) !important;
  font-size: 1.3rem !important;
}
.focused-footer {
  display: flex;
  gap: 12px;
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
}
/* Tables */
.table-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.table-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.filter-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.table-responsive {
  overflow-x: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}
.data-table th {
  padding: 12px 14px;
  color: var(--text-secondary);
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.data-table td {
  padding: 14px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}
.data-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}
.row-active-invoice {
  background-color: rgba(16, 185, 129, 0.08) !important;
  border-left: 3px solid var(--accent-primary);
}
.row-void-invoice {
  opacity: 0.65;
}
.row-integrity-error {
  background-color: rgba(239, 68, 68, 0.08) !important;
  border-left: 3px solid var(--danger-color);
}
.ts-task-cell {
  max-width: 280px;
  word-wrap: break-word;
}
.actions-cell {
  display: flex;
  gap: 6px;
}
/* Punch Clock View Styling */
.punch-card-container {
  max-width: 760px;
  margin: 0 auto 28px;
}
.punch-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 14px;
}
.punch-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.punch-action-row {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}
.punch-active-container {
  max-width: 760px;
  margin: 0 auto 28px;
  background-color: var(--bg-tertiary);
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.punch-active-hero {
  text-align: center;
  padding: 28px 20px 24px;
  border-bottom: 1px solid var(--border-color);
}
.punch-badge-wrapper {
  margin-bottom: 14px;
}
.punch-timer-display {
  font-family: var(--font-mono);
  font-size: 3.8rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--accent-primary);
  text-shadow: 0 0 24px rgba(16, 185, 129, 0.35);
  line-height: 1.1;
}
.punch-started-subtext {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 10px;
}
.punch-active-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border-color);
}
.punch-meta-item {
  display: flex;
  flex-direction: column;
}
.punch-meta-item .label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}
.punch-meta-item .val {
  font-size: 1rem;
  color: var(--text-primary);
  margin-top: 2px;
}
.punch-active-task-box {
  padding: 18px 0;
  border-bottom: 1px solid var(--border-color);
}
.punch-active-task-box .label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}
.punch-active-task-box .val {
  font-size: 1.05rem;
  color: var(--text-primary);
  margin-top: 4px;
}
.punch-active-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
}
/* Pulsing dot animation for live session */
.pulsing-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #34d399;
  box-shadow: 0 0 8px #34d399;
  animation: pulse-dot 1.5s infinite ease-in-out;
  margin-right: 6px;
  vertical-align: middle;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.8); }
}
/* Badges */
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}
.badge-xs {
  font-size: 0.65rem;
  padding: 1px 5px;
}
.badge-status.badge-draft { background: #475569; color: #f1f5f9; }
.badge-status.badge-sent { background: #1e3a8a; color: #93c5fd; }
.badge-status.badge-paid { background: #064e3b; color: #6ee7b7; }
.badge-status.badge-overdue { background: #7f1d1d; color: #fca5a5; }
.badge-status.badge-void { background: #18181b; color: #a1a1aa; }
.badge-status.badge-active-punch { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }
.badge-project-active { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.badge-project-on-hold { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.badge-project-completed { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.badge-project-archived { background: rgba(100, 116, 139, 0.2); color: #94a3b8; }
/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}
.btn-primary { background: var(--accent-primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-secondary { background: var(--bg-tertiary); color: var(--text-primary); border-color: var(--border-subtle); }
.btn-secondary:hover:not(:disabled) { background: #475569; }
.btn-outline { background: transparent; color: var(--text-primary); border-color: var(--border-color); }
.btn-outline:hover:not(:disabled) { background: var(--bg-tertiary); }
.btn-danger { background: var(--danger-color); color: #fff; }
.btn-danger:hover:not(:disabled) { background: var(--danger-hover); }
.btn-success { background: var(--accent-primary); color: #fff; }
.btn-success:hover:not(:disabled) { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover:not(:disabled) { color: var(--text-primary); }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-xs { padding: 4px 8px; font-size: 0.75rem; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }
.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 4px;
}
.btn-icon:hover { color: var(--text-primary); }
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
/* Client Cards Grid */
.clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}
.client-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
}
.client-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}
.client-code-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-secondary);
  background: rgba(139, 92, 246, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
}
.client-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  margin-top: 4px;
}
.client-contact-subtext {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}
.client-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.client-invoicing-stat-box {
  display: flex;
  gap: 12px;
  background: var(--bg-tertiary);
  padding: 12px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}
.stat-pill {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.stat-num { font-size: 1.15rem; font-weight: 700; color: #fff; }
.stat-preview { font-size: 0.9rem; font-weight: 700; font-family: var(--font-mono); color: var(--accent-primary); }
.stat-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; }
.client-projects-section {
  flex: 1;
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
  margin-bottom: 16px;
}
.projects-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.projects-header h4 {
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.project-list {
  list-style: none;
}
.project-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.project-info {
  display: flex;
  align-items: center;
  gap: 6px;
}
.project-name-label {
  font-weight: 500;
  color: var(--text-primary);
}
.client-card-footer {
  display: flex;
  gap: 8px;
  border-top: 1px solid var(--border-color);
  padding-top: 14px;
}
/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(2px);
}
.modal-backdrop.active {
  display: flex;
}
.modal-dialog {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}
.modal-dialog-sm { max-width: 440px; }
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
}
.modal-title { font-size: 1.25rem; font-weight: 700; color: #fff; }
.modal-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
}
.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}
/* Forms */
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.required { color: var(--danger-color); }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 9px 12px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}
.form-input[readonly] {
  background-color: var(--bg-secondary);
  cursor: default;
  opacity: 0.8;
}
.preview-banner {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.form-hint { font-size: 0.75rem; color: var(--text-muted); }
/* Toasts */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2000;
}
.toast {
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: #fff;
  font-size: 0.85rem;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
  animation: slideIn 0.2s ease forwards;
}
.toast-success { border-left: 4px solid var(--accent-primary); }
.toast-error { border-left: 4px solid var(--danger-color); }
.toast-info { border-left: 4px solid var(--accent-secondary); }
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.fade-out {
  opacity: 0;
  transition: opacity 0.3s ease;
}
.font-mono { font-family: var(--font-mono); }
.font-bold { font-weight: 700; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--accent-primary) !important; }
.text-danger { color: var(--danger-color); }
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary);
}

/* ============================================================
   Phase F reconstruction: Profile Setup & Payment Methods
   ============================================================ */
.profile-span-2 { grid-column: 1 / -1; }
.profile-logo-layout { display: grid; grid-template-columns: minmax(180px, 260px) 1fr; gap: 24px; align-items: start; }
.profile-logo-preview-box { min-height: 160px; border: 1px dashed var(--border-subtle); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--bg-primary); }
.profile-logo-preview-box img { max-width: 100%; max-height: 150px; object-fit: contain; }
.profile-logo-controls { display: grid; gap: 14px; }
.profile-save-bar { display: flex; justify-content: flex-end; margin: 18px 0 28px; }
.profile-payment-section { margin-top: 10px; }
.payment-methods-list { display: grid; gap: 12px; margin-top: 18px; }
.payment-method-card { border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--bg-primary); padding: 16px; }
.payment-method-card.is-disabled { opacity: 0.7; }
.payment-method-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.payment-method-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.payment-method-title-row h4 { margin: 0; }
.payment-method-actions { display: flex; gap: 8px; }
.payment-instructions { margin-top: 8px; white-space: pre-wrap; }
.payment-check-row { display: flex; flex-wrap: wrap; gap: 22px; margin: 8px 0 18px; }
.payment-check-row label { display: inline-flex; align-items: center; gap: 8px; }
.compact-empty { padding: 22px 12px; }
@media (max-width: 800px) {
  .profile-logo-layout { grid-template-columns: 1fr; }
  .payment-method-main { flex-direction: column; }
}


/* Phase G reconstruction: Theme Designer */
.theme-layout-grid{display:grid;grid-template-columns:minmax(420px,1.15fr) minmax(360px,.85fr);gap:20px;align-items:start}.theme-side-stack{display:grid;gap:20px}.theme-colors-grid{display:grid;gap:10px;margin-top:16px}.theme-color-row{display:grid;grid-template-columns:1fr 190px;gap:14px;align-items:center;padding:9px 0;border-bottom:1px solid var(--border-color)}.theme-color-controls{display:grid;grid-template-columns:48px 1fr;gap:8px}.theme-color-controls input[type=color]{width:48px;height:38px;padding:2px;border:1px solid var(--border-color);border-radius:6px;background:var(--bg-primary)}.theme-hex-input{font-family:var(--font-mono)}.theme-invoice-preview{border:2px solid;padding:20px;min-height:250px;border-radius:4px;transition:.15s}.theme-preview-header{display:flex;justify-content:space-between;padding:14px;margin-bottom:24px}.theme-preview-lines{display:grid;gap:12px;margin:12px 0 28px}.theme-preview-lines span{height:8px;background:currentColor;opacity:.16;border-radius:4px}.theme-preview-lines span:nth-child(2){width:75%}.theme-preview-lines span:nth-child(3){width:55%}.theme-preview-total{margin-left:auto;width:max-content;padding:14px 18px;font-weight:700}.theme-json{min-height:110px;font-family:var(--font-mono);font-size:.78rem}.theme-note{font-size:.78rem;margin-top:10px}@media(max-width:1050px){.theme-layout-grid{grid-template-columns:1fr}}@media(max-width:650px){.theme-color-row{grid-template-columns:1fr}.theme-color-controls{grid-template-columns:48px 1fr}}

/* ============================================================
   Phase H — read-only invoice / timesheet preview + print
   ============================================================ */
#view-viewinvoice {
  --h-paper: #ffffff;
  --h-text: #111827;
  --h-secondary: #64748b;
  --h-accent: #10b981;
  --h-header: #f8fafc;
  --h-total-fill: #ecfdf5;
  --h-total-text: #065f46;
  --h-heading-font: var(--font-sans);
  --h-body-font: var(--font-sans);
}
.invoice-view-toolbar { position: sticky; top: 0; z-index: 10; background: var(--bg-primary); padding-bottom: 14px; }
.h-overflow-warning,.h-warning-box { border:1px solid #f59e0b; background:rgba(245,158,11,.12); color:var(--text-primary); padding:12px 16px; border-radius:8px; margin-bottom:16px; font-size:.85rem; }
.h-warning-box div { margin-top:4px; }
.h-document { display:flex; flex-direction:column; gap:28px; align-items:center; padding:8px 0 36px; }
.h-sheet { width:8.5in; background:var(--h-paper); color:var(--h-text); box-shadow:0 16px 45px rgba(0,0,0,.35); font-family:var(--h-body-font); }
.h-invoice-sheet { height:11in; overflow:hidden; }
.h-timesheet-sheet { min-height:11in; }
.h-sheet-inner { padding:.55in .58in; min-height:100%; }
.h-invoice-sheet .h-sheet-inner { height:11in; overflow:hidden; }
.h-invoice-header,.h-timesheet-header { display:flex; justify-content:space-between; gap:30px; border-bottom:3px solid var(--h-accent); padding-bottom:22px; margin-bottom:24px; }
.h-brand-block { display:flex; gap:16px; align-items:flex-start; }
.h-logo { max-width:90px; max-height:62px; object-fit:contain; }
.h-business-name { font:700 22px/1.15 var(--h-heading-font); margin-bottom:6px; }
.h-title-block { text-align:right; }
.h-invoice-title { font:700 32px/1 var(--h-heading-font); letter-spacing:.09em; color:var(--h-accent); }
.h-invoice-number { font:700 15px/1.4 ui-monospace,SFMono-Regular,Menlo,monospace; margin-top:8px; }
.h-status { display:inline-block; margin-top:8px; padding:4px 9px; border:1px solid var(--h-accent); border-radius:999px; font-size:10px; text-transform:uppercase; letter-spacing:.08em; }
.h-secondary,.h-muted { color:var(--h-secondary); font-size:11px; line-height:1.45; }
.h-meta-grid { display:grid; grid-template-columns:1fr 1.2fr; gap:22px; margin-bottom:24px; }
.h-panel { border:1px solid color-mix(in srgb, var(--h-accent) 30%, #cbd5e1); padding:16px; }
.h-kicker { color:var(--h-accent); font-weight:700; font-size:9px; letter-spacing:.16em; margin-bottom:7px; }
.h-address { margin-top:6px; }
.h-meta-panel { display:grid; grid-template-columns:1fr 1fr; gap:10px 18px; }
.h-meta-panel div { display:flex; flex-direction:column; gap:2px; }
.h-meta-panel span { color:var(--h-secondary); font-size:9px; text-transform:uppercase; letter-spacing:.08em; }
.h-meta-panel strong { font-size:11px; }
.h-summary-table,.h-time-table { width:100%; border-collapse:collapse; }
.h-summary-table { margin:6px 0 18px; }
.h-summary-table th,.h-time-table th { background:var(--h-header); color:var(--h-text); text-align:left; font-size:9px; text-transform:uppercase; letter-spacing:.08em; padding:9px 8px; border-bottom:2px solid var(--h-accent); }
.h-summary-table td { padding:14px 8px; border-bottom:1px solid #dbe2ea; font-size:11px; }
.h-num { text-align:right !important; white-space:nowrap; }
.h-totals-wrap { display:grid; grid-template-columns:1fr 260px; margin:10px 0 20px; }
.h-totals > div { display:flex; justify-content:space-between; gap:20px; padding:5px 10px; font-size:11px; }
.h-grand-total { background:var(--h-total-fill); color:var(--h-total-text); font-size:15px !important; padding:11px 10px !important; margin-top:5px; }
.h-notes { border-top:1px solid #dbe2ea; padding-top:12px; margin-top:12px; font-size:10px; line-height:1.45; }
.h-bottom-grid { display:grid; grid-template-columns:1.35fr 1fr; gap:24px; margin-top:22px; align-items:end; }
.h-payment-method { display:flex; gap:9px; align-items:flex-start; margin:7px 0; font-size:10px; line-height:1.35; }
.h-payment-method a { color:var(--h-accent); word-break:break-all; }
.h-payment-qr { width:46px; height:46px; object-fit:contain; }
.h-footer-note { text-align:right; color:var(--h-secondary); font-size:10px; line-height:1.4; }
.h-timesheet-header h2 { font:700 28px/1.1 var(--h-heading-font); margin:3px 0; }
.h-timesheet-project { font-size:12px; font-weight:700; color:var(--h-accent); align-self:end; }
.h-time-table th { padding:8px 5px; font-size:8px; }
.h-time-table td { padding:8px 5px; border-bottom:1px solid #e2e8f0; font-size:8.5px; vertical-align:top; }
.h-time-table td:nth-child(2) { max-width:210px; }
.h-row-warning { background:rgba(245,158,11,.08); }
.h-empty-cell { text-align:center; color:var(--h-secondary); padding:30px !important; }
.h-timesheet-footer { display:flex; justify-content:space-between; border-top:2px solid var(--h-accent); margin-top:18px; padding-top:12px; font-size:10px; }

@media (max-width: 1100px) {
  .h-document { align-items:flex-start; overflow-x:auto; }
}

@page { size: Letter portrait; margin: 0; }
@media print {
  body { background:#fff !important; }
  body * { visibility:hidden !important; }
  #invoice-print-document, #invoice-print-document * { visibility:visible !important; }
  #invoice-print-document { position:absolute; left:0; top:0; width:8.5in; margin:0; padding:0; display:block; }
  .sidebar,.invoice-view-toolbar,.h-warning-box,.h-overflow-warning,#toast-container { display:none !important; }
  .main-content { margin:0 !important; padding:0 !important; width:auto !important; }
  .h-document { gap:0; padding:0; display:block; }
  .h-sheet { width:8.5in; box-shadow:none; margin:0; break-after:page; page-break-after:always; }
  .h-invoice-sheet { height:11in; min-height:11in; max-height:11in; overflow:hidden; }
  .h-timesheet-sheet { min-height:11in; height:auto; break-after:auto; page-break-after:auto; }
  .h-time-table thead { display:table-header-group; }
  .h-time-table tr { break-inside:avoid; page-break-inside:avoid; }
  a { color:inherit !important; text-decoration:none !important; }
}


/* Phase I2 Sync Foundation */
.sync-settings-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin-top:16px; }
.sync-span-2 { grid-column:1 / -1; }
.sync-token-row { display:flex; gap:8px; align-items:center; }
.sync-token-row .form-input { flex:1; }
.sync-enable-group { justify-content:flex-end; }
.sync-runtime-row { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-top:16px; padding:12px; background:var(--bg-tertiary); border-radius:var(--radius-md); font-size:.82rem; }
.sync-actions { margin-top:16px; justify-content:flex-end; }
.sync-security-note { margin-top:12px; }
@media (max-width:800px) { .sync-settings-grid,.sync-runtime-row { grid-template-columns:1fr; } .sync-span-2 { grid-column:auto; } }

/* Phase I7 Manual Sync + Conflict Center */
.sync-attention-panel { margin-top:16px; padding:14px; border:1px solid #f59e0b; border-radius:var(--radius-md); background:rgba(245,158,11,.08); }
.sync-attention-list { display:flex; flex-direction:column; gap:10px; margin-top:10px; }
.sync-attention-item { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:14px; align-items:center; padding:12px; border:1px solid var(--border-color); border-radius:var(--radius-md); background:var(--bg-tertiary); }
.sync-attention-title { font-weight:700; }
.sync-attention-meta { margin-top:4px; color:var(--text-muted); font-size:.78rem; word-break:break-word; }
.sync-attention-actions { display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
@media (max-width:800px) { .sync-attention-item { grid-template-columns:1fr; } .sync-attention-actions { justify-content:flex-start; } }


/* ============================================================
   Detailed Typography Designer upgrade — independent text roles
   ============================================================ */
:root{
  --typo-workspaceBody-family:var(--font-sans);--typo-workspaceBody-size:16px;--typo-workspaceBody-weight:400;--typo-workspaceBody-style:normal;--typo-workspaceBody-spacing:0em;--typo-workspaceBody-line:1.5;--typo-workspaceBody-transform:none;
  --typo-workspaceHeadings-family:var(--font-sans);--typo-workspaceHeadings-size:24px;--typo-workspaceHeadings-weight:700;--typo-workspaceHeadings-style:normal;--typo-workspaceHeadings-spacing:-.01em;--typo-workspaceHeadings-line:1.2;--typo-workspaceHeadings-transform:none;
  --typo-workspaceLabels-family:var(--font-sans);--typo-workspaceLabels-size:13px;--typo-workspaceLabels-weight:600;--typo-workspaceLabels-style:normal;--typo-workspaceLabels-spacing:0em;--typo-workspaceLabels-line:1.35;--typo-workspaceLabels-transform:none;
  --typo-workspaceButtons-family:var(--font-sans);--typo-workspaceButtons-size:14px;--typo-workspaceButtons-weight:700;--typo-workspaceButtons-style:normal;--typo-workspaceButtons-spacing:0em;--typo-workspaceButtons-line:1.2;--typo-workspaceButtons-transform:none;
  --typo-workspaceMetrics-family:var(--font-sans);--typo-workspaceMetrics-size:24px;--typo-workspaceMetrics-weight:700;--typo-workspaceMetrics-style:normal;--typo-workspaceMetrics-spacing:0em;--typo-workspaceMetrics-line:1.1;--typo-workspaceMetrics-transform:none;
}
body{font-family:var(--typo-workspaceBody-family);font-size:var(--typo-workspaceBody-size);font-weight:var(--typo-workspaceBody-weight);font-style:var(--typo-workspaceBody-style);letter-spacing:var(--typo-workspaceBody-spacing);line-height:var(--typo-workspaceBody-line);text-transform:var(--typo-workspaceBody-transform)}
.view-title,.section-title,.modal-title,.empty-state h3{font-family:var(--typo-workspaceHeadings-family);font-weight:var(--typo-workspaceHeadings-weight);font-style:var(--typo-workspaceHeadings-style);letter-spacing:var(--typo-workspaceHeadings-spacing);line-height:var(--typo-workspaceHeadings-line);text-transform:var(--typo-workspaceHeadings-transform)}
.view-title{font-size:var(--typo-workspaceHeadings-size)}
.form-group>label,.metric-label,.table th,.field-label{font-family:var(--typo-workspaceLabels-family);font-size:var(--typo-workspaceLabels-size);font-weight:var(--typo-workspaceLabels-weight);font-style:var(--typo-workspaceLabels-style);letter-spacing:var(--typo-workspaceLabels-spacing);line-height:var(--typo-workspaceLabels-line);text-transform:var(--typo-workspaceLabels-transform)}
.btn,button{font-family:var(--typo-workspaceButtons-family);font-size:var(--typo-workspaceButtons-size);font-weight:var(--typo-workspaceButtons-weight);font-style:var(--typo-workspaceButtons-style);letter-spacing:var(--typo-workspaceButtons-spacing);line-height:var(--typo-workspaceButtons-line);text-transform:var(--typo-workspaceButtons-transform)}
.metric-value,.dashboard-metric-value{font-family:var(--typo-workspaceMetrics-family);font-size:var(--typo-workspaceMetrics-size);font-weight:var(--typo-workspaceMetrics-weight);font-style:var(--typo-workspaceMetrics-style);letter-spacing:var(--typo-workspaceMetrics-spacing);line-height:var(--typo-workspaceMetrics-line);text-transform:var(--typo-workspaceMetrics-transform)}

.typography-designer-card{grid-column:1/-1}.typography-card-header{display:flex;justify-content:space-between;gap:16px;align-items:flex-start}.theme-typography-groups{display:grid;gap:18px;margin-top:18px}.theme-type-section{border:1px solid var(--border-color);border-radius:10px;overflow:hidden}.theme-type-section-title{padding:11px 14px;background:var(--bg-tertiary);font-weight:800;font-size:.8rem;text-transform:uppercase;letter-spacing:.08em}.theme-type-section-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding:12px}.theme-type-role{border:1px solid var(--border-color);border-radius:8px;padding:12px;background:color-mix(in srgb,var(--bg-secondary) 85%,var(--bg-primary))}.theme-type-role-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;margin-bottom:12px}.theme-type-role-head p{color:var(--text-muted);font-size:.76rem;margin-top:3px}.theme-type-sample{min-width:42px;text-align:center;padding:6px;border:1px solid var(--border-color);border-radius:6px;background:var(--bg-primary);overflow:hidden}.theme-type-controls{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.theme-type-controls .theme-wide{grid-column:1/-1}.theme-type-controls label{font-size:.7rem}.theme-legacy-details{margin-top:18px;border-top:1px solid var(--border-color);padding-top:12px}.theme-legacy-details summary{cursor:pointer;font-weight:700}.theme-legacy-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin-top:10px}.theme-legacy-grid>div{display:flex;justify-content:space-between;gap:10px;padding:7px;border:1px solid var(--border-color);border-radius:6px}.theme-legacy-grid code{color:var(--text-secondary);font-size:.72rem;overflow:hidden;text-overflow:ellipsis}.theme-preview-meta{display:grid;gap:7px}.theme-preview-business,.theme-preview-title,.theme-preview-meta-label,.theme-preview-meta-value,.theme-preview-section,.theme-preview-body,.theme-preview-table-head,.theme-preview-notes,.theme-preview-timesheet-title,.theme-preview-timesheet-body,.theme-preview-footer{display:block}.theme-preview-table-head{padding:6px;background:rgba(0,0,0,.04)}.theme-preview-timesheet-title{margin-top:10px}.theme-preview-footer{margin-top:10px;text-align:right}.theme-preview-lines{display:none}
@media(max-width:900px){.theme-type-section-grid{grid-template-columns:1fr}.theme-type-controls{grid-template-columns:repeat(2,minmax(0,1fr))}.typography-card-header{flex-direction:column}}
@media(max-width:560px){.theme-type-controls{grid-template-columns:1fr}.theme-type-controls .theme-wide{grid-column:auto}.theme-legacy-grid{grid-template-columns:1fr}}

/* Invoice text roles. Each role is independent and overrides the legacy heading/body families. */
#view-viewinvoice{
 --h-invoiceBusinessName-family:var(--h-heading-font);--h-invoiceBusinessName-size:22px;--h-invoiceBusinessName-weight:700;--h-invoiceBusinessName-style:normal;--h-invoiceBusinessName-spacing:0em;--h-invoiceBusinessName-line:1.15;--h-invoiceBusinessName-transform:none;
 --h-invoiceTitle-family:var(--h-heading-font);--h-invoiceTitle-size:32px;--h-invoiceTitle-weight:700;--h-invoiceTitle-style:normal;--h-invoiceTitle-spacing:.09em;--h-invoiceTitle-line:1;--h-invoiceTitle-transform:uppercase;
 --h-invoiceNumber-family:ui-monospace,SFMono-Regular,Menlo,monospace;--h-invoiceNumber-size:15px;--h-invoiceNumber-weight:700;--h-invoiceNumber-style:normal;--h-invoiceNumber-spacing:0em;--h-invoiceNumber-line:1.4;--h-invoiceNumber-transform:none;
 --h-invoiceMetaLabels-family:var(--h-body-font);--h-invoiceMetaLabels-size:9px;--h-invoiceMetaLabels-weight:400;--h-invoiceMetaLabels-style:normal;--h-invoiceMetaLabels-spacing:.08em;--h-invoiceMetaLabels-line:1.25;--h-invoiceMetaLabels-transform:uppercase;
 --h-invoiceMetaValues-family:var(--h-body-font);--h-invoiceMetaValues-size:11px;--h-invoiceMetaValues-weight:700;--h-invoiceMetaValues-style:normal;--h-invoiceMetaValues-spacing:0em;--h-invoiceMetaValues-line:1.35;--h-invoiceMetaValues-transform:none;
 --h-invoiceSectionLabels-family:var(--h-body-font);--h-invoiceSectionLabels-size:9px;--h-invoiceSectionLabels-weight:700;--h-invoiceSectionLabels-style:normal;--h-invoiceSectionLabels-spacing:.16em;--h-invoiceSectionLabels-line:1.2;--h-invoiceSectionLabels-transform:uppercase;
 --h-invoiceBody-family:var(--h-body-font);--h-invoiceBody-size:11px;--h-invoiceBody-weight:400;--h-invoiceBody-style:normal;--h-invoiceBody-spacing:0em;--h-invoiceBody-line:1.45;--h-invoiceBody-transform:none;
 --h-invoiceTableHeaders-family:var(--h-body-font);--h-invoiceTableHeaders-size:9px;--h-invoiceTableHeaders-weight:700;--h-invoiceTableHeaders-style:normal;--h-invoiceTableHeaders-spacing:.08em;--h-invoiceTableHeaders-line:1.2;--h-invoiceTableHeaders-transform:uppercase;
 --h-invoiceTotals-family:var(--h-body-font);--h-invoiceTotals-size:11px;--h-invoiceTotals-weight:400;--h-invoiceTotals-style:normal;--h-invoiceTotals-spacing:0em;--h-invoiceTotals-line:1.35;--h-invoiceTotals-transform:none;
 --h-invoiceNotesPayment-family:var(--h-body-font);--h-invoiceNotesPayment-size:10px;--h-invoiceNotesPayment-weight:400;--h-invoiceNotesPayment-style:normal;--h-invoiceNotesPayment-spacing:0em;--h-invoiceNotesPayment-line:1.45;--h-invoiceNotesPayment-transform:none;
 --h-invoiceFooter-family:var(--h-body-font);--h-invoiceFooter-size:10px;--h-invoiceFooter-weight:400;--h-invoiceFooter-style:normal;--h-invoiceFooter-spacing:0em;--h-invoiceFooter-line:1.4;--h-invoiceFooter-transform:none;
 --h-timesheetTitle-family:var(--h-heading-font);--h-timesheetTitle-size:28px;--h-timesheetTitle-weight:700;--h-timesheetTitle-style:normal;--h-timesheetTitle-spacing:0em;--h-timesheetTitle-line:1.1;--h-timesheetTitle-transform:none;
 --h-timesheetBody-family:var(--h-body-font);--h-timesheetBody-size:8.5px;--h-timesheetBody-weight:400;--h-timesheetBody-style:normal;--h-timesheetBody-spacing:0em;--h-timesheetBody-line:1.35;--h-timesheetBody-transform:none;
}
.h-business-name{font-family:var(--h-invoiceBusinessName-family);font-size:var(--h-invoiceBusinessName-size);font-weight:var(--h-invoiceBusinessName-weight);font-style:var(--h-invoiceBusinessName-style);letter-spacing:var(--h-invoiceBusinessName-spacing);line-height:var(--h-invoiceBusinessName-line);text-transform:var(--h-invoiceBusinessName-transform)}
.h-invoice-title{font-family:var(--h-invoiceTitle-family);font-size:var(--h-invoiceTitle-size);font-weight:var(--h-invoiceTitle-weight);font-style:var(--h-invoiceTitle-style);letter-spacing:var(--h-invoiceTitle-spacing);line-height:var(--h-invoiceTitle-line);text-transform:var(--h-invoiceTitle-transform)}
.h-invoice-number{font-family:var(--h-invoiceNumber-family);font-size:var(--h-invoiceNumber-size);font-weight:var(--h-invoiceNumber-weight);font-style:var(--h-invoiceNumber-style);letter-spacing:var(--h-invoiceNumber-spacing);line-height:var(--h-invoiceNumber-line);text-transform:var(--h-invoiceNumber-transform)}
.h-meta-panel span{font-family:var(--h-invoiceMetaLabels-family);font-size:var(--h-invoiceMetaLabels-size);font-weight:var(--h-invoiceMetaLabels-weight);font-style:var(--h-invoiceMetaLabels-style);letter-spacing:var(--h-invoiceMetaLabels-spacing);line-height:var(--h-invoiceMetaLabels-line);text-transform:var(--h-invoiceMetaLabels-transform)}
.h-meta-panel strong,.h-panel>strong{font-family:var(--h-invoiceMetaValues-family);font-size:var(--h-invoiceMetaValues-size);font-weight:var(--h-invoiceMetaValues-weight);font-style:var(--h-invoiceMetaValues-style);letter-spacing:var(--h-invoiceMetaValues-spacing);line-height:var(--h-invoiceMetaValues-line);text-transform:var(--h-invoiceMetaValues-transform)}
.h-kicker{font-family:var(--h-invoiceSectionLabels-family);font-size:var(--h-invoiceSectionLabels-size);font-weight:var(--h-invoiceSectionLabels-weight);font-style:var(--h-invoiceSectionLabels-style);letter-spacing:var(--h-invoiceSectionLabels-spacing);line-height:var(--h-invoiceSectionLabels-line);text-transform:var(--h-invoiceSectionLabels-transform)}
.h-summary-table td,.h-secondary,.h-muted{font-family:var(--h-invoiceBody-family);font-size:var(--h-invoiceBody-size);font-weight:var(--h-invoiceBody-weight);font-style:var(--h-invoiceBody-style);letter-spacing:var(--h-invoiceBody-spacing);line-height:var(--h-invoiceBody-line);text-transform:var(--h-invoiceBody-transform)}
.h-summary-table th,.h-time-table th{font-family:var(--h-invoiceTableHeaders-family);font-size:var(--h-invoiceTableHeaders-size);font-weight:var(--h-invoiceTableHeaders-weight);font-style:var(--h-invoiceTableHeaders-style);letter-spacing:var(--h-invoiceTableHeaders-spacing);line-height:var(--h-invoiceTableHeaders-line);text-transform:var(--h-invoiceTableHeaders-transform)}
.h-totals>div{font-family:var(--h-invoiceTotals-family);font-size:var(--h-invoiceTotals-size);font-weight:var(--h-invoiceTotals-weight);font-style:var(--h-invoiceTotals-style);letter-spacing:var(--h-invoiceTotals-spacing);line-height:var(--h-invoiceTotals-line);text-transform:var(--h-invoiceTotals-transform)}
.h-notes,.h-payment-method{font-family:var(--h-invoiceNotesPayment-family);font-size:var(--h-invoiceNotesPayment-size);font-weight:var(--h-invoiceNotesPayment-weight);font-style:var(--h-invoiceNotesPayment-style);letter-spacing:var(--h-invoiceNotesPayment-spacing);line-height:var(--h-invoiceNotesPayment-line);text-transform:var(--h-invoiceNotesPayment-transform)}
.h-footer-note{font-family:var(--h-invoiceFooter-family);font-size:var(--h-invoiceFooter-size);font-weight:var(--h-invoiceFooter-weight);font-style:var(--h-invoiceFooter-style);letter-spacing:var(--h-invoiceFooter-spacing);line-height:var(--h-invoiceFooter-line);text-transform:var(--h-invoiceFooter-transform)}
.h-timesheet-header h2{font-family:var(--h-timesheetTitle-family);font-size:var(--h-timesheetTitle-size);font-weight:var(--h-timesheetTitle-weight);font-style:var(--h-timesheetTitle-style);letter-spacing:var(--h-timesheetTitle-spacing);line-height:var(--h-timesheetTitle-line);text-transform:var(--h-timesheetTitle-transform)}
.h-time-table td,.h-timesheet-footer{font-family:var(--h-timesheetBody-family);font-size:var(--h-timesheetBody-size);font-weight:var(--h-timesheetBody-weight);font-style:var(--h-timesheetBody-style);letter-spacing:var(--h-timesheetBody-spacing);line-height:var(--h-timesheetBody-line);text-transform:var(--h-timesheetBody-transform)}

/* Live preview role mappings */
.theme-preview-business{font-family:var(--typo-invoiceBusinessName-family);font-size:min(var(--typo-invoiceBusinessName-size),24px);font-weight:var(--typo-invoiceBusinessName-weight);font-style:var(--typo-invoiceBusinessName-style);letter-spacing:var(--typo-invoiceBusinessName-spacing);line-height:var(--typo-invoiceBusinessName-line);text-transform:var(--typo-invoiceBusinessName-transform)}
.theme-preview-title{font-family:var(--typo-invoiceTitle-family);font-size:min(var(--typo-invoiceTitle-size),26px);font-weight:var(--typo-invoiceTitle-weight);font-style:var(--typo-invoiceTitle-style);letter-spacing:var(--typo-invoiceTitle-spacing);line-height:var(--typo-invoiceTitle-line);text-transform:var(--typo-invoiceTitle-transform)}
.theme-preview-meta-label{font-family:var(--typo-invoiceMetaLabels-family);font-size:var(--typo-invoiceMetaLabels-size);font-weight:var(--typo-invoiceMetaLabels-weight);font-style:var(--typo-invoiceMetaLabels-style);letter-spacing:var(--typo-invoiceMetaLabels-spacing);line-height:var(--typo-invoiceMetaLabels-line);text-transform:var(--typo-invoiceMetaLabels-transform)}
.theme-preview-meta-value{font-family:var(--typo-invoiceMetaValues-family);font-size:var(--typo-invoiceMetaValues-size);font-weight:var(--typo-invoiceMetaValues-weight);font-style:var(--typo-invoiceMetaValues-style);letter-spacing:var(--typo-invoiceMetaValues-spacing);line-height:var(--typo-invoiceMetaValues-line);text-transform:var(--typo-invoiceMetaValues-transform)}
.theme-preview-section{font-family:var(--typo-invoiceSectionLabels-family);font-size:var(--typo-invoiceSectionLabels-size);font-weight:var(--typo-invoiceSectionLabels-weight);font-style:var(--typo-invoiceSectionLabels-style);letter-spacing:var(--typo-invoiceSectionLabels-spacing);line-height:var(--typo-invoiceSectionLabels-line);text-transform:var(--typo-invoiceSectionLabels-transform)}
.theme-preview-body{font-family:var(--typo-invoiceBody-family);font-size:var(--typo-invoiceBody-size);font-weight:var(--typo-invoiceBody-weight);font-style:var(--typo-invoiceBody-style);letter-spacing:var(--typo-invoiceBody-spacing);line-height:var(--typo-invoiceBody-line);text-transform:var(--typo-invoiceBody-transform)}
.theme-preview-table-head{font-family:var(--typo-invoiceTableHeaders-family);font-size:var(--typo-invoiceTableHeaders-size);font-weight:var(--typo-invoiceTableHeaders-weight);font-style:var(--typo-invoiceTableHeaders-style);letter-spacing:var(--typo-invoiceTableHeaders-spacing);line-height:var(--typo-invoiceTableHeaders-line);text-transform:var(--typo-invoiceTableHeaders-transform)}
.theme-preview-total{font-family:var(--typo-invoiceTotals-family);font-size:var(--typo-invoiceTotals-size);font-weight:var(--typo-invoiceTotals-weight);font-style:var(--typo-invoiceTotals-style);letter-spacing:var(--typo-invoiceTotals-spacing);line-height:var(--typo-invoiceTotals-line);text-transform:var(--typo-invoiceTotals-transform)}
.theme-preview-notes{font-family:var(--typo-invoiceNotesPayment-family);font-size:var(--typo-invoiceNotesPayment-size);font-weight:var(--typo-invoiceNotesPayment-weight);font-style:var(--typo-invoiceNotesPayment-style);letter-spacing:var(--typo-invoiceNotesPayment-spacing);line-height:var(--typo-invoiceNotesPayment-line);text-transform:var(--typo-invoiceNotesPayment-transform)}
.theme-preview-footer{font-family:var(--typo-invoiceFooter-family);font-size:var(--typo-invoiceFooter-size);font-weight:var(--typo-invoiceFooter-weight);font-style:var(--typo-invoiceFooter-style);letter-spacing:var(--typo-invoiceFooter-spacing);line-height:var(--typo-invoiceFooter-line);text-transform:var(--typo-invoiceFooter-transform)}
.theme-preview-timesheet-title{font-family:var(--typo-timesheetTitle-family);font-size:min(var(--typo-timesheetTitle-size),24px);font-weight:var(--typo-timesheetTitle-weight);font-style:var(--typo-timesheetTitle-style);letter-spacing:var(--typo-timesheetTitle-spacing);line-height:var(--typo-timesheetTitle-line);text-transform:var(--typo-timesheetTitle-transform)}
.theme-preview-timesheet-body{font-family:var(--typo-timesheetBody-family);font-size:max(var(--typo-timesheetBody-size),8px);font-weight:var(--typo-timesheetBody-weight);font-style:var(--typo-timesheetBody-style);letter-spacing:var(--typo-timesheetBody-spacing);line-height:var(--typo-timesheetBody-line);text-transform:var(--typo-timesheetBody-transform)}

/* Typography Designer accordion refinement */
.theme-type-section{overflow:hidden}
.theme-type-section>summary,.theme-type-role>summary{list-style:none}
.theme-type-section>summary::-webkit-details-marker,.theme-type-role>summary::-webkit-details-marker{display:none}
.theme-type-section-title{display:flex;align-items:center;justify-content:space-between;gap:12px;cursor:pointer;user-select:none}
.theme-type-section-hint{font-size:.7rem;font-weight:600;letter-spacing:0;text-transform:none;color:var(--text-muted)}
.theme-type-section[open] .theme-type-section-hint::before{content:'Collapse';font-size:.7rem;color:var(--text-muted)}
.theme-type-section[open] .theme-type-section-hint{font-size:0}
.theme-type-role{padding:0}
.theme-type-role-head{margin:0;padding:12px;cursor:pointer;align-items:center}
.theme-type-role-head:hover{background:color-mix(in srgb,var(--bg-tertiary) 55%,transparent)}
.theme-type-role-summary-right{display:flex;align-items:center;gap:8px;flex:0 0 auto}
.theme-type-chevron{font-size:1rem;color:var(--text-muted);transition:transform .16s ease}
.theme-type-role[open] .theme-type-chevron{transform:rotate(180deg)}
.theme-type-role[open] .theme-type-role-head{border-bottom:1px solid var(--border-color)}
.theme-type-role .theme-type-controls{padding:12px;padding-top:10px}
.theme-type-role:not([open]) .theme-type-controls{display:none}

/* Simple Invoice Designer — compact controls + clean reference-inspired document */
.simple-type-grid{grid-template-columns:1fr!important;gap:8px!important}.simple-type-role{padding:0!important}.simple-type-main{display:grid;grid-template-columns:minmax(180px,1.25fr) minmax(190px,1.2fr) 86px 92px auto;gap:10px;align-items:end;padding:11px 12px}.simple-type-name{align-self:center}.simple-type-name small{display:block;color:var(--text-muted);font-size:.72rem;margin-top:3px;line-height:1.3}.simple-type-main label{font-size:.68rem;color:var(--text-muted)}.simple-type-family select{width:100%}.simple-type-more{align-self:end}.simple-type-more summary{cursor:pointer;border:1px solid var(--border-color);border-radius:6px;padding:8px 10px;font-weight:700;font-size:.75rem;list-style:none}.simple-type-more summary::-webkit-details-marker{display:none}.simple-type-more-grid{position:absolute;z-index:10;right:18px;margin-top:6px;width:min(460px,calc(100vw - 60px));padding:12px;background:var(--bg-secondary);border:1px solid var(--border-color);border-radius:8px;box-shadow:0 14px 34px rgba(0,0,0,.25);display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.theme-type-section-grid.simple-type-grid{padding:8px}.theme-type-section-title{display:flex;justify-content:space-between;align-items:center;cursor:pointer}.theme-type-section-hint{font-size:.68rem;color:var(--text-muted);text-transform:none;letter-spacing:0}.theme-legacy-details{display:none}

.simple-invoice-document{--simple-line:#d7d7dc}.simple-sheet-inner{padding:.55in .55in .48in!important;font-family:var(--h-invoiceBody-family,var(--h-body-font));color:var(--h-text)}.simple-invoice-header{display:flex;justify-content:space-between;gap:32px;align-items:flex-start}.simple-brand{display:flex;gap:14px;align-items:flex-start}.simple-brand .h-logo{max-width:78px;max-height:58px}.simple-owner{font-weight:700;margin:8px 0 7px}.simple-title{text-align:right}.simple-title .h-invoice-title{text-transform:none!important;font-size:36px;line-height:1.05;margin-bottom:8px}.simple-title .h-invoice-number{font-weight:500;color:var(--h-accent);margin-bottom:8px}.simple-three-col{display:grid;grid-template-columns:1.2fr 1.05fr .75fr;gap:34px;margin-top:30px;padding-bottom:28px;border-bottom:1px solid var(--simple-line)}.simple-three-col>div{line-height:1.55}.simple-three-col .h-kicker{margin-bottom:10px}.simple-service-table{width:100%;border-collapse:collapse;margin-top:22px}.simple-service-table th{text-transform:uppercase;color:var(--h-accent);font-weight:700;border-bottom:1px solid color-mix(in srgb,var(--h-accent) 65%,transparent);padding:10px 0;text-align:left}.simple-service-table td{padding:26px 0 18px;border-bottom:0;vertical-align:top}.simple-service-table th:not(:first-child),.simple-service-table td:not(:first-child){padding-left:20px}.simple-service-table .h-secondary{margin-top:6px}.simple-spacer{min-height:1.75in}.simple-summary-box{display:grid;grid-template-columns:1.35fr 1fr;gap:40px;background:color-mix(in srgb,var(--h-header) 65%,var(--h-paper));padding:26px 28px}.simple-notes{line-height:1.55}.simple-totals{display:grid;gap:12px}.simple-totals>div{display:flex;justify-content:space-between;gap:20px}.simple-total-due{border-top:1px solid color-mix(in srgb,var(--h-accent) 55%,transparent);padding-top:14px;color:var(--h-accent);font-size:1.35rem;font-weight:800}.simple-payment-footer{margin-top:auto;padding-top:26px;border-top:1px solid var(--simple-line);display:flex;justify-content:space-between;align-items:flex-end;gap:30px;color:var(--h-secondary)}.simple-payment-footer .h-payment-method{font-size:.82rem}.simple-payment-footer .h-payment-qr{width:46px;height:46px}.simple-invoice-sheet .simple-sheet-inner{display:flex;flex-direction:column}

.simple-timesheet-header{display:flex;justify-content:space-between;align-items:flex-start;gap:24px}.h-timesheet-title{font-family:var(--h-timesheetTitle-family,var(--h-heading-font));font-size:var(--h-timesheetTitle-size,28px);font-weight:var(--h-timesheetTitle-weight,700);font-style:var(--h-timesheetTitle-style,normal);letter-spacing:var(--h-timesheetTitle-spacing,0);line-height:var(--h-timesheetTitle-line,1.2);text-transform:var(--h-timesheetTitle-transform,none);color:var(--h-accent)}.simple-timesheet-contact{margin:14px 0 10px}.simple-time-table{width:100%;border-collapse:collapse;margin-top:8px}.simple-time-table thead{display:table-header-group}.simple-time-table th{background:var(--h-accent);color:#fff;text-transform:uppercase;padding:10px 9px;font-size:.75rem;text-align:left}.simple-time-table td{padding:11px 9px;border-bottom:1px solid #e4e4e8}.simple-time-table tbody tr:nth-child(odd){background:color-mix(in srgb,var(--h-header) 65%,var(--h-paper))}.simple-hours-total{margin-top:28px;margin-left:auto;width:42%;background:color-mix(in srgb,var(--h-header) 65%,var(--h-paper));padding:20px 22px;display:grid;grid-template-columns:1fr auto;gap:4px 18px;align-items:center;color:var(--h-accent)}.simple-hours-total strong{font-size:1.65rem}.simple-hours-total small{grid-column:2;text-align:right;color:var(--h-secondary)}.simple-work-summary{margin-top:48px;padding:0 42px;line-height:1.7}.simple-work-summary>strong{display:block;margin-bottom:12px}.simple-work-summary>div{display:flex;justify-content:space-between;gap:18px}.simple-work-summary span{white-space:nowrap}.simple-timesheet-thanks{margin-top:auto;color:var(--h-secondary)}

@media(max-width:900px){.simple-type-main{grid-template-columns:1fr 1fr}.simple-type-name,.simple-type-family{grid-column:1/-1}.simple-three-col{grid-template-columns:1fr}.simple-summary-box{grid-template-columns:1fr}.simple-hours-total{width:100%}}

/* ============================================================
   Stable invoice/timesheet print layout hotfix
   Keeps financial totals and total hours anchored in a consistent
   bottom zone while preserving the approved minimal design.
   ============================================================ */
.simple-invoice-sheet .simple-sheet-inner,
.simple-timesheet-sheet .simple-sheet-inner{
  height:11in;
  min-height:11in;
  max-height:11in;
  box-sizing:border-box;
  overflow:hidden;
}

/* Page 1: make the totals/payment area a single anchored footer zone. */
.simple-invoice-bottom{
  margin-top:auto;
  flex:0 0 auto;
}
.simple-summary-box{
  padding:22px 26px;
  gap:34px;
}
.simple-payment-footer{
  margin-top:22px;
  padding-top:20px;
}

/* Page 2: table occupies the flexible middle; total is always in the bottom zone. */
.simple-timesheet-sheet .simple-sheet-inner{
  display:flex;
  flex-direction:column;
}
.simple-timesheet-header{
  flex:0 0 auto;
  padding-bottom:12px;
  border-bottom:1px solid var(--simple-line);
}
.simple-timesheet-contact{
  flex:0 0 auto;
  margin:10px 0 8px;
}
.simple-time-table-wrap{
  flex:1 1 auto;
  min-height:0;
  overflow:hidden;
}
.simple-time-table{
  margin-top:4px;
  table-layout:fixed;
}
.simple-time-table th{
  padding:8px 8px;
  font-size:.70rem;
  border:0;
}
.simple-time-table td{
  padding:8px 8px;
  line-height:1.2;
  vertical-align:middle;
  overflow:hidden;
  text-overflow:ellipsis;
}
.simple-time-table th:nth-child(1),.simple-time-table td:nth-child(1){width:15%}
.simple-time-table th:nth-child(2),.simple-time-table td:nth-child(2){width:15%}
.simple-time-table th:nth-child(3),.simple-time-table td:nth-child(3){width:15%}
.simple-time-table th:nth-child(4),.simple-time-table td:nth-child(4){width:16%}
.simple-time-table th:nth-child(5),.simple-time-table td:nth-child(5){width:24%}
.simple-time-table th:nth-child(6),.simple-time-table td:nth-child(6){width:15%}
.simple-timesheet-sheet.is-compact .simple-time-table th{padding:7px 7px;font-size:.66rem}
.simple-timesheet-sheet.is-compact .simple-time-table td{padding:6px 7px;font-size:8px}
.simple-timesheet-sheet.is-dense .simple-time-table th{padding:6px 6px;font-size:.62rem}
.simple-timesheet-sheet.is-dense .simple-time-table td{padding:5px 6px;font-size:7.5px}

.simple-timesheet-bottom{
  flex:0 0 auto;
  margin-top:16px;
  padding-top:16px;
  border-top:1px solid var(--simple-line);
  display:grid;
  grid-template-columns:1fr auto;
  column-gap:28px;
  row-gap:10px;
  align-items:end;
}
.simple-hours-total{
  margin:0;
  width:235px;
  padding:14px 16px;
  grid-column:2;
  grid-row:1;
  align-self:end;
}
.simple-hours-total strong{font-size:1.45rem}
.simple-work-summary{
  margin:0;
  padding:0;
  grid-column:1;
  grid-row:1;
  line-height:1.45;
  font-size:9px;
  min-width:0;
}
.simple-work-summary>strong{margin-bottom:7px}
.simple-work-summary>div{gap:12px}
.simple-work-summary>div span:first-child{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.simple-timesheet-thanks{
  grid-column:1/-1;
  grid-row:2;
  margin:0;
  padding-top:4px;
  font-size:9px;
}

@media print{
  .h-timesheet-sheet{
    height:11in!important;
    min-height:11in!important;
    max-height:11in!important;
    overflow:hidden!important;
  }
  .h-timesheet-sheet .h-sheet-inner{
    height:11in!important;
    min-height:11in!important;
    max-height:11in!important;
    overflow:hidden!important;
  }
}

/* ============================================================
   Multi-page timesheet pagination
   Each physical timesheet page is a fixed US Letter sheet.
   Rows are balanced across pages by invoiceview.js. The grand
   total and work summary live only on the final timesheet page.
   ============================================================ */
.simple-timesheet-header-meta{
  text-align:right;
  display:grid;
  gap:5px;
  justify-items:end;
}
.simple-page-label{
  color:var(--h-secondary);
  font-size:8.5px;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.simple-timesheet-continue{
  margin-top:auto;
  padding-top:14px;
  border-top:1px solid var(--simple-line);
  display:flex;
  justify-content:space-between;
  gap:20px;
  color:var(--h-secondary);
  font-size:9px;
}
.simple-timesheet-thanks{
  display:flex;
  justify-content:space-between;
  gap:20px;
}
.simple-timesheet-sheet .simple-time-table th{
  padding:9px 8px;
  font-size:.69rem;
}
.simple-timesheet-sheet .simple-time-table td{
  padding:9px 8px;
  font-size:8.5px;
  line-height:1.25;
}

@media print{
  .h-sheet{
    height:11in!important;
    min-height:11in!important;
    max-height:11in!important;
    break-after:page!important;
    page-break-after:always!important;
  }
  .h-sheet:last-child{
    break-after:auto!important;
    page-break-after:auto!important;
  }
  .h-timesheet-sheet,
  .h-timesheet-sheet .h-sheet-inner{
    height:11in!important;
    min-height:11in!important;
    max-height:11in!important;
    overflow:hidden!important;
  }
}


/* ============================================================
   Compact adaptive timesheet composition
   Keep pages visually full before adding another physical sheet.
   ============================================================ */
.simple-timesheet-sheet .simple-time-table-wrap{
  flex:0 0 auto;
  overflow:visible;
}
.simple-timesheet-sheet .simple-time-table td{
  padding:10px 8px;
  font-size:9px;
}
.simple-timesheet-sheet.is-compact .simple-time-table th{
  padding:8px 7px;
  font-size:.67rem;
}
.simple-timesheet-sheet.is-compact .simple-time-table td{
  padding:7px 7px;
  font-size:8.25px;
}
.simple-timesheet-sheet.is-dense .simple-time-table th{
  padding:7px 6px;
  font-size:.64rem;
}
.simple-timesheet-sheet.is-dense .simple-time-table td{
  padding:6px 6px;
  font-size:8px;
}
.simple-timesheet-bottom{
  margin-top:auto;
}
.simple-timesheet-continue{
  margin-top:auto;
}


/* Final approved timesheet closing composition v2.
   Summary + total sit together above the divider; signature and footer sit below. */
.simple-timesheet-bottom{
  margin-top:auto;
  padding-top:0;
  border-top:0;
  grid-template-columns:minmax(0,1fr) 235px;
  column-gap:34px;
  row-gap:0;
  align-items:end;
}
.simple-work-summary{
  grid-column:1;
  grid-row:1;
  margin:0;
  padding:0 0 16px;
  line-height:1.45;
  font-size:9px;
  min-width:0;
}
.simple-work-summary>strong{
  display:block;
  margin-bottom:7px;
  letter-spacing:.08em;
  font-size:9px;
}
.simple-work-summary>div{gap:12px}
.simple-work-summary>div span:first-child{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.simple-hours-total{
  grid-column:2;
  grid-row:1;
  justify-self:end;
  align-self:end;
  margin:0 0 16px;
  width:235px;
  padding:14px 16px;
}
.simple-hours-total strong{font-size:1.45rem}
.simple-submitted-by{
  grid-column:1/-1;
  grid-row:2;
  border-top:1px solid var(--simple-line);
  padding-top:18px;
  margin-top:0;
  display:grid;
  width:min(390px,62%);
  gap:5px;
  color:var(--h-text);
}
.simple-submitted-label{
  color:var(--h-secondary);
  font-size:8px;
  font-weight:700;
  letter-spacing:.09em;
}
.simple-submitted-by strong{
  display:block;
  padding:2px 0 5px;
  border-bottom:1px solid color-mix(in srgb,var(--h-text) 65%,transparent);
  font-size:10px;
}
.simple-submitted-by>span:last-child{
  color:var(--h-secondary);
  font-size:8.5px;
}
.simple-final-footer{
  grid-column:1/-1;
  grid-row:3;
  margin-top:16px;
  padding-top:10px;
  border-top:1px solid var(--simple-line);
  display:grid;
  grid-template-columns:1fr auto 1fr;
  align-items:center;
  gap:14px;
  color:var(--h-secondary);
  font-size:8px;
}
.simple-final-footer span:nth-child(2){text-align:center}
.simple-final-footer span:last-child{text-align:right}

/* Final timesheet closing v3: summary band sits closer to table; signature/footer remain at page bottom. */
.simple-timesheet-bottom{
  margin-top:28px;
  padding:0;
  display:flex;
  flex:1 1 auto;
  flex-direction:column;
  min-height:0;
}
.simple-summary-total-band{
  width:100%;
  display:grid;
  grid-template-columns:minmax(0,1fr) 220px;
  gap:28px;
  align-items:center;
  padding:18px 20px;
  background:color-mix(in srgb,var(--h-header) 68%,var(--h-paper));
  border-top:1px solid color-mix(in srgb,var(--h-accent) 22%,transparent);
  border-bottom:1px solid color-mix(in srgb,var(--h-accent) 12%,transparent);
}
.simple-summary-total-band .simple-work-summary{
  margin:0;
  padding:0;
  font-size:9px;
  line-height:1.45;
}
.simple-summary-total-band .simple-work-summary>strong{
  margin:0 0 7px;
  font-size:9px;
  letter-spacing:.08em;
}
.simple-summary-total-band .simple-hours-total{
  margin:0;
  width:100%;
  padding:0;
  background:transparent;
  display:grid;
  grid-template-columns:auto 1fr;
  gap:4px 14px;
  align-items:center;
  justify-self:stretch;
}
.simple-summary-total-band .simple-hours-total span{font-size:10px}
.simple-summary-total-band .simple-hours-total strong{
  font-size:1.5rem;
  text-align:right;
}
.simple-summary-total-band .simple-hours-total small{
  grid-column:2;
  text-align:right;
}
.simple-timesheet-closing-footer{
  margin-top:auto;
  padding-top:20px;
}
.simple-timesheet-closing-footer .simple-submitted-by{
  width:min(390px,62%);
  margin:0;
  padding:0;
  border-top:0;
  display:grid;
  gap:5px;
}
.simple-timesheet-closing-footer .simple-final-footer{
  margin-top:18px;
  padding-top:10px;
  border-top:1px solid var(--simple-line);
  display:grid;
  grid-template-columns:1fr auto 1fr;
  gap:14px;
  align-items:center;
}

/* Timesheet closing v4: fill only, no edge lines on summary band. */
.simple-summary-total-band{
  border:0 !important;
  box-shadow:none !important;
  outline:0 !important;
  background:color-mix(in srgb,var(--h-header) 68%,var(--h-paper));
}

/* Reference-match layout v5 — based on approved uploaded invoice/timesheet PDF.
   Print typography never drops below 10pt. */
.simple-invoice-document{
  --reference-fill:color-mix(in srgb,var(--h-header) 68%,var(--h-paper));
}
.simple-invoice-document .simple-sheet-inner{
  padding:.55in .55in .48in!important;
  font-size:10pt;
  line-height:1.35;
}
.simple-invoice-document .h-secondary,
.simple-invoice-document .h-kicker,
.simple-invoice-document small,
.simple-invoice-document td,
.simple-invoice-document th,
.simple-invoice-document .h-payment-method,
.simple-invoice-document .simple-page-label{
  font-size:10pt!important;
}
.simple-invoice-document .h-business-name{font-size:18pt!important;letter-spacing:.08em}
.simple-title .h-invoice-title{font-size:28pt!important}
.simple-title .h-invoice-number{font-size:10pt!important}
.simple-owner{font-size:10pt!important}
.simple-three-col{margin-top:28px;padding-bottom:26px;gap:32px}
.simple-service-table{margin-top:20px}
.simple-service-table th{font-size:10pt!important;padding:9px 0}
.simple-service-table td{font-size:10pt!important;padding:24px 0 18px}
.simple-summary-box{padding:22px 24px;background:var(--reference-fill)}
.simple-summary-box,.simple-summary-box *{font-size:10pt!important}
.simple-summary-box .simple-total-due,.simple-summary-box .simple-total-due *{font-size:15pt!important}
.simple-payment-footer,.simple-payment-footer *{font-size:10pt!important}

/* Timesheet: reproduce the uploaded reference composition. */
.simple-timesheet-sheet .simple-sheet-inner{
  display:flex;
  flex-direction:column;
  height:11in;
  min-height:11in;
  max-height:11in;
  overflow:hidden;
}
.simple-timesheet-header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:24px;
  padding:0;
  border:0;
}
.h-timesheet-title{
  font-size:22pt!important;
  line-height:1.1!important;
  margin:0 0 8px;
}
.simple-timesheet-header .h-secondary{font-size:10pt!important}
.simple-timesheet-header-meta{text-align:right;padding-top:4px}
.simple-page-label{margin-top:7px;text-transform:uppercase;letter-spacing:.08em;color:var(--h-secondary)}
.simple-timesheet-contact{
  margin:8px 0 6px;
  font-size:10pt!important;
  line-height:1.45;
}
.simple-time-table-wrap{
  flex:0 0 auto;
  overflow:visible;
  margin-top:0;
}
.simple-time-table{margin-top:0;table-layout:fixed}
.simple-time-table th{
  font-size:10pt!important;
  padding:9px 8px;
  line-height:1.2;
  text-align:center;
}
.simple-time-table td{
  font-size:10pt!important;
  padding:10px 8px;
  line-height:1.25;
  text-align:center;
  border-bottom:0;
  border-right:1px solid #e4e4e8;
}
.simple-time-table td:last-child{border-right:0}
.simple-time-table th:nth-child(1){width:15%}
.simple-time-table th:nth-child(2){width:18%}
.simple-time-table th:nth-child(3){width:16%}
.simple-time-table th:nth-child(4){width:17%}
.simple-time-table th:nth-child(5){width:20%}
.simple-time-table th:nth-child(6){width:14%}
.simple-time-table tbody tr:nth-child(odd){background:var(--reference-fill)}

.reference-timesheet-bottom{
  margin-top:auto;
  display:flex;
  flex-direction:column;
}
.reference-hours-band{
  width:100%;
  min-height:86px;
  background:var(--reference-fill);
  display:flex;
  justify-content:flex-end;
  align-items:center;
  padding:16px 24px;
  box-sizing:border-box;
}
.reference-hours-content{
  min-width:245px;
  display:grid;
  grid-template-columns:auto auto;
  gap:4px 20px;
  align-items:center;
  color:var(--h-accent);
}
.reference-hours-content span{font-size:11pt!important;font-weight:700;text-align:right}
.reference-hours-content strong{font-size:20pt!important;text-align:right;line-height:1}
.reference-hours-content small{grid-column:2;font-size:10pt!important;text-align:right;color:var(--h-secondary)}
.reference-work-summary{
  margin:44px 36px 0;
  font-size:10pt!important;
  line-height:1.6;
}
.reference-work-summary>strong{
  display:block;
  font-size:10pt!important;
  margin-bottom:10px;
  text-transform:none;
  letter-spacing:0;
}
.reference-work-summary>div{display:block;margin:0}
.reference-work-summary>div+div{margin-top:3px}
.reference-work-summary span{font-size:10pt!important;white-space:normal}
.reference-timesheet-thanks{
  margin-top:auto;
  padding-top:36px;
  font-size:10pt!important;
  color:var(--h-secondary);
}
.reference-timesheet-continue{
  margin-top:auto;
  display:flex;
  justify-content:space-between;
  padding-top:16px;
  font-size:10pt!important;
  color:var(--h-secondary);
}

@media print{
  .simple-invoice-document .simple-sheet-inner,
  .simple-invoice-document .h-secondary,
  .simple-invoice-document .h-kicker,
  .simple-invoice-document small,
  .simple-invoice-document td,
  .simple-invoice-document th,
  .simple-invoice-document .h-payment-method,
  .simple-invoice-document .simple-page-label,
  .reference-work-summary,
  .reference-work-summary *,
  .reference-timesheet-thanks,
  .reference-timesheet-continue{
    font-size:10pt!important;
  }
  .h-timesheet-title{font-size:22pt!important}
  .reference-hours-content strong{font-size:20pt!important}
  .simple-title .h-invoice-title{font-size:28pt!important}
  .simple-invoice-document .h-business-name{font-size:18pt!important}
}


/* Reference-match v6
   Fill continuation pages naturally before opening another sheet.
   Final totals/summary follows the table instead of being forced to the page bottom.
   Minimum print text remains 10pt from v5. */
.reference-timesheet-bottom{
  margin-top:46px !important;
}
.reference-work-summary{
  margin-top:34px !important;
}
.reference-timesheet-thanks{
  margin-top:28px !important;
  padding-top:0 !important;
}
.simple-timesheet-sheet .simple-time-table td{
  padding-top:11px !important;
  padding-bottom:11px !important;
}
.simple-timesheet-sheet .simple-time-table th{
  padding-top:10px !important;
  padding-bottom:10px !important;
}


/* ============================================================
   Phase I8 Layout Designer v7
   ============================================================ */
.layout-designer-panel{
  max-width:980px;
  margin:0 auto 18px;
  padding:16px;
  background:var(--surface-background,#1e293b);
  border:1px solid var(--border-color,#334155);
  border-radius:10px;
}
.layout-designer-heading{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:14px;
}
.layout-designer-help,.layout-designer-note{
  color:var(--muted-text,#94a3b8);
  font-size:.86rem;
  margin-top:4px;
}
.layout-designer-grid{
  display:grid;
  grid-template-columns:2fr 1.4fr 1fr 1fr 1fr;
  gap:10px;
  align-items:end;
}
.layout-designer-grid label{
  display:flex;
  flex-direction:column;
  gap:5px;
  font-size:.78rem;
  font-weight:700;
  color:var(--secondary-text,#cbd5e1);
}
.layout-designer-grid input,.layout-designer-grid select{
  width:100%;
}
.layout-designer-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:12px;
}
.layout-edit-mode .h-sheet{
  background-image:
    linear-gradient(rgba(16,185,129,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16,185,129,.055) 1px, transparent 1px);
  background-size:12px 12px;
}
.layout-edit-target{
  outline:1px dashed rgba(16,185,129,.58);
  outline-offset:3px;
  cursor:move !important;
  touch-action:none;
}
.layout-selected{
  outline:2px solid #10b981 !important;
  outline-offset:4px !important;
  box-shadow:0 0 0 5px rgba(16,185,129,.12);
}
.layout-edit-mode .h-logo{
  min-width:24px;
  min-height:24px;
}
@media(max-width:900px){
  .layout-designer-grid{grid-template-columns:1fr 1fr;}
}
@media print{
  .layout-designer-panel,
  #invoice-layout-edit-btn{display:none !important;}
  .layout-edit-target,.layout-selected{outline:none !important;box-shadow:none !important;}
  .layout-edit-mode .h-sheet{background-image:none !important;}
}


/* ============================================================
   Phase I8 Direct Layout Editor v8
   ============================================================ */
.layout-designer-panel{
  max-width:980px;
  margin:0 auto 16px;
  padding:14px 16px;
  background:var(--surface-background,#1e293b);
  border:1px solid var(--border-color,#334155);
  border-radius:10px;
}
.layout-designer-heading{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
}
.layout-designer-heading .compact{
  margin:0;
  justify-content:flex-end;
}
.layout-designer-help,.layout-designer-note{
  color:var(--muted-text,#94a3b8);
  font-size:.88rem;
  margin-top:4px;
}
.layout-floating-toolbar{
  position:fixed;
  z-index:99999;
  display:flex;
  align-items:center;
  gap:6px;
  padding:7px 8px;
  background:#0f172a;
  border:1px solid #10b981;
  border-radius:8px;
  box-shadow:0 10px 28px rgba(0,0,0,.28);
  color:white;
  font-size:12px;
}
.layout-floating-toolbar[hidden]{display:none!important;}
.layout-floating-toolbar strong{margin-right:4px;white-space:nowrap;}
.layout-floating-toolbar button{
  min-width:30px;
  height:28px;
  padding:0 7px;
  border-radius:5px;
  border:1px solid #475569;
  background:#1e293b;
  color:white;
  cursor:pointer;
}
.layout-floating-toolbar label{
  display:flex;
  align-items:center;
  gap:4px;
  font-weight:700;
}
.layout-floating-toolbar input{
  width:56px;
  height:28px;
  padding:3px 5px;
  color:#111827;
  background:white;
}
.layout-edit-mode .h-sheet{
  background-image:
    linear-gradient(rgba(16,185,129,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16,185,129,.045) 1px, transparent 1px);
  background-size:12px 12px;
}
.layout-edit-target{
  outline:1px dashed rgba(16,185,129,.42);
  outline-offset:3px;
  cursor:move!important;
  touch-action:none;
}
.layout-edit-target:hover{
  outline:2px solid rgba(16,185,129,.8);
}
.layout-selected{
  outline:3px solid #10b981!important;
  outline-offset:4px!important;
  box-shadow:0 0 0 6px rgba(16,185,129,.13);
}
@media print{
  .layout-designer-panel,#layout-floating-toolbar,#invoice-layout-edit-btn{display:none!important;}
  .layout-edit-target,.layout-selected{outline:none!important;box-shadow:none!important;}
  .layout-edit-mode .h-sheet{background-image:none!important;}
}


/* Direct click editor v9 — intentionally obvious hit areas while editing. */
.layout-edit-mode .layout-editable{
  pointer-events:auto !important;
  position:relative;
}
.layout-edit-mode .layout-editable::after{
  content:"";
  position:absolute;
  inset:-4px;
  border:1px dashed rgba(16,185,129,.46);
  pointer-events:none;
  z-index:999;
}
.layout-edit-mode .layout-editable:hover::after{
  border:2px solid rgba(16,185,129,.9);
  background:rgba(16,185,129,.035);
}
.layout-edit-mode .layout-editable.layout-selected::after{
  border:3px solid #10b981;
  background:rgba(16,185,129,.055);
}
.layout-edit-mode .layout-editable{
  cursor:grab !important;
  user-select:none;
}
.layout-edit-mode .layout-editable:active{
  cursor:grabbing !important;
}
@media print{
  .layout-editable::after{display:none!important;}
}


/* ============================================================
   Phase I8 Visual Page Editor v10 — overlay based
   ============================================================ */
.invoice-layout-overlay-layer{
  position:fixed;
  inset:0;
  z-index:99990;
  pointer-events:none;
}
.page-editor-overlay{
  position:fixed;
  box-sizing:border-box;
  border:1px dashed rgba(16,185,129,.65);
  background:rgba(16,185,129,.025);
  pointer-events:auto;
  cursor:grab;
}
.page-editor-overlay:hover{
  border:2px solid rgba(16,185,129,.9);
  background:rgba(16,185,129,.055);
}
.page-editor-overlay.selected{
  border:3px solid #10b981;
  background:rgba(16,185,129,.075);
  box-shadow:0 0 0 4px rgba(16,185,129,.13);
}
.page-editor-chip{
  position:absolute;
  left:0;
  top:-23px;
  display:none;
  padding:3px 7px;
  border-radius:5px 5px 0 0;
  background:#10b981;
  color:#06281d;
  font:700 11px/1.35 system-ui,sans-serif;
  white-space:nowrap;
}
.page-editor-overlay:hover .page-editor-chip,
.page-editor-overlay.selected .page-editor-chip{
  display:block;
}
.page-editor-resize{
  position:absolute;
  width:13px;
  height:13px;
  right:-7px;
  bottom:-7px;
  border:2px solid white;
  border-radius:2px;
  background:#10b981;
  cursor:nwse-resize;
}
.layout-align-controls{
  display:flex;
  gap:3px;
}
.layout-edit-mode .h-sheet{
  background-image:
    linear-gradient(rgba(16,185,129,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16,185,129,.04) 1px, transparent 1px);
  background-size:12px 12px;
}
.layout-editable{
  font-size:calc(1em * var(--layout-font-scale, 1));
}
@media print{
  .invoice-layout-overlay-layer,
  #layout-floating-toolbar,
  #invoice-layout-designer,
  #invoice-layout-edit-btn{
    display:none!important;
  }
  .layout-edit-mode .h-sheet{background-image:none!important;}
}

/* Template Presets v11 */
.invoice-template-picker{display:inline-flex;align-items:center;gap:7px;font-weight:700;font-size:13px}.invoice-template-picker select{min-width:225px;padding:8px 10px;border:1px solid #475569;border-radius:8px}
.invoice-template-minimal .h-invoice-sheet{--pa:#557277;--pr:#a8c0c5;background:#fff;color:#435b60}.invoice-template-minimal .h-invoice-sheet .h-title{font-size:58px!important;line-height:.9!important;letter-spacing:-2px!important;text-transform:uppercase;color:var(--pa)!important}.invoice-template-minimal .h-invoice-sheet th{color:var(--pa)!important;background:transparent!important;text-transform:uppercase}.invoice-template-minimal .h-invoice-sheet th,.invoice-template-minimal .h-invoice-sheet td{border-left:0!important;border-right:0!important;border-top:0!important;border-bottom:1px solid var(--pr)!important}
.invoice-template-structured .h-invoice-sheet{--pa:#374b51;background:#fff;color:#111}.invoice-template-structured .h-invoice-sheet .h-header{background:var(--pa)!important;color:#fff!important;padding:28px 34px!important;margin:-1px -1px 28px!important}.invoice-template-structured .h-invoice-sheet .h-header *{color:#fff!important}.invoice-template-structured .h-invoice-sheet th{background:var(--pa)!important;color:#fff!important}.invoice-template-structured .h-invoice-sheet table{border:2px solid var(--pa)!important;border-collapse:collapse!important}.invoice-template-structured .h-invoice-sheet th,.invoice-template-structured .h-invoice-sheet td{border:1px solid var(--pa)!important}
.invoice-template-atelier .h-invoice-sheet{--pa:#e95a25;--ps:#f7e9fb;position:relative;background:#fffaf3!important;color:#171717!important;padding-left:155px!important}.invoice-template-atelier .h-invoice-sheet:before{content:"TORABÉ";position:absolute;inset:0 auto 0 0;width:118px;background:var(--ps);border-right:4px solid var(--pa);color:var(--pa);font-weight:800;font-size:31px;letter-spacing:.12em;writing-mode:vertical-rl;transform:rotate(180deg);display:flex;align-items:center;justify-content:center}.invoice-template-atelier .h-invoice-sheet .h-details>*{background:var(--ps)!important;padding:16px!important}.invoice-template-atelier .h-invoice-sheet tbody tr:nth-child(odd){background:var(--ps)!important}
.timesheet-sheet .h-timesheet-table th{background:var(--invoice-accent,#087c5b)!important;color:#fff!important;text-transform:uppercase}.timesheet-sheet .h-timesheet-table td{border-bottom:1px solid rgba(100,116,139,.35)!important}.timesheet-sheet .h-timesheet-closing{border-top:2px solid var(--invoice-accent,#087c5b)!important}
@media print{.invoice-template-picker{display:none!important}}

/* v13: 7 unique dates per printable timesheet sheet; one summary row per date */
.simple-time-table .timesheet-detail-cell{font-size:10pt;line-height:1.25;white-space:normal}
.simple-time-table th:nth-child(1){width:14%}.simple-time-table th:nth-child(2){width:17%}.simple-time-table th:nth-child(3){width:23%}.simple-time-table th:nth-child(4){width:35%}.simple-time-table th:nth-child(5){width:11%}
@media print{.simple-time-table th,.simple-time-table td{font-size:10pt!important;padding:7px 6px!important;vertical-align:top}}

/* v14 — visible invoice template selector */
.invoice-template-picker{
  display:inline-flex!important;
  align-items:center;
  gap:8px;
  padding:0;
  color:var(--primary-text,#f1f5f9);
  font-weight:700;
  font-size:13px;
}
.invoice-template-picker span{white-space:nowrap}
.invoice-template-picker select{
  display:block!important;
  min-width:235px;
  height:40px;
  padding:0 34px 0 12px;
  border:1px solid var(--border-color,#475569);
  border-radius:8px;
  background:var(--surface-background,#1e293b);
  color:var(--primary-text,#f1f5f9);
  font:inherit;
  cursor:pointer;
}
@media print{.invoice-template-picker{display:none!important}}


/* ============================================================
   v15 — functional preset application on #invoice-print-document
   Each preset changes invoice AND timesheet presentation.
   ============================================================ */

/* 01 Minimal Architectural */
#invoice-print-document.invoice-template-minimal .h-sheet{
  --preset:#557277;
  --preset-soft:#edf4f5;
}
#invoice-print-document.invoice-template-minimal .h-invoice-sheet,
#invoice-print-document.invoice-template-minimal .h-timesheet-sheet{
  background:#fff!important;
  color:#435b60!important;
}
#invoice-print-document.invoice-template-minimal .simple-invoice-header{
  border-bottom:3px solid #a8c0c5!important;
  padding-bottom:22px!important;
}
#invoice-print-document.invoice-template-minimal .h-invoice-title{
  color:#557277!important;
  font-size:48px!important;
  text-transform:uppercase!important;
  letter-spacing:-1px!important;
}
#invoice-print-document.invoice-template-minimal .simple-invoice-details{
  border:0!important;
  border-bottom:2px solid #a8c0c5!important;
}
#invoice-print-document.invoice-template-minimal .simple-invoice-details > div{
  border:0!important;
  background:transparent!important;
}
#invoice-print-document.invoice-template-minimal .simple-service-table th,
#invoice-print-document.invoice-template-minimal .simple-time-table th{
  background:transparent!important;
  color:#557277!important;
  border-top:2px solid #a8c0c5!important;
  border-bottom:2px solid #a8c0c5!important;
}
#invoice-print-document.invoice-template-minimal .simple-service-table td,
#invoice-print-document.invoice-template-minimal .simple-time-table td{
  border-left:0!important;border-right:0!important;
}
#invoice-print-document.invoice-template-minimal .simple-timesheet-header{
  border-bottom:3px solid #a8c0c5!important;
}
#invoice-print-document.invoice-template-minimal .h-timesheet-title{
  color:#557277!important;
}

/* 02 Structured Professional */
#invoice-print-document.invoice-template-structured .h-sheet{
  --preset:#374b51;
}
#invoice-print-document.invoice-template-structured .simple-invoice-header,
#invoice-print-document.invoice-template-structured .simple-timesheet-header{
  background:#374b51!important;
  color:#fff!important;
  padding:28px 30px!important;
  margin:-38px -38px 26px!important;
}
#invoice-print-document.invoice-template-structured .simple-invoice-header *,
#invoice-print-document.invoice-template-structured .simple-timesheet-header *{
  color:#fff!important;
}
#invoice-print-document.invoice-template-structured .simple-invoice-details{
  border:2px solid #374b51!important;
}
#invoice-print-document.invoice-template-structured .simple-invoice-details > div{
  border-right:1px solid #374b51!important;
}
#invoice-print-document.invoice-template-structured .simple-service-table,
#invoice-print-document.invoice-template-structured .simple-time-table{
  border:2px solid #374b51!important;
  border-collapse:collapse!important;
}
#invoice-print-document.invoice-template-structured .simple-service-table th,
#invoice-print-document.invoice-template-structured .simple-time-table th{
  background:#374b51!important;
  color:#fff!important;
}
#invoice-print-document.invoice-template-structured .simple-service-table th,
#invoice-print-document.invoice-template-structured .simple-service-table td,
#invoice-print-document.invoice-template-structured .simple-time-table th,
#invoice-print-document.invoice-template-structured .simple-time-table td{
  border:1px solid #374b51!important;
}
#invoice-print-document.invoice-template-structured .simple-invoice-summary{
  border:2px solid #374b51!important;
  background:#f4f6f7!important;
}
#invoice-print-document.invoice-template-structured .simple-total-due{
  background:#374b51!important;
  color:#fff!important;
  padding:10px 12px!important;
}

/* 03 Atelier Editorial */
#invoice-print-document.invoice-template-atelier .h-invoice-sheet,
#invoice-print-document.invoice-template-atelier .h-timesheet-sheet{
  --preset:#e95a25;
  --soft:#f7e9fb;
  background:#fffaf3!important;
  color:#171717!important;
  position:relative!important;
  padding-left:150px!important;
}
#invoice-print-document.invoice-template-atelier .h-invoice-sheet::before,
#invoice-print-document.invoice-template-atelier .h-timesheet-sheet::before{
  content:"TORABÉ ATELIER";
  position:absolute;
  left:0;top:0;bottom:0;width:112px;
  background:#f7e9fb;
  border-right:4px solid #e95a25;
  color:#e95a25;
  writing-mode:vertical-rl;
  transform:rotate(180deg);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:800;
  font-size:24px;
  letter-spacing:.12em;
}
#invoice-print-document.invoice-template-atelier .h-invoice-title,
#invoice-print-document.invoice-template-atelier .h-timesheet-title{
  color:#171717!important;
  text-transform:uppercase!important;
  letter-spacing:.08em!important;
}
#invoice-print-document.invoice-template-atelier .simple-invoice-details > div{
  background:#f7e9fb!important;
  border:0!important;
  margin-right:10px!important;
}
#invoice-print-document.invoice-template-atelier .simple-service-table th,
#invoice-print-document.invoice-template-atelier .simple-time-table th{
  background:transparent!important;
  color:#171717!important;
  border:0!important;
  border-bottom:2px solid #e95a25!important;
}
#invoice-print-document.invoice-template-atelier .simple-service-table tbody tr:nth-child(odd),
#invoice-print-document.invoice-template-atelier .simple-time-table tbody tr:nth-child(odd){
  background:#f7e9fb!important;
}
#invoice-print-document.invoice-template-atelier .simple-service-table td,
#invoice-print-document.invoice-template-atelier .simple-time-table td{
  border:0!important;
}
#invoice-print-document.invoice-template-atelier .simple-invoice-summary,
#invoice-print-document.invoice-template-atelier .reference-timesheet-bottom{
  background:#f7e9fb!important;
  border:0!important;
}

.timesheet-week-totals{margin-top:14px;border-top:2px solid currentColor;font-size:10pt}
.timesheet-week-total-row,.timesheet-all-weeks-total-row{display:flex;justify-content:space-between;gap:18px;padding:8px 10px}
.timesheet-week-total-row{border-bottom:1px solid rgba(90,105,110,.25)}
.timesheet-all-weeks-total-row{font-weight:800;border-top:1px solid currentColor}
#invoice-print-document.invoice-template-structured .timesheet-all-weeks-total-row{background:#374b51;color:#fff}
#invoice-print-document.invoice-template-minimal .timesheet-week-totals{color:#557277}
#invoice-print-document.invoice-template-atelier .timesheet-all-weeks-total-row{background:#f7e9fb;color:#171717}

/* v17 actual preset colors follow Theme Designer canonical invoice colors */
#invoice-print-document .h-sheet{background:var(--h-paper)!important;color:var(--h-text)!important}
#invoice-print-document.invoice-template-minimal .h-invoice-title,#invoice-print-document.invoice-template-minimal .h-timesheet-title,#invoice-print-document.invoice-template-minimal th{color:var(--h-accent)!important}
#invoice-print-document.invoice-template-minimal .simple-invoice-header,#invoice-print-document.invoice-template-minimal .simple-timesheet-header,#invoice-print-document.invoice-template-minimal th{border-color:var(--h-header)!important}
#invoice-print-document.invoice-template-structured .simple-invoice-header,#invoice-print-document.invoice-template-structured .simple-timesheet-header,#invoice-print-document.invoice-template-structured th,#invoice-print-document.invoice-template-structured .timesheet-all-weeks-total-row{background:var(--h-accent)!important;color:var(--h-total-text)!important}
#invoice-print-document.invoice-template-structured .simple-invoice-details,#invoice-print-document.invoice-template-structured table,#invoice-print-document.invoice-template-structured th,#invoice-print-document.invoice-template-structured td{border-color:var(--h-accent)!important}
#invoice-print-document.invoice-template-structured .simple-invoice-summary{background:var(--h-header)!important}
#invoice-print-document.invoice-template-structured .simple-total-due{background:var(--h-total-fill)!important;color:var(--h-total-text)!important}
#invoice-print-document.invoice-template-atelier .h-invoice-sheet,#invoice-print-document.invoice-template-atelier .h-timesheet-sheet{background:var(--h-paper)!important;color:var(--h-text)!important}
#invoice-print-document.invoice-template-atelier .h-invoice-sheet::before,#invoice-print-document.invoice-template-atelier .h-timesheet-sheet::before{background:var(--h-header)!important;border-color:var(--h-accent)!important;color:var(--h-accent)!important}
#invoice-print-document.invoice-template-atelier .simple-invoice-details>div,#invoice-print-document.invoice-template-atelier tbody tr:nth-child(odd),#invoice-print-document.invoice-template-atelier .simple-invoice-summary,#invoice-print-document.invoice-template-atelier .reference-timesheet-bottom,#invoice-print-document.invoice-template-atelier .timesheet-all-weeks-total-row{background:var(--h-header)!important}
#invoice-print-document.invoice-template-atelier th{border-color:var(--h-accent)!important}

/* Theme Designer template-aware preview */
.theme-preview-heading{display:flex;justify-content:space-between;gap:14px;align-items:flex-start;margin-bottom:14px}.theme-preview-template-label{display:grid;gap:5px;min-width:220px;font-size:.72rem;font-weight:800;text-transform:uppercase}.theme-invoice-preview{--tp-paper:#fff;--tp-text:#111827;--tp-accent:#047857;--tp-header:#ecfdf5;--tp-total-fill:#064e3b;--tp-total-text:#fff;background:var(--tp-paper)!important;color:var(--tp-text)!important}.theme-preview-doc{position:relative;background:var(--tp-paper);border:1px solid color-mix(in srgb,var(--tp-accent) 45%,transparent);padding:14px;margin-bottom:12px;overflow:hidden}.theme-preview-week-total,.theme-preview-all-total{display:flex;justify-content:space-between;padding:7px;font-size:.72rem}.theme-preview-all-total{font-weight:800}
.theme-template-minimal .theme-preview-header,.theme-template-minimal .theme-preview-timesheet-title{background:transparent!important;border-bottom:3px solid var(--tp-header)}.theme-template-minimal .theme-preview-table-head{background:transparent;color:var(--tp-accent);border-top:2px solid var(--tp-header);border-bottom:2px solid var(--tp-header)}
.theme-template-structured .theme-preview-header,.theme-template-structured .theme-preview-timesheet-title,.theme-template-structured .theme-preview-table-head{background:var(--tp-accent)!important;color:var(--tp-total-text)!important;padding:8px}.theme-template-structured .theme-preview-header *{color:var(--tp-total-text)!important}.theme-template-structured .theme-preview-all-total{background:var(--tp-total-fill);color:var(--tp-total-text)}
.theme-template-atelier .theme-preview-doc{padding-left:58px}.theme-template-atelier .theme-preview-doc:before{content:"TORABÉ";position:absolute;left:0;top:0;bottom:0;width:42px;background:var(--tp-header);border-right:3px solid var(--tp-accent);color:var(--tp-accent);writing-mode:vertical-rl;transform:rotate(180deg);display:flex;align-items:center;justify-content:center;font-weight:800}.theme-template-atelier .theme-preview-table-head,.theme-template-atelier .theme-preview-all-total{background:var(--tp-header);color:var(--tp-text)}
@media(max-width:700px){.theme-preview-heading{display:grid}.theme-preview-template-label{min-width:0}}

/* v18: layout editing retired; preset + theme designer are the customization path */
#invoice-layout-edit-btn,#invoice-layout-designer,#layout-floating-toolbar,.invoice-layout-overlay-layer{display:none!important}

/* v18: each timesheet page is one custom 'week' of up to 7 unique work dates */
.timesheet-week-total-row span,.timesheet-all-weeks-total-row span{font-weight:800}


/* ============================================================
   v20 — Google-Sheets-inspired sticky Punch Clock
   ============================================================ */
#view-punchclock .view-header{max-width:920px;margin-left:auto;margin-right:auto}
.punch-google-card{
  max-width:820px;
  margin:22px auto;
  padding:38px 38px 34px;
  border-radius:24px;
  background:var(--surface-background,#1e293b);
  border:1px solid var(--border-color,#334155);
  box-shadow:0 18px 46px rgba(0,0,0,.16);
}
.punch-google-kicker{
  text-align:center;
  color:var(--success-color,#10b981);
  font-size:14px;
  font-weight:900;
  letter-spacing:.16em;
  text-transform:uppercase;
}
.punch-google-title{
  text-align:center;
  margin:8px 0 6px;
  font-size:25px;
  color:var(--primary-text,#f1f5f9);
}
.punch-google-subtitle{
  max-width:650px;
  margin:0 auto 26px;
  text-align:center;
  color:var(--muted-text,#94a3b8);
  font-size:15px;
  line-height:1.35;
}
.punch-google-timer-panel{
  border-radius:18px;
  padding:30px 20px 25px;
  margin-bottom:28px;
  text-align:center;
  background:var(--canvas-background,#0f172a);
  border:1px solid var(--border-subtle,#243247);
}
.punch-google-idle-time{
  color:var(--success-color,#10b981);
  font-size:58px;
  line-height:1;
  font-weight:900;
  letter-spacing:.02em;
}
.punch-google-ready{
  margin-top:14px;
  color:var(--muted-text,#94a3b8);
  font-weight:800;
  letter-spacing:.14em;
  font-size:13px;
}
.punch-google-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:18px 20px;
}
.punch-google-form label{
  display:block;
  margin-bottom:7px;
  font-size:15px;
  font-weight:800;
}
.punch-label-row{display:flex;align-items:center;justify-content:space-between;gap:12px}
.punch-inline-link{
  border:0;background:transparent;color:var(--success-color,#10b981);
  cursor:pointer;font:700 12px/1 system-ui,sans-serif;padding:3px 0;
}
.punch-optional{
  margin-left:5px;
  color:var(--muted-text,#94a3b8);
  font-size:11px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.06em;
}
.punch-google-task{margin-top:18px}
.punch-google-start{
  width:100%;
  margin-top:24px;
  min-height:58px;
  border:0;
  border-radius:16px;
  background:var(--success-color,#10b981);
  color:#06281d;
  font-size:18px;
  font-weight:900;
  cursor:pointer;
}
.punch-google-start:hover{filter:brightness(1.04)}
.punch-defaults-strip{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  margin-top:15px;
}
.punch-defaults-strip span{
  display:inline-flex;
  align-items:center;
  padding:5px 9px;
  border-radius:7px;
  border:1px solid color-mix(in srgb,var(--accent-primary,#8b5cf6) 45%,transparent);
  background:color-mix(in srgb,var(--accent-primary,#8b5cf6) 14%,transparent);
  color:var(--secondary-text,#cbd5e1);
  font-size:11px;
}
@media(max-width:760px){
  .punch-google-card{padding:26px 18px;border-radius:16px}
  .punch-google-grid{grid-template-columns:1fr}
  .punch-google-idle-time{font-size:46px}
}

/* v21 auto-invoice hint */
#punch-invoice-hint{
  min-height:2.6em;
}
#punch-invoice-id option[value=""]{
  font-weight:700;
}

/* Phase I9 cross-device recovery */
.sync-recovery-note{margin-top:12px;padding:10px 12px;border:1px solid var(--border-subtle,#334155);border-radius:8px;background:color-mix(in srgb,var(--accent-primary,#8b5cf6) 7%,transparent)}

/* Phase J v3: phone layout; printed documents retain their existing geometry. */
@media screen and (max-width: 800px) {
  .app-layout { flex-direction: column; }
  .sidebar { width: 100%; padding: 16px; border-right: 0; border-bottom: 1px solid var(--border-color); }
  .brand { margin-bottom: 8px; }
  .sidebar-status-container { margin-bottom: 12px; }
  .sidebar-nav { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
  .nav-item { min-height: 44px; padding: 10px; gap: 7px; overflow-wrap: anywhere; }
  .sidebar-footer { margin-top: 12px; padding-top: 8px; }
  .main-content { width: 100%; min-width: 0; max-width: 100%; padding: 20px 12px; overflow-x: hidden; }
  .view-header, .table-header-row { flex-wrap: wrap; gap: 12px; }
  .section-card { padding: 16px; }
  .form-grid-2, .form-grid-3, .timesheet-filter-grid, .clients-grid { grid-template-columns: minmax(0,1fr); }
  .metrics-grid { grid-template-columns: minmax(0,1fr); }
  .table-responsive { width: 100%; max-width: 100%; overflow-x: auto; }
  .table-controls, .modal-footer { flex-wrap: wrap; }
  .sync-runtime-row, .sync-recovery-note { overflow-wrap: anywhere; }
  .sync-settings-grid > *, .form-group, .form-row { min-width: 0; }
  input, select, textarea { max-width: 100%; font-size: 16px; }
  .btn, button { min-height: 44px; }
  .modal-backdrop { padding: 12px; }
  .modal-dialog { max-width: 100%; max-height: 90vh; max-height: 90dvh; overflow-y: auto; }
}
