/* backend/templates/project_overview.html */
body {
      background: #020617;
      color: #e5e7eb;
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      margin: 0;
      padding: 0;
    }

    .app-header {
      background: #020617;
      border-bottom: 1px solid #111827;
      position: sticky;
      top: 0;
      z-index: 40;
    }
    .app-header-inner {
      max-width: 1280px;
      margin: 0 auto;
      padding: 10px 16px;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    .app-header-title {
      font-weight: 600;
      font-size: 1rem;
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .app-header-title .badge {
      font-size: 0.7rem;
      padding: 2px 6px;
      border-radius: 999px;
      background: #111827;
      border: 1px solid #1f2937;
      color: #9ca3af;
    }
    .app-header-nav a {
      color: #9ca3af;
      text-decoration: none;
      font-size: 0.85rem;
      margin-left: 12px;
    }
    .app-header-nav a:hover {
      color: #e5e7eb;
    }

    .page {
      max-width: 1280px;
      margin: 0 auto;
      padding: 16px 16px 40px;
    }
    .page-title {
      font-size: 1.3rem;
      font-weight: 600;
      margin: 0 0 4px 0;
    }
    .page-subtitle {
      font-size: 0.85rem;
      color: #9ca3af;
      margin: 0 0 12px 0;
    }
    .code {
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
        "Liberation Mono", "Courier New", monospace;
      background: #020617;
      padding: 2px 6px;
      border-radius: 999px;
      border: 1px solid #1f2937;
      font-size: 0.78rem;
    }

    .badge-pill {
      display: inline-flex;
      align-items: center;
      padding: 2px 8px;
      border-radius: 999px;
      border: 1px solid #1f2937;
      font-size: 0.72rem;
      background: #020617;
      color: #e5e7eb;
    }

    .btn-sm {
      border-radius: 999px;
      border: 1px solid transparent;
      padding: 5px 12px;
      font-size: 0.82rem;
      background: #111827;
      color: #e5e7eb;
      cursor: pointer;
      text-decoration: none;
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }
    .btn-secondary {
      background: #020617;
      border-color: #374151;
    }
    .btn-sm:hover,
    .btn-secondary:hover {
      border-color: #60a5fa;
    }

    .card {
      border-radius: 16px;
      border: 1px solid #1f2937;
      background: radial-gradient(circle at top left, #111827, #020617);
      padding: 12px 14px;
      margin-bottom: 14px;
    }
    .card h2 {
      font-size: 0.95rem;
      margin: 0 0 4px 0;
    }
    .card-subtitle {
      font-size: 0.8rem;
      color: #9ca3af;
      margin: 0 0 8px 0;
    }
    .muted {
      color: #9ca3af;
      font-size: 0.8rem;
    }

    .table-wrapper {
      border-radius: 16px;
      border: 1px solid #1f2937;
      overflow: hidden;
      background: #020617;
    }
    table {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.82rem;
    }
    thead {
      background: #020617;
    }
    th,
    td {
      padding: 8px 10px;
      border-bottom: 1px solid #111827;
      vertical-align: top;
    }
    th {
      text-align: left;
      font-size: 0.78rem;
      color: #9ca3af;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      white-space: nowrap;
    }
    tbody tr:last-child td {
      border-bottom: none;
    }

    .visit-title {
      font-weight: 500;
      margin-bottom: 2px;
      font-size: 0.85rem;
    }
    .visit-title a {
      color: #e5e7eb;
      text-decoration: none;
    }
    .visit-title a:hover {
      text-decoration: underline;
    }
    .visit-subline {
      font-size: 0.78rem;
      color: #9ca3af;
    }

    .visit-status-pill {
      display: inline-flex;
      padding: 2px 8px;
      border-radius: 999px;
      font-size: 0.72rem;
      border: 1px solid #1f2937;
    }
    .visit-status-created {
      background: rgba(31, 41, 55, 0.8);
    }
    .visit-status-client_confirmed {
      background: rgba(245, 158, 11, 0.18);
      border-color: #f59e0b;
      color: #fde68a;
    }
    .visit-status-engineer_assigned {
      background: rgba(59, 130, 246, 0.18);
      border-color: #3b82f6;
      color: #bfdbfe;
    }
    .visit-status-in_progress {
      background: rgba(34, 197, 94, 0.2);
      border-color: #22c55e;
      color: #bbf7d0;
    }
    .visit-status-revisit_required {
      background: rgba(249, 115, 22, 0.2);
      border-color: #f97316;
      color: #fed7aa;
    }
    .visit-status-hold {
      background: rgba(148, 163, 184, 0.18);
      border-color: #94a3b8;
      color: #e2e8f0;
    }
    .visit-status-completed {
      background: rgba(16, 185, 129, 0.14);
      border-color: #10b981;
      color: #a7f3d0;
    }
    .visit-status-canceled {
      background: rgba(239, 68, 68, 0.12);
      border-color: #ef4444;
      color: #fecaca;
    }

    .address-stack {
      font-size: 0.78rem;
      color: #e5e7eb;
      line-height: 1.25;
    }
    .address-stack div {
      margin-bottom: 1px;
    }

    .badge-meta {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      font-size: 0.75rem;
      color: #9ca3af;
    }

    .visit-time-cell {
      font-size: 0.78rem;
      color: #e5e7eb;
      line-height: 1.25;
    }

    .progress-bar {
      width: auto;
      height: 5px;
      border-radius: 999px;
      border: 1px solid #111827;
      background: #020617;
      overflow: hidden;
      margin-top: 4px;
    }
    .progress-bar-fill {
      height: 100%;
      border-radius: 999px;
      background: linear-gradient(90deg, #22c55e, #4ade80);
    }
    .progress-label {
      font-size: 0.72rem;
      color: #9ca3af;
    }

    /* Mobile stacked cards */
    @media (max-width: 768px) {
      .table-wrapper {
        border-radius: 0;
        border-left: none;
        border-right: none;
      }
      table,
      thead {
        display: none;
      }
      .visits-mobile-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
      }
      .visit-card {
        border-radius: 12px;
        border: 1px solid #1f2937;
        background: #020617;
        padding: 10px 12px;
        cursor: pointer;
      }
      .visit-card-header {
        display: flex;
        justify-content: space-between;
        gap: 8px;
        align-items: flex-start;
      }
      .visit-card-title {
        font-size: 0.9rem;
        font-weight: 500;
      }
      .visit-card-title a {
        color: #e5e7eb;
        text-decoration: none;
      }
      .visit-card-title a:hover {
        text-decoration: underline;
      }
      .visit-card-meta {
        font-size: 0.78rem;
        color: #9ca3af;
        margin-top: 2px;
      }
      .visit-card-row {
        font-size: 0.78rem;
        margin-top: 4px;
      }
    }

    @media (min-width: 769px) {
      .visits-mobile-list {
        display: none;
      }
    }


/* backend/templates/engineer_visit.html */
:root {
      --bg: #020617;
      --bg-card: #020617;
      --bg-card-soft: #020617;
      --border-subtle: #1f2937;
      --text: #e5e7eb;
      --muted: #9ca3af;
      --muted-2: #6b7280;
      --accent: #3b82f6;
      --accent-soft: rgba(59,130,246,0.1);
      --danger: #b91c1c;
      --success: #22c55e;
      --radius-card: 16px;
      --radius-pill: 999px;
      --shadow-soft: 0 18px 45px rgba(15,23,42,0.6);
    }

    * {
      box-sizing: border-box;
    }

    body {
      margin: 0;
      padding: 0;
      background: radial-gradient(circle at top, #0b1120 0, #020617 40%, #000 100%);
      color: var(--text);
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    }

    a {
      color: #93c5fd;
      text-decoration: none;
    }
    a:hover {
      text-decoration: underline;
    }

    .page {
      max-width: 640px;
      margin: 0 auto;
      padding: 16px 12px 32px;
    }

    .page-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 12px;
      margin-bottom: 16px;
      padding: 12px 14px;
      border-radius: var(--radius-card);
      border: 1px solid var(--border-subtle);
      background: radial-gradient(circle at top left, #111827, #020617);
      box-shadow: var(--shadow-soft);
    }

    .title-main {
      font-size: 1rem;
      font-weight: 600;
      margin-bottom: 6px;
    }

    .visit-meta {
      font-size: 0.8rem;
      color: var(--muted);
    }

    .badge-row {
      display: flex;
      flex-wrap: wrap;
      gap: 4px;
      margin-top: 4px;
    }

    .badge-pill {
      display: inline-flex;
      align-items: center;
      padding: 2px 8px;
      border-radius: var(--radius-pill);
      font-size: 0.72rem;
      border: 1px solid var(--border-subtle);
      background: #020617;
      color: var(--muted);
      gap: 4px;
    }

    .badge-type {
      border-color: #1d4ed8;
      color: #bfdbfe;
    }

    .badge-status {
      border-color: #15803d;
      color: #bbf7d0;
    }

    .badge-clock {
      border-color: #64748b;
    }

    .header-actions {
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 4px;
    }

    .small-label {
      font-size: 0.68rem;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      color: var(--muted);
    }

    .small-value {
      font-size: 0.78rem;
    }

    .card {
      margin-bottom: 12px;
      border-radius: var(--radius-card);
      border: 1px solid var(--border-subtle);
      background: var(--bg-card);
      padding: 10px 12px;
    }

    .card-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 8px;
      margin-bottom: 6px;
    }

    .card-title {
      font-size: 0.82rem;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: var(--muted);
    }

    .card-sub {
      font-size: 0.75rem;
      color: var(--muted-2);
    }

    .info-grid {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      gap: 6px;
      font-size: 0.85rem;
    }

    .info-item-label {
      font-size: 0.72rem;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      color: var(--muted);
      margin-bottom: 2px;
    }

    .info-item-value {
      line-height: 1.3;
    }

    .address-box {
      border-radius: 10px;
      border: 1px solid #1f2937;
      background-color: #020617;
      padding: 6px 8px;
      font-size: 0.84rem;
      line-height: 1.3;
      position: relative;
      padding-right: 40px;
      overflow-wrap: break-word;
    }

    .map-btn {
      position: absolute;
      top: 4px;
      right: 4px;
      border-radius: var(--radius-pill);
      border: 1px solid #374151;
      background: #020617;
      color: var(--text);
      padding: 2px 8px;
      font-size: 0.7rem;
      cursor: pointer;
      text-decoration: none;
    }

    .map-btn:hover {
      border-color: #60a5fa;
    }

    /* Buttons */

    .btn,
    .btn-ghost,
    .btn-danger,
    .btn-primary {
      font-family: inherit;
      font-size: 0.85rem;
      border-radius: var(--radius-pill);
      padding: 7px 14px;
      border: none;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      text-decoration: none;
    }

    .btn-primary {
      background: linear-gradient(135deg, #2563eb, #4f46e5);
      color: var(--text);
      border: none;
    }

    .btn-primary:disabled {
      opacity: 0.6;
      cursor: default;
    }

    .btn-ghost {
      background: #020617;
      border: 1px solid #374151;
      color: var(--text);
    }

    .btn-ghost:disabled {
      opacity: 0.6;
      cursor: default;
    }

    .btn-danger {
      background: #7f1d1d;
      border: 1px solid #b91c1c;
      color: #fee2e2;
    }

    .btn-small {
      font-size: 0.78rem;
      padding: 4px 10px;
    }

    .btn-row {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }

    /* Final step button styles */
    .final-step-wrapper {
      margin-top: 10px;
      padding: 8px 10px;
      border-radius: 12px;
      border: 1px dashed #374151;
      background: rgba(15,23,42,0.9);
    }

    .btn-final-signoff {
      width: 100%;
      justify-content: center;
      font-weight: 600;
      letter-spacing: 0.05em;
      text-transform: uppercase;
    }

    .btn-final-disabled {
      background: #111827;
      border: 1px solid #4b5563;
      color: #9ca3af;
    }

    .btn-final-ready {
      background: linear-gradient(135deg, #16a34a, #22c55e);
      color: #ecfdf5;
      border: none;
      box-shadow:
        0 0 0 1px rgba(34,197,94,0.5),
        0 10px 30px rgba(22,163,74,0.7);
    }

    /* Tasks */

    .tasks-list {
      list-style: none;
      padding: 0;
      margin: 0;
      font-size: 0.84rem;
    }

    .task-item {
      border-top: 1px solid #111827;
      padding: 8px 0;
    }

    .task-header {
      display: flex;
      align-items: flex-start;
      gap: 8px;
    }

    .task-checkbox {
      margin-top: 2px;
    }

    .task-title {
      font-weight: 500;
      line-height: 1.3;
    }

    .task-flags {
      font-size: 0.7rem;
      color: var(--muted-2);
      margin-top: 2px;
    }

    .task-desc {
      margin-top: 3px;
      font-size: 0.8rem;
      color: var(--muted-2);
      white-space: pre-wrap;
    }

    .task-photo-upload {
      margin-top: 6px;
      display: flex;
      align-items: center;
      gap: 6px;
      flex-wrap: wrap;
    }

    .task-photo-upload input[type="file"] {
      font-size: 0.76rem;
      max-width: 100%;
    }

    /* Forms */

    textarea,
    input[type="text"],
    input[type="email"],
    select {
      width: 100%;
      border-radius: 10px;
      border: 1px solid #1f2937;
      background: #020617;
      padding: 7px 9px;
      color: var(--text);
      font-size: 0.85rem;
      font-family: inherit;
    }

    textarea::placeholder,
    input::placeholder {
      color: #4b5563;
    }

    textarea {
      resize: vertical;
    }

    .form-row {
      margin-bottom: 8px;
    }

    .form-label {
      font-size: 0.74rem;
      color: var(--muted);
      margin-bottom: 3px;
    }

    .form-help {
      font-size: 0.7rem;
      color: var(--muted-2);
      margin-top: 2px;
    }

    .section-divider {
      margin: 10px 0;
      border-top: 1px solid #111827;
    }

    .status-pill {
      font-size: 0.72rem;
      border-radius: var(--radius-pill);
      border: 1px solid #374151;
      padding: 1px 6px;
      color: var(--muted);
    }

    .status-pill-ok {
      border-color: #22c55e;
      color: #bbf7d0;
    }

    .status-pill-wait {
      border-color: #eab308;
      color: #facc15;
    }

    .status-pill-warn {
      border-color: #f97316;
      color: #fed7aa;
    }

    .hint {
      font-size: 0.72rem;
      color: var(--muted-2);
      margin-top: 4px;
    }

    .pill-inline {
      display: inline-flex;
      align-items: center;
      gap: 4px;
    }

    /* Signature styles */
    .signature-wrapper {
      border-radius: 10px;
      border: 1px solid #1f2937;
      background: #ffffff;
      padding: 6px;
    }

    .signature-canvas {
      width: 100%;
      height: 150px;
      touch-action: none;
      display: block;
      background: #ffffff;
    }

    .signature-preview {
      max-width: 100%;
      border: 1px solid #1f2937;
      border-radius: 8px;
      margin-top: 4px;
    }

    /* Mobile tweaks */

    @media (max-width: 480px) {
      .page {
        padding: 12px 10px 28px;
      }
      .page-header {
        flex-direction: column;
      }
      .header-actions {
        align-items: flex-start;
      }
    }


/* backend/templates/tracking_detail.html */
body { font-family: 'Inter', sans-serif; }


/* backend/templates/login.html */
body { font-family: 'Inter', sans-serif; }
