:root {
  --blue: #0d5bd7;
  --blue-dark: #123066;
  --yellow: #f4c430;
  --ink: #172033;
  --muted: #68758a;
  --line: #e4e9f2;
  --surface: #ffffff;
  --bg: #f4f7fb;
  --danger: #d83b3b;
  --green: #157a55;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.login-page {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(13, 91, 215, 0.95), rgba(18, 48, 102, 0.96)),
    linear-gradient(90deg, rgba(244, 196, 48, 0.22), transparent);
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px;
}

.login-panel {
  width: min(440px, 100%);
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(18, 48, 102, 0.28);
}

.login-brand,
.brand,
.topbar-actions,
.section-heading,
.admin-topbar {
  display: flex;
  align-items: center;
}

.login-brand,
.brand {
  gap: 14px;
}

.brand-mark {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  color: var(--blue-dark);
  background: var(--yellow);
  font-weight: 800;
}

.brand-mark.large {
  width: 54px;
  height: 54px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 28px;
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
}

.login-copy {
  margin: 20px 0 24px;
  color: var(--muted);
  line-height: 1.6;
}

.login-form {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  color: var(--ink);
  background: #fbfcff;
}

textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(13, 91, 215, 0.18);
  border-color: var(--blue);
}

.form-alert {
  margin-bottom: 18px;
  border: 1px solid rgba(216, 59, 59, 0.28);
  border-radius: 8px;
  padding: 12px 14px;
  color: #8a1f1f;
  background: #fff1f1;
  font-weight: 700;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 800;
}

.button.primary {
  color: #fff;
  background: var(--blue);
}

.button.secondary {
  color: var(--blue-dark);
  background: #e9f1ff;
}

.button.ghost {
  color: var(--blue-dark);
  background: #f1f5fb;
}

.button.danger {
  color: #fff;
  background: var(--danger);
}

.button.full {
  width: 100%;
}

.button.small {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
}

.admin-shell {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  min-height: 100vh;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  color: #dbe7ff;
  background: var(--blue-dark);
}

.brand {
  margin-bottom: 28px;
}

.brand strong {
  display: block;
  color: #fff;
}

.brand small {
  color: #aebee0;
}

.sidebar-nav {
  display: grid;
  gap: 6px;
}

.sidebar-nav a,
.sidebar-nav span {
  border-radius: 8px;
  padding: 12px 14px;
  color: #dbe7ff;
}

.sidebar-nav span {
  opacity: 0.55;
}

.sidebar-nav a.active,
.sidebar-nav a:hover {
  color: #101a2d;
  background: var(--yellow);
}

.admin-main {
  min-width: 0;
  padding: 28px;
}

.admin-topbar {
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.topbar-actions {
  gap: 12px;
}

.admin-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--muted);
  background: var(--surface);
  font-size: 14px;
  font-weight: 700;
}

.notice,
.content-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 14px 34px rgba(18, 48, 102, 0.06);
}

.notice {
  margin-bottom: 22px;
  padding: 16px 18px;
  color: var(--blue-dark);
  line-height: 1.55;
}

.warning-notice {
  margin-bottom: 0;
  color: #735200;
  background: #fff8df;
  box-shadow: none;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.module-card {
  min-height: 150px;
  border: 1px solid var(--line);
  border-top: 5px solid var(--blue);
  border-radius: 8px;
  padding: 18px;
  background: var(--surface);
}

.module-card.yellow {
  border-top-color: var(--yellow);
}

.module-card.green {
  border-top-color: var(--green);
}

.module-card.purple {
  border-top-color: #7357d4;
}

.module-card.cyan {
  border-top-color: #0a94aa;
}

.module-card.red {
  border-top-color: var(--danger);
}

.module-card.navy {
  border-top-color: var(--blue-dark);
}

.module-card p,
.module-card span {
  color: var(--muted);
}

.module-card p {
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 800;
}

.module-card strong {
  display: block;
  margin-bottom: 12px;
  font-size: 24px;
}

.module-card span {
  line-height: 1.45;
}

.content-card {
  padding: 22px;
}

.content-grid {
  display: grid;
  gap: 20px;
  align-items: start;
}

.content-grid.two-col {
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.7fr);
}

.narrow-card {
  max-width: 820px;
}

.section-heading {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.stat-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfcff;
}

.stat-item span,
.setting-row span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.stat-item strong {
  display: block;
  margin-top: 8px;
  font-size: 26px;
}

.settings-list {
  display: grid;
  gap: 12px;
}

.setting-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfcff;
}

.setting-row p {
  margin: 8px 0 0;
  color: var(--muted);
}

.setting-value {
  text-align: right;
}

.setting-value strong {
  display: block;
  margin-top: 8px;
}

.admin-form {
  display: grid;
  gap: 15px;
}

