/* =====================================================================
   Dental Tech Tracker — Mobile-first CSS
   ===================================================================== */

:root {
  --dtt-green:       #009fb7;
  --dtt-green-light: #33b5c8;
  --dtt-green-bg:    #009fb7;
  --dtt-green-dark:  #007a8c;
  --dtt-orange:      #e65100;
  --dtt-orange-bg:   #f57c00;
  --dtt-red:         #c62828;
  --dtt-gray:        #f4f6f8;
  --dtt-border:      #e0e0e0;
  --dtt-text:        #212121;
  --dtt-text-light:  #757575;
  --dtt-radius:      10px;
  --dtt-shadow:      0 2px 12px rgba(0,0,0,0.10);
}

/* ── Base reset ───────────────────────────────────────────────────── */
#dtt-app, #dtt-login-wrap {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  color: var(--dtt-text);
  background: var(--dtt-gray);
  min-height: 100vh;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}
#dtt-app *, #dtt-login-wrap * { box-sizing: border-box; }

/* ── Login ────────────────────────────────────────────────────────── */
#dtt-login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--dtt-green) 0%, var(--dtt-green-dark) 100%);
  min-height: 100vh;
  padding: 20px;
}
.dtt-login-card {
  background: #fff;
  border-radius: 18px;
  padding: 36px 28px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
.dtt-login-logo { text-align: center; margin-bottom: 20px; }
.dtt-login-logo img { max-width: 180px; width: 100%; height: auto; display: inline-block; }
.dtt-login-card h2 { text-align: center; margin: 0 0 24px; font-size: 22px; color: var(--dtt-green); }
.dtt-login-error {
  background: #ffebee;
  color: var(--dtt-red);
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 14px;
}

/* ── Earnings bar ─────────────────────────────────────────────────── */
.dtt-earnings-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: #fff;
  border-bottom: 2px solid var(--dtt-border);
}
.dtt-earn-item {
  background: var(--dtt-green-bg);
  color: #fff;
  padding: 12px 14px;
  border-right: 1px solid rgba(255,255,255,0.3);
}
.dtt-earn-item:nth-child(2) { border-right: none; }
.dtt-earn-item.dtt-earn-orange { background: var(--dtt-orange-bg); }
.dtt-earn-item:nth-child(4)  { border-right: none; }
.dtt-earn-amount { display: block; font-size: 18px; font-weight: 700; }
.dtt-earn-label  { display: block; font-size: 11px; opacity: 0.9; margin-top: 2px; }

