/* Driftio – lys, dempet, tekstdrevet UI */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #FAFAF7;
  --surface: #FFFFFF;
  --surface-alt: #F5F4EE;
  --ink: #1A1A1A;
  --muted: #6B6B6B;
  --subtle: #9A9A95;
  --border: #E8E5DC;
  --border-strong: #D5D2C8;
  --rust: #B8482E;
  --rust-soft: #F4E5E0;
  --moss: #2D7A4D;
  --moss-soft: #E1EDE6;
  --amber: #B89139;
  --amber-soft: #F4ECD8;
  --sans: 'Geist', 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --header-h: 56px;
  --radius: 6px;
  --radius-lg: 10px;
}

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body {
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: env(safe-area-inset-bottom);
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
a { color: var(--ink); text-decoration: none; }

/* ─────── HEADER ─────── */
.dft-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0 16px;
  padding-top: env(safe-area-inset-top);
  height: calc(var(--header-h) + env(safe-area-inset-top));
}
.dft-brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}
.dft-logo {
  font-family: var(--sans);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.dft-logo-rust { color: var(--rust); }
.dft-vessel {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 14px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 50vw;
}
.dft-icon-btn {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 20px;
  transition: background 120ms ease;
}
.dft-icon-btn:hover { background: var(--surface-alt); }
.dft-icon-btn:active { background: var(--border); }

/* ─────── SEARCH ─────── */
.dft-search {
  position: sticky;
  top: calc(var(--header-h) + env(safe-area-inset-top));
  z-index: 25;
  background: var(--bg);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}
.dft-search-icon {
  position: absolute;
  left: 30px;
  font-size: 16px;
  color: var(--subtle);
  pointer-events: none;
}
.dft-search-input {
  width: 100%;
  height: 44px;
  padding: 0 14px 0 42px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 16px;
  color: var(--ink);
  outline: none;
  transition: border-color 120ms ease;
}
.dft-search-input:focus { border-color: var(--ink); }
.dft-search-input::placeholder { color: var(--subtle); }
.dft-search-input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* ─────── MAIN ─────── */
.dft-main {
  padding: 16px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}
@media (min-width: 768px) {
  .dft-main { max-width: 720px; margin: 0 auto; }
  .dft-main.dft-main-wide { max-width: 1080px; }
  .dft-main.dft-main-full { max-width: 1280px; }
}

.dft-section { margin-bottom: 28px; }
.dft-section:last-child { margin-bottom: 0; }
.dft-section[hidden] { display: none; }

.dft-section-title {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
  padding-left: 2px;
}

/* ─────── ROW (equipment/due-today) ─────── */
.dft-row {
  display: flex;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 6px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}
.dft-row:hover { border-color: var(--border-strong); }
.dft-row:active { background: var(--surface-alt); }
.dft-row-status {
  width: 4px;
  flex-shrink: 0;
  background: var(--border);
}
.dft-row.is-late .dft-row-status { background: var(--rust); }
.dft-row.is-soon .dft-row-status { background: var(--amber); }
.dft-row.is-ok .dft-row-status { background: var(--moss); }
.dft-row-body {
  flex: 1;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.dft-row-info { flex: 1; min-width: 0; }
.dft-row-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dft-row-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dft-row-right {
  text-align: right;
  flex-shrink: 0;
}
.dft-row-tag {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.dft-row-tag.is-late { color: var(--rust); }
.dft-row-tag.is-soon { color: var(--amber); }
.dft-row-tag.is-ok { color: var(--moss); }
.dft-row-sub {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--subtle);
  margin-top: 2px;
}

/* ─────── BADGES ─────── */
.dft-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.dft-badge.is-late { background: var(--rust-soft); color: var(--rust); }
.dft-badge.is-soon { background: var(--amber-soft); color: var(--amber); }
.dft-badge.is-active { background: var(--moss-soft); color: var(--moss); }
.dft-badge.is-admin { background: var(--rust-soft); color: var(--rust); }
.dft-badge.is-neutral { background: var(--surface-alt); color: var(--muted); }

.dft-sfi {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  padding: 1px 5px;
  background: var(--surface-alt);
  border-radius: 3px;
  border: 1px solid var(--border);
  margin-right: 4px;
}

.dft-card-critical {
  border-left: 2px solid #B8482E;
  padding-left: 13px;
}

.dft-tag-critical {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  color: #B8482E;
  background: var(--rust-soft);
  padding: 1px 5px;
  border-radius: 3px;
  margin-right: 4px;
  letter-spacing: 0.02em;
}

/* ─────── ACTIVE PULSE ─────── */
.dft-pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--moss);
  flex-shrink: 0;
  animation: dft-pulse 1.8s ease-in-out infinite;
}
@keyframes dft-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(45, 122, 77, 0.4); opacity: 1; }
  50%      { box-shadow: 0 0 0 6px rgba(45, 122, 77, 0); opacity: 0.7; }
}

