/* Somangaye Operations - interface styles */

:root {
  --bg:            #0a1014;
  --bg-deep:       #070b0e;
  --panel:         rgba(255, 255, 255, 0.035);
  --panel-solid:   #10181d;
  --panel-raised:  rgba(255, 255, 255, 0.06);
  --line:          rgba(255, 255, 255, 0.09);
  --line-strong:   rgba(255, 255, 255, 0.16);

  --ink:           #e9f1f2;
  --ink-soft:      #9fb0b5;
  --ink-faint:     #6b7f85;

  --teal:          #2cc6a5;
  --teal-bright:   #48e0bd;
  --teal-dim:      rgba(44, 198, 165, 0.12);
  --amber:         #e0a23c;
  --rose:          #e0625f;
  --sky:           #5aa9d6;

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;

  --sidebar-w: 248px;

  --font-display: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  background-image:
    radial-gradient(900px 480px at 88% -8%, rgba(44, 198, 165, 0.10), transparent 62%),
    radial-gradient(700px 420px at -5% 105%, rgba(90, 169, 214, 0.07), transparent 60%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
}

a { color: var(--teal-bright); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--teal-bright);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ----------------------------------------------------------------- */
/* Shell                                                              */
/* ----------------------------------------------------------------- */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: rgba(7, 11, 14, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-right: 1px solid var(--line);
  padding: 22px 14px 18px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 8px 22px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--teal);
  color: #05221b;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  flex: 0 0 34px;
}

.brand-text { line-height: 1.2; }
.brand-text strong { font-family: var(--font-display); font-size: 15px; display: block; }
.brand-text span { font-size: 11.5px; color: var(--ink-faint); }

.nav-group { margin-bottom: 18px; }

.nav-group-label {
  font-size: 11px;
  color: var(--ink-faint);
  padding: 0 10px 7px;
  letter-spacing: 0.02em;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  font-size: 14px;
  margin-bottom: 1px;
  border-left: 2px solid transparent;
}

.nav-link:hover {
  background: var(--panel);
  color: var(--ink);
  text-decoration: none;
}

.nav-link.is-active {
  background: var(--teal-dim);
  color: var(--teal-bright);
  border-left-color: var(--teal);
}

.nav-link svg { width: 17px; height: 17px; flex: 0 0 17px; stroke-width: 1.7; }

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 50%;
  background: var(--panel-raised);
  border: 1px solid var(--line-strong);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--teal-bright);
}

.sidebar-footer .who { min-width: 0; line-height: 1.25; }
.sidebar-footer .who strong { display: block; font-size: 13px; font-weight: 500; }
.sidebar-footer .who span { font-size: 11.5px; color: var(--ink-faint); }
.sidebar-footer .who strong,
.sidebar-footer .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.icon-button {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--ink-faint);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
}
.icon-button:hover { color: var(--rose); background: var(--panel); }
.icon-button svg { width: 16px; height: 16px; }

.main { flex: 1 1 auto; min-width: 0; padding: 26px 30px 60px; }

.topbar {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.topbar h1 { font-size: 24px; }
.topbar .subtitle { color: var(--ink-soft); font-size: 13.5px; margin-top: 3px; }
.topbar .actions { margin-left: auto; display: flex; gap: 9px; align-items: center; }

.menu-toggle { display: none; }

/* ----------------------------------------------------------------- */
/* Panels                                                             */
/* ----------------------------------------------------------------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.panel-head {
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.panel-head h2 { font-size: 15.5px; }
.panel-body { padding: 18px; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 17px;
}
.stat .label { font-size: 12.5px; color: var(--ink-soft); }
.stat .value {
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 600;
  margin-top: 3px;
  letter-spacing: -0.02em;
}
.stat .value.teal { color: var(--teal-bright); }
.stat .value.amber { color: var(--amber); }
.stat .value.rose { color: var(--rose); }

/* ----------------------------------------------------------------- */
/* Forms                                                              */
/* ----------------------------------------------------------------- */

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.field .hint { font-size: 12px; color: var(--ink-faint); margin-top: 5px; }

input[type=text], input[type=email], input[type=tel], input[type=password],
input[type=search], input[type=number], input[type=date], select, textarea {
  width: 100%;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
}

input::placeholder, textarea::placeholder { color: var(--ink-faint); }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(44, 198, 165, 0.14);
}