/* ── Tabs ─────────────────────────────────────────────────────────── */
.dtt-tabs {
  display: flex;
  background: #fff;
  border-bottom: 2px solid var(--dtt-border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.dtt-tab {
  flex: 1;
  min-width: 100px;
  padding: 14px 10px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  background: none;
  color: var(--dtt-text-light);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all .2s;
  white-space: nowrap;
}
.dtt-tab.active {
  color: var(--dtt-green);
  border-bottom-color: var(--dtt-green);
  font-weight: 700;
}

/* ── Tab content ──────────────────────────────────────────────────── */
.dtt-tab-content { display: none; padding: 14px; }
.dtt-tab-content.active { display: block; }
.dtt-section-title { font-size: 20px; font-weight: 700; margin: 0 0 14px; }

/* ── Filters ──────────────────────────────────────────────────────── */
.dtt-filters {
  background: #fff;
  border-radius: var(--dtt-radius);
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: var(--dtt-shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── Date fields — each one its own full-width row ────────────────── */
.dtt-date-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dtt-date-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
}
.dtt-date-field label {
  display: block;
  font-size: 12px;
  color: var(--dtt-green);
  font-weight: 600;
}

/* Custom date picker wrapper — hides the native date input and shows a
   styled text display so the format is always YYYY-MM-DD regardless of
   the device locale. */
.dtt-datepicker {
  position: relative;
  width: 100%;
}
.dtt-datepicker-display {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--dtt-border);
  border-radius: 8px;
  font-size: 15px;
  background: #fafafa;
  color: var(--dtt-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  -webkit-user-select: none;
}
.dtt-datepicker-display:focus { outline: 2px solid var(--dtt-green); }
.dtt-datepicker-display .dtt-dp-icon { font-size: 16px; opacity: 0.55; flex-shrink: 0; }
.dtt-datepicker-display .dtt-dp-val { flex: 1; }
/* The actual native input sits on top, invisible, to trigger the OS picker */
.dtt-datepicker input[type="date"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  font-size: 15px;
  border: none;
  background: transparent;
  z-index: 2;
}

/* ── Search row ───────────────────────────────────────────────────── */
.dtt-search-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.dtt-search-row .dtt-input { flex: 1; }

/* ── Form controls ────────────────────────────────────────────────── */
.dtt-input, .dtt-select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--dtt-border);
  border-radius: 8px;
  font-size: 15px;
  background: #fafafa;
  color: var(--dtt-text);
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  transition: border-color .2s;
}
.dtt-input:focus, .dtt-select:focus { border-color: var(--dtt-green); background: #fff; }
.dtt-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath fill='%23757575' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 36px;
}
.dtt-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.dtt-field label, .dtt-field-label-green {
  font-size: 12px;
  font-weight: 600;
  color: var(--dtt-green);
  display: block;
  margin-bottom: 2px;
}

/* ── Buttons ──────────────────────────────────────────────────────── */
.dtt-btn {
  padding: 12px 18px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}
.dtt-btn:active { transform: scale(0.97); }
.dtt-btn-primary  { background: var(--dtt-green); color: #fff; }
.dtt-btn-primary:hover { background: var(--dtt-green-dark); }
.dtt-btn-outline  { background: #fff; color: var(--dtt-green); border: 2px solid var(--dtt-green); }
.dtt-btn-danger   { background: var(--dtt-red); color: #fff; }
.dtt-btn-icon     { background: var(--dtt-green); color: #fff; padding: 11px 14px; }
.dtt-btn-sm       { padding: 8px 12px; font-size: 13px; border-radius: 6px; background: var(--dtt-green); color: #fff; }
.dtt-btn-full     { width: 100%; }

/* ── Table ────────────────────────────────────────────────────────── */
.dtt-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--dtt-radius);
  box-shadow: var(--dtt-shadow);
}
.dtt-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 13px;
}
.dtt-table thead tr {
  background: #f5f5f5;
  border-bottom: 2px solid var(--dtt-border);
}
.dtt-table th {
  padding: 10px 10px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: var(--dtt-text-light);
  white-space: nowrap;
}
.dtt-table td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--dtt-border);
  vertical-align: top;
  font-size: 13px;
}
.dtt-table tr:last-child td { border-bottom: none; }
.dtt-table tr.dtt-row-clickable { cursor: pointer; }
.dtt-table tr.dtt-row-clickable:hover td { background: #e0f7fa; }
.dtt-table tr.dtt-row-delayed td { color: var(--dtt-red); }
.dtt-table tr.dtt-row-delayed .dtt-status-badge { background: var(--dtt-red); }
.dtt-table a.dtt-row-link { color: var(--dtt-orange-bg); text-decoration: none; font-weight: 600; }
.dtt-table tfoot tr td { font-weight: 700; border-top: 2px solid var(--dtt-border); background: #f5f5f5; }
.dtt-loading { text-align: center; color: var(--dtt-text-light); padding: 30px !important; }

/* Status badges */
.dtt-status-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.dtt-status-in_progress { background: #fff3e0; color: var(--dtt-orange-bg); }
.dtt-status-done        { background: #e0f7fa; color: var(--dtt-green-dark); }
.dtt-status-delayed     { background: #ffebee; color: var(--dtt-red); }

/* ── FAB ──────────────────────────────────────────────────────────── */
.dtt-fab {
  position: fixed;
  bottom: 28px;
  right: 20px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--dtt-green);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  border: none;
  box-shadow: 0 4px 16px rgba(0,159,183,0.38);
  cursor: pointer;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s;
}
.dtt-fab:active { transform: scale(0.93); }

/* ── Modal ────────────────────────────────────────────────────────── */
.dtt-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1100;
}
.dtt-modal {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1200;
  max-height: 92vh;
  border-radius: 18px 18px 0 0;
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: dtt-slide-up .25s ease;
}
@keyframes dtt-slide-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.dtt-modal-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 92vh;
  overflow: hidden;
}
.dtt-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--dtt-border);
  flex-shrink: 0;
}
.dtt-modal-header span { font-size: 17px; font-weight: 700; }
.dtt-modal-header-actions { display: flex; gap: 8px; }
.dtt-modal-star, .dtt-modal-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--dtt-text-light);
  padding: 4px;
}
.dtt-modal-tabs {
  display: flex;
  border-bottom: 2px solid var(--dtt-border);
  flex-shrink: 0;
}
.dtt-modal-tab {
  flex: 1;
  padding: 12px 8px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  color: var(--dtt-text-light);
  transition: all .2s;
}
.dtt-modal-tab.active {
  color: var(--dtt-orange-bg);
  border-bottom-color: var(--dtt-orange-bg);
}
.dtt-modal-section {
  display: none;
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}
.dtt-modal-section.active { display: block; }
.dtt-modal-footer {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--dtt-border);
  background: #fff;
  flex-shrink: 0;
}
.dtt-modal-footer .dtt-btn { flex: 1; }
.dtt-modal-footer .dtt-btn-icon { flex: 0 0 auto; }