/* ─────── ACTIVE CARD ─────── */
.dft-active-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--moss);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: border-color 120ms ease;
}
.dft-active-card:hover { border-color: var(--border-strong); border-left-color: var(--moss); }
.dft-active-card-info { flex: 1; min-width: 0; }
.dft-active-card-title {
  font-weight: 600;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dft-active-card-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dft-active-card-time {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--moss);
  font-weight: 600;
  flex-shrink: 0;
}

/* ─────── EMPTY / LOADING ─────── */
.dft-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--subtle);
  font-size: 13px;
}
.dft-empty i {
  display: block;
  font-size: 28px;
  margin-bottom: 6px;
  opacity: 0.5;
}
.dft-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px 0;
  color: var(--muted);
  font-size: 13px;
}
.dft-spin { display: inline-block; animation: dft-spin 1s linear infinite; }
@keyframes dft-spin { to { transform: rotate(360deg); } }

/* ─────── DRAWER ─────── */
.dft-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 86vw);
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 220ms cubic-bezier(.2,.8,.2,1);
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}
.dft-drawer.is-open { transform: translateX(0); }
.dft-scrim {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.32);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}
.dft-scrim.is-open { opacity: 1; pointer-events: auto; }

.dft-drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.dft-drawer-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dft-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.dft-drawer-name { font-weight: 600; font-size: 14px; }
.dft-drawer-role {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.dft-vessel-label {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--subtle);
  padding: 12px 16px 4px;
}
.dft-vessel-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 8px 12px;
  border-bottom: 1px solid var(--border);
}
.dft-vessel-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  width: 100%;
  text-align: left;
}
.dft-vessel-item:hover { background: var(--surface-alt); }
.dft-vessel-item.is-active { background: var(--surface-alt); font-weight: 600; }
.dft-vessel-item i { color: var(--muted); font-size: 14px; }

.dft-drawer-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}
.dft-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: background 120ms ease;
  width: 100%;
  text-align: left;
}
.dft-nav-item i { font-size: 18px; color: var(--muted); width: 22px; text-align: center; }
.dft-nav-item:hover { background: var(--surface-alt); }
.dft-nav-item.is-active { background: var(--surface-alt); }
.dft-nav-item.is-active i { color: var(--rust); }

.dft-drawer-foot { padding: 12px; border-top: 1px solid var(--border); }

/* ─────── BUTTONS ─────── */
.dft-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, transform 80ms ease;
  width: 100%;
}
.dft-btn:active { transform: scale(0.99); }
.dft-btn-primary { background: var(--ink); color: var(--surface); }
.dft-btn-primary:hover { background: #000; }
.dft-btn-secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--border); }
.dft-btn-secondary:hover { border-color: var(--border-strong); }
.dft-btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--border); }
.dft-btn-ghost:hover { background: var(--surface-alt); }
.dft-btn-danger { background: var(--rust); color: var(--surface); }

/* ─────── MODAL ─────── */
.dft-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.dft-modal[hidden] { display: none; }
.dft-modal-scrim {
  position: absolute;
  inset: 0;
  background: rgba(26, 26, 26, 0.45);
  animation: dft-fade 180ms ease;
}
.dft-modal-panel {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 560px;
  width: 100%;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  animation: dft-slide-up 220ms cubic-bezier(.2,.8,.2,1);
  overflow: hidden;
}
@keyframes dft-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes dft-slide-up {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.dft-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.dft-modal-title { font-weight: 600; font-size: 16px; }
.dft-modal-titlewrap { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dft-modal-subtitle {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dft-modal-body { padding: 16px; overflow-y: auto; -webkit-overflow-scrolling: touch; }

/* ─────── FORMS ─────── */
.dft-field { margin-bottom: 14px; }
.dft-field:last-child { margin-bottom: 0; }
.dft-label {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
}
.dft-input, .dft-select, .dft-textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 16px;
  color: var(--ink);
  outline: none;
  transition: border-color 120ms ease;
}
.dft-input:focus, .dft-select:focus, .dft-textarea:focus { border-color: var(--ink); }
.dft-input.is-mono { font-family: var(--mono); }
.dft-textarea { min-height: 72px; resize: vertical; font-family: var(--sans); }
.dft-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236B6B6B' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.dft-hourmeter-input {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.05em;
}
.dft-row-pair { display: flex; gap: 8px; }
.dft-row-pair > * { flex: 1; }

/* ─────── PHOTOS ─────── */
.dft-photo-drop {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}
.dft-photo-drop:hover { border-color: var(--ink); background: var(--surface-alt); }
.dft-photo-drop.has-photos { border-style: solid; border-color: var(--moss); }
.dft-photo-drop i { font-size: 24px; color: var(--muted); display: block; margin-bottom: 6px; }
.dft-photo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.dft-photo {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-alt);
}
.dft-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dft-photo-pending { display: flex; align-items: center; justify-content: center; color: var(--muted); }
.dft-photo-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(26, 26, 26, 0.72);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  cursor: pointer;
}