.search-form {
  display: flex;
  min-width: min(420px, 100%);
  gap: 10px;
}

.search-form input {
  min-width: 0;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.check-row input {
  width: 18px;
  height: 18px;
  padding: 0;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  padding: 0;
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  padding: 14px 12px;
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.compact-table {
  min-width: 640px;
}

.data-table td span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-badge {
  display: inline-flex;
  width: fit-content;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.status-badge.active {
  color: #0f5b3c;
  background: #dff6eb;
}

.status-badge.inactive {
  color: #7d2230;
  background: #ffe8ec;
}

.status-badge.maintenance {
  color: #735200;
  background: #fff3c4;
}

.status-badge.searching {
  color: #0847a6;
  background: #e7f0ff;
}

.status-badge.accepted {
  color: #0f5b3c;
  background: #dff6eb;
}

.status-badge.on-the-way {
  color: #0847a6;
  background: #e7f0ff;
}

.status-badge.arrived {
  color: #735200;
  background: #fff3c4;
}

.status-badge.in-progress {
  color: #4d3aa8;
  background: #eeeafe;
}

.status-badge.pending-payment-proof {
  color: #0a6575;
  background: #dcf7fb;
}

.status-badge.monitoring-48-hours {
  color: #0f5b3c;
  background: #dff6eb;
}

.status-badge.disputed {
  color: #7d2230;
  background: #ffe8ec;
}

.status-badge.closed {
  color: #39465a;
  background: #e8edf5;
}

.status-badge.pending_review,
.status-badge.requested {
  color: #735200;
  background: #fff3c4;
}

.status-badge.approved {
  color: #0f5b3c;
  background: #dff6eb;
}

.status-badge.rejected,
.status-badge.suspended {
  color: #7d2230;
  background: #ffe8ec;
}

.job-detail-grid {
  margin-bottom: 20px;
}

.inline-admin-form {
  margin-top: 14px;
}

.detail-list {
  display: grid;
  gap: 10px;
}

.detail-list div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcff;
}

.detail-list span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-list strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
}

.detail-copy,
.muted-copy {
  line-height: 1.6;
}

.muted-copy {
  color: var(--muted);
}

.admin-photo-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 14px;
}

.admin-photo-grid a {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fbfcff;
}

.admin-photo-grid img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
  object-fit: cover;
  background: #eaf0f8;
}

.admin-photo-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.admin-timeline {
  display: grid;
  gap: 12px;
}

.timeline-item {
  display: grid;
  gap: 5px;
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  padding: 12px 14px;
  background: #fbfcff;
}

.timeline-item span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.timeline-item strong {
  line-height: 1.4;
}

.timeline-item small {
  color: var(--muted);
  font-weight: 700;
}

.admin-chat-segments {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.admin-chat-segment {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfcff;
}

.compact-heading {
  margin-bottom: 0;
}

.compact-heading h3 {
  margin: 0;
  color: var(--ink);
}

.compact-detail-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-chat-messages {
  display: grid;
  gap: 10px;
}

.admin-chat-message {
  display: grid;
  gap: 5px;
  max-width: 760px;
  border-radius: 8px;
  padding: 12px 14px;
}

.admin-chat-message.customer {
  border-left: 4px solid var(--blue);
  background: #eef5ff;
}

.admin-chat-message.subcon {
  border-left: 4px solid #2f9d72;
  background: #edf9f3;
}

.admin-chat-message span {
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-chat-message p {
  margin: 0;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.admin-chat-message small {
  color: var(--muted);
  font-weight: 700;
}

.admin-call-attempts,
.settings-env-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.admin-call-attempt,
.settings-env-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: #fbfcff;
}

.admin-call-attempt div {
  display: grid;
  gap: 4px;
}

.admin-call-attempt span,
.admin-call-attempt small,
.settings-env-list span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-separator {
  width: 100%;
  margin: 18px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.approval-list {
  display: grid;
  gap: 12px;
}

.approval-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcff;
}

.approval-row strong {
  display: block;
  margin-bottom: 8px;
}

.approval-row form {
  margin: 0;
}

.editable-row {
  grid-template-columns: 1.1fr 110px 110px 1.1fr 90px 110px 80px;
  align-items: end;
}

@media (max-width: 980px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    height: auto;
  }

  .card-grid,
  .stat-row,
  .content-grid.two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .editable-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .admin-main,
  .login-shell {
    padding: 18px;
  }

  .admin-topbar,
  .section-heading,
  .topbar-actions,
  .search-form {
    align-items: flex-start;
    flex-direction: column;
  }

  .card-grid,
  .stat-row,
  .setting-row,
  .content-grid.two-col,
  .editable-row {
    grid-template-columns: 1fr;
  }

  .setting-value {
    text-align: left;
  }

  .admin-photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