/* ── Product items in modal ───────────────────────────────────────── */
.dtt-product-item {
  border: 1.5px solid var(--dtt-border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
  background: #fafafa;
}
.dtt-qty-price-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
.dtt-qty-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}
.dtt-qty-wrap input {
  width: 64px;
  min-width: 64px;
  flex-shrink: 0;
  text-align: center;
  /* Override the dtt-input width:100% */
  max-width: 64px;
}
.dtt-price-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}
.dtt-price-wrap input { flex: 1; min-width: 0; }
.dtt-color-photo-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.dtt-color-photo-row .dtt-input { flex: 1; }
.pi-remove-btn { margin-top: 6px; background: #fff; color: var(--dtt-red); border: 1.5px solid var(--dtt-red) !important; }

/* ── Checkbox field ───────────────────────────────────────────────── */
.dtt-checkbox-field {
  flex-direction: row !important;
  align-items: center;
  gap: 10px !important;
}
.dtt-checkbox-field label {
  color: var(--dtt-text) !important;
  font-size: 15px !important;
  font-weight: 500 !important;
}
.dtt-checkbox-field input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--dtt-green); }

/* ── Supervisor-only elements ─────────────────────────────────────── */
.dtt-supervisor-only { display: none; }
body.dtt-is-supervisor .dtt-supervisor-only { display: block; }

/* ── Responsive tweaks ────────────────────────────────────────────── */
@media (max-width: 420px) {
  .dtt-tab  { padding: 12px 6px; font-size: 12px; }
  .dtt-earn-amount { font-size: 16px; }
  .dtt-modal-footer { flex-wrap: wrap; }
}
@media (min-width: 768px) {
  .dtt-modal {
    bottom: auto;
    top: 50%;
    left: 50%;
    right: auto;
    transform: translate(-50%, -50%);
    border-radius: 18px;
    width: 520px;
    max-height: 85vh;
    animation: dtt-fade-in .2s ease;
  }
  @keyframes dtt-fade-in {
    from { opacity: 0; transform: translate(-50%, -48%); }
    to   { opacity: 1; transform: translate(-50%, -50%); }
  }
}

/* =====================================================================
   Admin Slide-in Drawer
   ===================================================================== */

/* Hidden for non-admins; shown via JS body class */
.dtt-admin-only { display: none !important; }
body.dtt-is-admin .dtt-admin-only { display: flex !important; }
body.dtt-is-admin button.dtt-admin-only { display: flex !important; }

/* Hamburger button — fixed top-left */
.dtt-menu-btn {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 900;
  width: 44px;
  height: 44px;
  background: var(--dtt-green);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-shadow: 0 2px 8px rgba(0,159,183,0.35);
  padding: 10px;
}
.dtt-menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all .25s;
}
body.dtt-drawer-open .dtt-menu-btn span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.dtt-drawer-open .dtt-menu-btn span:nth-child(2) { opacity: 0; }
body.dtt-drawer-open .dtt-menu-btn span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Overlay */
.dtt-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1050;
}
body.dtt-drawer-open .dtt-drawer-overlay { display: block; }

/* Drawer panel */
.dtt-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 300px;
  max-width: 88vw;
  background: #fff;
  z-index: 1060;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  box-shadow: 4px 0 24px rgba(0,0,0,0.18);
  overflow: hidden;
}
body.dtt-is-admin .dtt-drawer { display: flex !important; }
body.dtt-drawer-open .dtt-drawer { transform: translateX(0); }

/* Drawer header */
.dtt-drawer-header {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-height: 150px;
  min-height: 80px;
  padding: 16px;
  background: var(--dtt-green);
  flex-shrink: 0;
  position: relative;
}
.dtt-drawer-logo { max-height: 100px; max-width: 80%; width: auto; object-fit: contain; filter: brightness(0) invert(1); }
.dtt-drawer-close {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  font-size: 15px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 8px;
  right: 8px;
}