/* ─────── CHECKLIST ─────── */
.dft-check {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 4px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
  font-size: 14px;
  user-select: none;
}
.dft-check:hover { background: var(--surface-alt); }
.dft-check.is-done { border-color: var(--moss); background: var(--moss-soft); }
.dft-checkbox {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 1.5px solid var(--border-strong);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--surface);
  font-size: 14px;
}
.dft-check.is-done .dft-checkbox {
  background: var(--moss);
  border-color: var(--moss);
}

/* ─────── INFO BLOCK ─────── */
.dft-info {
  background: var(--surface-alt);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 8px;
}
.dft-info-label {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 4px;
}
.dft-info-value { font-size: 14px; font-weight: 500; color: var(--ink); }
.dft-info-value.is-mono { font-family: var(--mono); font-weight: 600; }

/* ─────── LIGHTBOX ─────── */
.dft-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  cursor: zoom-out;
}
.dft-lightbox[hidden] { display: none; }
.dft-lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius);
}

/* ─────── HISTORY ─────── */
.dft-history-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 120ms ease;
}
.dft-history-item:hover { border-color: var(--border-strong); }
.dft-history-photos {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
  overflow-x: auto;
}
.dft-history-photos img {
  width: 64px;
  height: 64px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.dft-history-title { font-weight: 600; font-size: 15px; }
.dft-history-task { font-size: 13px; color: var(--muted); margin-top: 2px; }
.dft-history-comment {
  font-size: 13px;
  color: var(--ink);
  margin-top: 8px;
  font-style: italic;
}
.dft-history-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--subtle);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* ─────── DEVIATIONS ─────── */
.dft-dev-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 6px;
  cursor: pointer;
}
.dft-dev-card.is-critical, .dft-dev-card.is-severe { border-left-color: var(--rust); }
.dft-dev-card.is-medium { border-left-color: var(--amber); }
.dft-dev-card.is-low { border-left-color: var(--subtle); }
.dft-dev-title { font-weight: 600; font-size: 15px; }
.dft-dev-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.dft-dev-desc {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.4;
}

/* ─────── SUB-PAGE HEADER ─────── */
.dft-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
  cursor: pointer;
}
.dft-back:hover { color: var(--ink); }
.dft-page-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.dft-page-title + .dft-tabs,
.dft-page-title + .dft-card { margin-top: 16px; }
.dft-page-sub {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 18px;
}

/* ─────── TOAST ─────── */
.dft-toast {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--surface);
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  z-index: 500;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  animation: dft-toast-in 200ms ease-out;
}
@keyframes dft-toast-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ─────── REPORTS ─────── */
.dft-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
}
.dft-card-head {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dft-card-hint {
  font-size: 13px;
  color: var(--muted);
  margin: -4px 0 12px;
}

.dft-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 520px) {
  .dft-grid-2 { grid-template-columns: 1fr; }
}

.dft-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.dft-chip {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease, background 120ms ease;
}
.dft-chip:hover { border-color: var(--border-strong); color: var(--ink); }
.dft-chip.is-active,
.dft-chip.is-active:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--surface);
}

.dft-export-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.dft-export-row .dft-btn { width: auto; flex: 1; }
@media (max-width: 480px) {
  .dft-export-row { flex-direction: column; }
}

.dft-kpi-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-bottom: 1px solid var(--border);
}
.dft-kpi-cell {
  padding: 14px 8px;
  text-align: center;
  border-right: 1px solid var(--border);
}
.dft-kpi-cell:last-child { border-right: none; }
.dft-kpi-num {
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.dft-kpi-num.is-late { color: var(--rust); }
.dft-kpi-num.is-soon { color: var(--amber); }
.dft-kpi-num.is-ok { color: var(--moss); }
.dft-kpi-lbl {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2px;
}
@media (max-width: 520px) {
  .dft-kpi-strip { grid-template-columns: repeat(3, 1fr); }
  .dft-kpi-cell:nth-child(3) { border-right: none; }
  .dft-kpi-cell:nth-child(4),
  .dft-kpi-cell:nth-child(5) { border-top: 1px solid var(--border); }
  .dft-kpi-cell:nth-child(4) { grid-column: 1 / span 2; border-right: 1px solid var(--border); }
  .dft-kpi-cell:nth-child(5) { grid-column: 3 / span 1; }
}

.dft-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
}
.dft-preview-title {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.dft-preview-count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--subtle);
}