textarea { resize: vertical; min-height: 92px; }

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239fb0b5' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 32px;
}

.field.has-error input, .field.has-error textarea, .field.has-error select {
  border-color: var(--rose);
}
.error-text { color: var(--rose); font-size: 12.5px; margin-top: 5px; }

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0 18px;
}

.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  padding-top: 6px;
  border-top: 1px solid var(--line);
  margin-top: 6px;
  padding-top: 18px;
}

/* ----------------------------------------------------------------- */
/* Buttons                                                            */
/* ----------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--panel-raised);
  color: var(--ink);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: rgba(255, 255, 255, 0.1); text-decoration: none; }
.btn svg { width: 15px; height: 15px; stroke-width: 2; }

.btn-primary {
  background: var(--teal);
  border-color: var(--teal);
  color: #04221b;
  font-weight: 600;
}
.btn-primary:hover { background: var(--teal-bright); border-color: var(--teal-bright); }

.btn-danger { color: var(--rose); border-color: rgba(224, 98, 95, 0.4); }
.btn-danger:hover { background: rgba(224, 98, 95, 0.12); }

.btn-ghost { background: none; border-color: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: var(--panel); color: var(--ink); }

.btn-sm { padding: 6px 11px; font-size: 12.5px; }

/* ----------------------------------------------------------------- */
/* Tables                                                             */
/* ----------------------------------------------------------------- */

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

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  min-width: 760px;
}

table.data th {
  text-align: left;
  font-weight: 500;
  font-size: 12px;
  color: var(--ink-faint);
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

table.data th a { color: inherit; }
table.data th a:hover { color: var(--ink); }

table.data td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: rgba(255, 255, 255, 0.025); }

.cell-primary { display: flex; align-items: center; gap: 11px; }
.cell-primary .name { font-weight: 500; }
.cell-primary .sub { font-size: 12px; color: var(--ink-faint); }

.code-chip {
  font-family: 'Space Grotesk', monospace;
  font-size: 12.5px;
  color: var(--teal-bright);
  background: var(--teal-dim);
  border: 1px solid rgba(44, 198, 165, 0.25);
  padding: 3px 8px;
  border-radius: 5px;
  white-space: nowrap;
}

.muted { color: var(--ink-faint); }

.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ----------------------------------------------------------------- */
/* Badges                                                             */
/* ----------------------------------------------------------------- */

.badge {
  display: inline-block;
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 20px;
  border: 1px solid;
  white-space: nowrap;
}
.badge-active    { color: var(--teal-bright); border-color: rgba(44, 198, 165, 0.35); background: var(--teal-dim); }
.badge-pending   { color: var(--sky); border-color: rgba(90, 169, 214, 0.35); background: rgba(90, 169, 214, 0.1); }
.badge-suspended { color: var(--amber); border-color: rgba(224, 162, 60, 0.35); background: rgba(224, 162, 60, 0.1); }
.badge-cancelled { color: var(--ink-faint); border-color: var(--line-strong); background: var(--panel); }

/* ----------------------------------------------------------------- */
/* Search and filters                                                 */
/* ----------------------------------------------------------------- */

.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  width: 100%;
}

.search-box { position: relative; flex: 1 1 260px; max-width: 380px; }
.search-box svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--ink-faint);
  pointer-events: none;
}
.search-box input { padding-left: 34px; }
.filter-bar select { width: auto; min-width: 145px; }