/* Side nav */
.dtt-drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 8px;
  background: #f8f9fa;
  border-bottom: 1px solid var(--dtt-border);
  flex-shrink: 0;
}
.dtt-drawer-nav-btn {
  background: none;
  border: none;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  color: var(--dtt-text);
  transition: background .15s, color .15s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dtt-drawer-nav-btn:hover { background: #e0f7fa; }
.dtt-drawer-nav-btn.active { background: var(--dtt-green); color: #fff; font-weight: 700; }

/* Panels */
.dtt-drawer-panel {
  display: none;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  overflow-y: auto;
  flex: 1;
}
.dtt-drawer-panel.active { display: flex; }
.dtt-drawer-panel h3 { margin: 0 0 4px; font-size: 16px; color: var(--dtt-green); }

/* Admin list items */
.dtt-adm-list { display: flex; flex-direction: column; gap: 6px; }
.dtt-adm-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8f9fa;
  border: 1px solid var(--dtt-border);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 14px;
  gap: 8px;
}
.dtt-adm-item.inactive { opacity: 0.5; }
.dtt-adm-item-name { flex: 1; font-weight: 500; }
.dtt-adm-item-sub { font-size: 11px; color: var(--dtt-text-light); }
.dtt-adm-item-actions { display: flex; gap: 6px; flex-shrink: 0; }
.dtt-adm-edit-btn, .dtt-adm-del-btn {
  border: none;
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 600;
}
.dtt-adm-edit-btn { background: #e0f7fa; color: var(--dtt-green-dark); }
.dtt-adm-del-btn  { background: #ffebee; color: var(--dtt-red); }

/* Admin inline form */
.dtt-adm-form {
  display: none;
  flex-direction: column;
  gap: 8px;
  background: #f0fbfc;
  border: 1.5px solid var(--dtt-green);
  border-radius: 10px;
  padding: 12px;
}
.dtt-adm-form.open { display: flex; }
.dtt-adm-form-btns { display: flex; gap: 8px; }
.dtt-adm-form-btns .dtt-btn { flex: 1; padding: 10px; font-size: 14px; }
.dtt-adm-check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.dtt-adm-check input { width: 18px; height: 18px; accent-color: var(--dtt-green); }
.dtt-adm-price-row { display: flex; align-items: center; gap: 6px; }
.dtt-adm-price-row .dtt-input { flex: 1; }
.dtt-adm-hint { font-size: 13px; color: var(--dtt-text-light); margin: 0; }

/* Prices panel table */
.dtt-adm-prices-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dtt-adm-prices-table th { text-align: left; padding: 6px 8px; font-size: 11px; color: var(--dtt-text-light); border-bottom: 1px solid var(--dtt-border); }
.dtt-adm-prices-table td { padding: 6px 8px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.dtt-adm-prices-table input { width: 80px; padding: 5px 7px; border: 1px solid var(--dtt-border); border-radius: 6px; font-size: 13px; }

/* ── Summary panels ───────────────────────────────────────────────── */
.dtt-adm-summary-content { font-size: 13px; }

.dtt-summary-tech-block {
  background: #f8f9fa;
  border: 1px solid var(--dtt-border);
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}
.dtt-summary-tech-header {
  background: var(--dtt-green);
  color: #fff;
  padding: 8px 12px;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dtt-summary-tech-header span { font-size: 12px; opacity: .85; font-weight: 400; }

.dtt-summary-clinic-block {
  background: #f8f9fa;
  border: 1px solid var(--dtt-border);
  border-radius: 8px;
  margin-bottom: 16px;
  overflow: hidden;
  page-break-inside: avoid;
}
.dtt-summary-clinic-header {
  background: var(--dtt-orange-bg);
  color: #fff;
  padding: 8px 12px;
  font-weight: 700;
  font-size: 14px;
}

.dtt-sum-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.dtt-sum-table th {
  background: #f0f0f0;
  padding: 5px 8px;
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  color: var(--dtt-text-light);
  border-bottom: 1px solid var(--dtt-border);
}
.dtt-sum-table td {
  padding: 5px 8px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: top;
}
.dtt-sum-table tfoot td {
  font-weight: 700;
  background: #f5f5f5;
  border-top: 2px solid var(--dtt-border);
}
.dtt-sum-total-row {
  padding: 8px 12px;
  font-weight: 700;
  font-size: 13px;
  color: var(--dtt-green-dark);
  border-top: 1px solid var(--dtt-border);
  text-align: right;
}

/* ── Print styles ─────────────────────────────────────────────────── */
@media print {
  body > *:not(#dtt-print-area) { display: none !important; }
  #dtt-print-area {
    display: block !important;
    position: fixed;
    inset: 0;
    background: #fff;
    padding: 20px;
    font-family: Arial, sans-serif;
    font-size: 12px;
    z-index: 99999;
  }
  .dtt-print-header { margin-bottom: 16px; }
  .dtt-print-header h2 { font-size: 18px; margin: 0 0 4px; }
  .dtt-print-header p  { font-size: 12px; color: #666; margin: 0; }
  .dtt-summary-tech-block,
  .dtt-summary-clinic-block { page-break-inside: avoid; margin-bottom: 16px; }
  .dtt-summary-tech-header { background: #009fb7 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .dtt-summary-clinic-header { background: #f57c00 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .no-print { display: none !important; }
}

/* ── Invoice styles ───────────────────────────────────────────────── */
.dtt-inv-tasks-list { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow-y: auto; }
.dtt-inv-task-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: #f8f9fa;
  border: 1px solid var(--dtt-border);
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 13px;
}
.dtt-inv-task-row input[type=checkbox] { margin-top: 2px; accent-color: var(--dtt-green); width:16px;height:16px;flex-shrink:0; }
.dtt-inv-task-info { flex:1; }
.dtt-inv-task-num  { font-weight:700; color:var(--dtt-green); }
.dtt-inv-task-sub  { font-size:11px; color:var(--dtt-text-light); }

.dtt-inv-items-table { width:100%; border-collapse:collapse; font-size:13px; margin:4px 0; }
.dtt-inv-items-table th { background:#f0f0f0; padding:5px 8px; font-size:11px; color:var(--dtt-text-light); text-align:left; border-bottom:1px solid var(--dtt-border); }
.dtt-inv-items-table td { padding:5px 8px; border-bottom:1px solid #f5f5f5; }
.dtt-inv-items-table tfoot td { font-weight:700; background:#f5f5f5; border-top:2px solid var(--dtt-border); }

.dtt-inv-saved-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8f9fa;
  border: 1px solid var(--dtt-border);
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 13px;
  gap: 6px;
}
.dtt-inv-saved-num  { font-weight:700; color:var(--dtt-green); }
.dtt-inv-saved-sub  { font-size:11px; color:var(--dtt-text-light); display:block; }
.dtt-inv-status-draft  { color: var(--dtt-text-light); }
.dtt-inv-status-sent   { color: var(--dtt-orange-bg); }
.dtt-inv-status-paid   { color: var(--dtt-green); }
.dtt-inv-actions { display:flex; gap:4px; flex-shrink:0; }
.dtt-inv-actions button { border:none; border-radius:5px; padding:4px 8px; font-size:12px; cursor:pointer; }

/* ── Print invoice ────────────────────────────────────────────────── */
#dtt-invoice-print-area { display: none; }
@media print {
  body > *:not(#dtt-invoice-print-area):not(#dtt-print-area) { display: none !important; }
  #dtt-invoice-print-area, #dtt-print-area {
    display: block !important;
    position: fixed;
    inset: 0;
    background: #fff;
    padding: 24px 32px;
    font-family: Arial, sans-serif;
    font-size: 13px;
    color: #222;
    z-index: 99999;
  }
  .inv-header { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:24px; }
  .inv-logo img { max-height:48px; }
  .inv-title h1 { font-size:22px; color:#009fb7; margin:0; }
  .inv-title p  { font-size:13px; color:#666; margin:2px 0 0; }
  .inv-parties { display:grid; grid-template-columns:1fr 1fr; gap:24px; margin-bottom:20px; }
  .inv-party h4 { margin:0 0 4px; font-size:12px; text-transform:uppercase; color:#009fb7; letter-spacing:.5px; }
  .inv-party p  { margin:0; line-height:1.6; font-size:13px; }
  .inv-table { width:100%; border-collapse:collapse; margin-bottom:16px; }
  .inv-table thead tr { background:#009fb7; color:#fff; -webkit-print-color-adjust:exact; print-color-adjust:exact; }
  .inv-table th, .inv-table td { padding:7px 10px; text-align:left; border-bottom:1px solid #e0e0e0; }
  .inv-table tfoot tr { background:#f5f5f5; font-weight:700; }
  .inv-total-box { text-align:right; font-size:16px; font-weight:700; margin-top:8px; }
  .inv-notes { color:#666; font-size:12px; margin-top:12px; }
  .inv-footer { margin-top:32px; text-align:center; font-size:11px; color:#999; border-top:1px solid #eee; padding-top:10px; }
}

/* ── Custom CSS editor ────────────────────────────────────────────── */
.dtt-css-editor {
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
  line-height: 1.6;
  resize: vertical;
  min-height: 160px;
  background: #1e1e2e;
  color: #cdd6f4;
  border-color: #45475a;
  border-radius: 8px;
  padding: 10px 12px;
}
.dtt-css-editor:focus {
  border-color: var(--dtt-green);
  background: #1e1e2e;
  outline: none;
}