.dft-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.dft-tabs::-webkit-scrollbar { display: none; }
.dft-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.dft-tab:hover { color: var(--ink); }
.dft-tab.is-active {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.dft-tab-panel { display: none; }
.dft-tab-panel.is-active { display: block; }

.dft-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.dft-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.dft-table thead th {
  text-align: left;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.dft-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--ink);
}
.dft-table tbody tr:last-child td { border-bottom: none; }
.dft-table tbody tr:hover { background: var(--surface-alt); }

.dft-table-row-clickable { cursor: pointer; transition: background 120ms ease; }
.dft-table-row-clickable:active { background: var(--border); }

.dft-modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.dft-modal-actions .dft-btn { flex: 1; }

.dft-modal-tagrow { margin-bottom: 12px; }

/* ─────── TOGGLE (admin) ─────── */
.dft-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  gap: 12px;
}
.dft-toggle-row:hover { border-color: var(--border-strong); }
.dft-toggle-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.dft-toggle-sub {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.dft-toggle {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
  background: var(--border);
  border-radius: 11px;
  transition: background 120ms ease;
}
.dft-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  transition: left 120ms ease, background 120ms ease;
}
.dft-toggle.is-on { background: var(--rust); }
.dft-toggle.is-on::after { left: 20px; background: var(--surface); }

/* ─────── ADMIN-SPECIFIC ─────── */
.dft-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.dft-card-row-body { flex: 1; min-width: 0; }
.dft-card-row-title { font-weight: 600; font-size: 15px; }
.dft-card-row-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dft-card-row-tags {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.dft-card-clickable { cursor: pointer; transition: border-color 120ms ease; }
.dft-card-clickable:hover { border-color: var(--border-strong); }

.dft-form-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.dft-form-actions .dft-btn { flex: 0 1 auto; min-width: 140px; }

.dft-checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  cursor: pointer;
  user-select: none;
}
.dft-checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--ink);
}
.dft-checkbox-row-label { font-size: 14px; color: var(--ink); }

.dft-form-full { grid-column: 1 / -1; }

.dft-section-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 20px 0 10px;
  padding-left: 2px;
}

/* ─────── ICON PICKER (admin) ─────── */
.dft-icon-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
@media (min-width: 520px) {
  .dft-icon-picker { grid-template-columns: repeat(4, 1fr); }
}
.dft-icon-pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
  color: var(--muted);
}
.dft-icon-pick i { font-size: 22px; }
.dft-icon-pick-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
}
.dft-icon-pick:hover { border-color: var(--border-strong); color: var(--ink); }
.dft-icon-pick:hover .dft-icon-pick-label { color: var(--ink); }
.dft-icon-pick.is-active {
  border-color: var(--ink);
  background: var(--surface-alt);
  color: var(--ink);
}
.dft-icon-pick.is-active .dft-icon-pick-label { color: var(--ink); }

.dft-cat-icon {
  display: inline-block;
  width: 22px;
  text-align: center;
  color: var(--muted);
  margin-right: 6px;
  font-size: 16px;
  vertical-align: -2px;
}

/* ─────── LOGIN ─────── */
.dft-login-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.dft-login-box {
  width: 100%;
  max-width: 380px;
  text-align: center;
}
.dft-logo-xl {
  font-family: var(--sans);
  font-weight: 800;
  font-size: 48px;
  letter-spacing: -0.04em;
  color: var(--ink);
  display: inline-block;
  margin-bottom: 4px;
}
.dft-login-tagline {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 28px;
}
.dft-code-input {
  font-family: var(--mono);
  font-size: 24px;
  text-align: center;
  letter-spacing: 8px;
  font-weight: 700;
  text-transform: uppercase;
}
.dft-msg {
  margin-top: 14px;
  font-size: 13px;
  padding: 10px 14px;
  border-radius: var(--radius);
  text-align: left;
}
.dft-msg-error   { background: var(--rust-soft); color: var(--rust); }
.dft-msg-success { background: var(--moss-soft); color: var(--moss); }
.dft-link-muted {
  color: var(--subtle);
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
}
.dft-link-muted:hover { color: var(--ink); }
.dft-login-foot {
  margin-top: 24px;
  text-align: center;
}
.dft-step[hidden] { display: none; }

.dft-footer-note {
  margin-top: 32px;
  text-align: center;
}
.dft-table td.is-mono,
.dft-table td .is-mono { font-family: var(--mono); }
.dft-table td.is-nowrap { white-space: nowrap; }
.dft-table td .dft-comment {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  max-width: 240px;
}

.dft-photo-thumbs {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.dft-photo-thumb {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid var(--border);
  cursor: zoom-in;
}