/* ----------------------------------------------------------------- */
/* Pagination                                                         */
/* ----------------------------------------------------------------- */

.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.pagination .count { color: var(--ink-faint); font-size: 13px; margin-right: auto; }
.pagination .page-link {
  padding: 5px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  font-size: 13px;
}
.pagination .page-link:hover { background: var(--panel); color: var(--ink); text-decoration: none; }
.pagination .page-link.is-current { background: var(--teal-dim); border-color: var(--teal); color: var(--teal-bright); }
.pagination .page-link.is-disabled { opacity: 0.35; pointer-events: none; }

/* ----------------------------------------------------------------- */
/* Flash and empty states                                             */
/* ----------------------------------------------------------------- */

.flash {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 15px;
  border-radius: var(--radius);
  border: 1px solid;
  margin-bottom: 18px;
  font-size: 14px;
}
.flash svg { width: 17px; height: 17px; flex: 0 0 17px; margin-top: 1px; }
.flash-success { color: var(--teal-bright); border-color: rgba(44, 198, 165, 0.32); background: var(--teal-dim); }
.flash-error   { color: var(--rose); border-color: rgba(224, 98, 95, 0.32); background: rgba(224, 98, 95, 0.1); }
.flash-info    { color: var(--sky); border-color: rgba(90, 169, 214, 0.32); background: rgba(90, 169, 214, 0.08); }

.empty { padding: 54px 24px; text-align: center; }
.empty h3 { font-size: 16px; margin-bottom: 6px; }
.empty p { color: var(--ink-soft); font-size: 14px; margin: 0 auto 18px; max-width: 46ch; }

/* ----------------------------------------------------------------- */
/* Modal (delete confirmation)                                        */
/* ----------------------------------------------------------------- */

dialog.modal {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--panel-solid);
  color: var(--ink);
  padding: 0;
  width: min(430px, calc(100vw - 32px));
}
dialog.modal::backdrop { background: rgba(4, 7, 9, 0.7); }
dialog.modal .panel-body { padding: 22px; }
dialog.modal h2 { font-size: 17px; margin-bottom: 8px; }
dialog.modal p { color: var(--ink-soft); font-size: 14px; margin: 0 0 20px; }
dialog.modal .form-actions { justify-content: flex-end; border: none; padding-top: 0; margin: 0; }

/* ----------------------------------------------------------------- */
/* Login                                                              */
/* ----------------------------------------------------------------- */

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}
.auth-card { width: min(410px, 100%); }
.auth-card .panel-body { padding: 30px; }
.auth-card .brand { justify-content: flex-start; padding: 0 0 20px; }
.auth-card h1 { font-size: 20px; margin-bottom: 4px; }
.auth-card .lede { color: var(--ink-soft); font-size: 13.5px; margin: 0 0 24px; }
.auth-card .btn { width: 100%; justify-content: center; }

/* ----------------------------------------------------------------- */
/* Stub pages                                                         */
/* ----------------------------------------------------------------- */

.stub { padding: 60px 30px; text-align: center; }
.stub .stub-icon {
  width: 46px; height: 46px;
  margin: 0 auto 16px;
  color: var(--teal);
  opacity: 0.75;
}
.stub h2 { font-size: 18px; margin-bottom: 8px; }
.stub p { color: var(--ink-soft); max-width: 52ch; margin: 0 auto; font-size: 14px; }

/* ----------------------------------------------------------------- */
/* Responsive                                                         */
/* ----------------------------------------------------------------- */

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    z-index: 40;
    left: 0; top: 0;
    transform: translateX(-100%);
    transition: transform 0.18s ease;
  }
  .sidebar.is-open { transform: translateX(0); }
  .main { padding: 18px 16px 50px; }
  .menu-toggle { display: inline-flex; }
  .topbar h1 { font-size: 20px; }
  .scrim {
    position: fixed;
    inset: 0;
    background: rgba(4, 7, 9, 0.6);
    z-index: 35;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
