/* ─── Reset & Base ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13px;
  background: #0f1117;
  color: #d4d8e2;
  min-height: 100vh;
}

/* ─── Layout ────────────────────────────────────────── */
.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 8px 32px;
}

/* ─── Top Nav ───────────────────────────────────────── */
.topnav {
  display: flex;
  gap: 2px;
  padding: 8px 0 6px;
  border-bottom: 1px solid #1e2130;
  margin-bottom: 10px;
}

.topnav a {
  text-decoration: none;
  color: #7a84a0;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  transition: background .15s;
}

.topnav a:hover { background: #1e2130; color: #d4d8e2; }
.topnav a.active { background: #1e2130; color: #5b9cf6; }

/* ─── Flash messages ────────────────────────────────── */
.flash {
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  margin-bottom: 8px;
  font-weight: 500;
}
.flash.hide   { display: none; }
.flash.ok     { background: #0e2e1a; color: #4ade80; border: 1px solid #166534; }
.flash.err    { background: #2e0e0e; color: #f87171; border: 1px solid #7f1d1d; }

/* ─── Form ──────────────────────────────────────────── */
.field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 8px;
}

.field label {
  color: #7a84a0;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}

input[type="text"],
input[type="tel"],
input[type="date"],
select,
textarea {
  background: #161922;
  border: 1px solid #272d3d;
  color: #d4d8e2;
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 13px;
  font-family: inherit;
  width: 100%;
  transition: border-color .15s;
  -webkit-appearance: none;
}

input[type="date"] { color-scheme: dark; }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #3b5bdb;
}

select option { background: #161922; }
textarea { resize: vertical; min-height: 60px; }

/* ─── Submit button ─────────────────────────────────── */
.btn-submit {
  width: 100%;
  margin-top: 4px;
  padding: 9px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  letter-spacing: .02em;
}
.btn-submit:hover:not(:disabled) { background: #1d4ed8; }
.btn-submit:disabled { opacity: .5; cursor: not-allowed; }

/* ─── Tabs ──────────────────────────────────────────── */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-bottom: 10px;
}

.tab {
  text-decoration: none;
  color: #7a84a0;
  padding: 4px 9px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid transparent;
  white-space: nowrap;
}

.tab:hover { background: #1e2130; color: #d4d8e2; }
.tab.active { background: #1e2130; color: #5b9cf6; border-color: #2a3050; }

.badge {
  display: inline-block;
  background: #272d3d;
  color: #d4d8e2;
  border-radius: 8px;
  padding: 1px 5px;
  font-size: 10px;
  margin-left: 3px;
  font-weight: 700;
}
.badge-red { background: #7f1d1d; color: #fca5a5; }

/* ─── Table ─────────────────────────────────────────── */
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.tbl th {
  background: #0d1018;
  color: #4a5270;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: .04em;
  padding: 5px 6px;
  text-align: left;
  border-bottom: 1px solid #1e2130;
}

.tbl td {
  padding: 5px 6px;
  border-bottom: 1px solid #161922;
  vertical-align: middle;
}

.tbl tr:hover td { background: #0d1018; }

.tid { color: #4a5270; font-size: 11px; }
.center { text-align: center; }

.issue {
  max-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #9ba3bf;
}

/* ─── Days pending ──────────────────────────────────── */
.days {
  font-size: 11px;
  font-weight: 700;
  color: #7a84a0;
}
.days-warn { color: #f87171; }

/* ─── Status badges ─────────────────────────────────── */
.status {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: .04em;
}
.status-open     { background: #0e2240; color: #60a5fa; }
.status-pending  { background: #2d1b00; color: #fbbf24; }
.status-resolved { background: #0e2e1a; color: #4ade80; }
.status-closed   { background: #1a1a1a; color: #6b7280; }

/* ─── Action buttons ────────────────────────────────── */
.actions {
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.btn-sm {
  padding: 3px 7px;
  border: none;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
  white-space: nowrap;
}
.btn-sm:hover { opacity: .8; }

.btn-green { background: #166534; color: #4ade80; }
.btn-blue  { background: #1e3a5f; color: #60a5fa; }

.reschedule-wrap {
  display: flex;
  align-items: center;
  gap: 3px;
}

.date-pick {
  width: 110px !important;
  padding: 2px 4px !important;
  font-size: 11px !important;
}

.txt-muted { color: #2a3050; }

/* ─── Empty state ───────────────────────────────────── */
.empty {
  text-align: center;
  padding: 24px 0;
  color: #4a5270;
  font-size: 12px;
}
