/* ==========================================================================
   BURGERSFORT WATER DRILLING — ADMIN DASHBOARD

   CASCADE MAP: tokens/reset → sidebar → top bar → dashboard → records →
   detail view → login → responsive rules. Start with the variables below.
   ========================================================================== */

/* 01. DESIGN TOKENS */
:root {
  --navy: #061725;
  --navy2: #0a2234;
  --blue: #0ba7d9;
  --cyan: #56d7f4;
  --ink: #102332;
  --muted: #6f7f8b;
  --line: #dce6ec;
  --paper: #fff;
  --bg: #f3f7f9;
  --green: #1aa36f;
  --amber: #e89b2c;
  --red: #d95c5c;
  --shadow: 0 16px 40px rgba(13, 44, 64, 0.08);
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font-family: Manrope, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}
a {
  text-decoration: none;
  color: inherit;
}
button,
input,
select {
  font: inherit;
}
/* 02. APPLICATION SHELL AND SIDEBAR */
.app-shell {
  min-height: 100vh;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 260px;
  background: linear-gradient(180deg, var(--navy), #081d2d);
  color: #fff;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  z-index: 40;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 6px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.brand-logo {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.brand > span:last-child {
  display: grid;
}
.brand strong,
.login-brand strong {
  font:
    700 16px/1.1 "Space Grotesk",
    sans-serif;
}
.brand small,
.login-brand small {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 8px;
  color: #8ed9ee;
  margin-top: 5px;
}
.nav-label {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #658397;
  font-size: 9px;
  font-weight: 800;
  padding: 26px 12px 10px;
}
.sidebar nav {
  display: grid;
  gap: 6px;
}
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 13px;
  border-radius: 12px;
  color: #a9bdc9;
  font-size: 13px;
  font-weight: 700;
  transition: 0.2s;
}
.sidebar nav a:hover,
.sidebar nav a.active {
  background: linear-gradient(
    90deg,
    rgba(13, 167, 217, 0.18),
    rgba(13, 167, 217, 0.06)
  );
  color: #fff;
}
.sidebar nav a.active {
  box-shadow: inset 3px 0 0 var(--cyan);
}
.sidebar nav i {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  font-style: normal;
  color: #63cfe9;
}
.sidebar nav b {
  margin-left: auto;
  background: #0ba7d9;
  color: #fff;
  min-width: 20px;
  height: 20px;
  border-radius: 99px;
  display: grid;
  place-items: center;
  font-size: 9px;
}
.crew-card {
  margin-top: auto;
  background: linear-gradient(
    145deg,
    rgba(12, 169, 218, 0.15),
    rgba(255, 255, 255, 0.04)
  );
  border: 1px solid rgba(101, 214, 242, 0.17);
  border-radius: 16px;
  padding: 16px;
  position: relative;
}
.crew-card .pulse {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #3ce49d;
  box-shadow: 0 0 0 6px rgba(60, 228, 157, 0.1);
}
.crew-card small {
  display: block;
  color: #7fa2b7;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.crew-card strong {
  display: block;
  margin-top: 7px;
  font-size: 13px;
}
.crew-card p {
  color: #88a0af;
  font-size: 11px;
  line-height: 1.5;
  margin: 6px 0 0;
}
.sidebar-user {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 14px 6px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar-user > span {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: #11344a;
  display: grid;
  place-items: center;
  color: #72d7ef;
  font-size: 11px;
  font-weight: 800;
}
.sidebar-user div {
  display: grid;
}
.sidebar-user strong {
  font-size: 12px;
}
.sidebar-user small {
  font-size: 9px;
  color: #7895a7;
  margin-top: 2px;
}
.sidebar-user > a {
  color: #6d8d9f;
}
/* 03. MAIN CONTENT AND TOP BAR */
.main-content {
  margin-left: 260px;
  min-height: 100vh;
}
.topbar {
  height: 72px;
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  padding: 0 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.topbar-copy {
  display: grid;
}
.topbar-copy span {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--blue);
  font-weight: 800;
}
.topbar-copy strong {
  font-size: 12px;
  margin-top: 4px;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.site-btn,
.secondary-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 10px 13px;
  color: var(--ink);
}
.menu-btn {
  display: none;
  border: 0;
  background: none;
  font-size: 23px;
}
.page-wrap {
  padding: 30px;
  max-width: 1600px;
  margin: auto;
}
.welcome-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 30px;
  margin-bottom: 24px;
}
.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--blue);
  font-size: 9px;
  font-weight: 800;
}
.welcome-row h1,
.detail-head h1 {
  font:
    700 clamp(30px, 4vw, 42px) / 1.1 "Space Grotesk",
    sans-serif;
  margin: 0;
}
.welcome-row > div > p:last-child,
.detail-head p {
  color: var(--muted);
  margin: 9px 0 0;
  font-size: 13px;
}
.welcome-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.live-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #e8f8f1;
  color: #187857;
  border-radius: 999px;
  padding: 9px 12px;
  font-size: 10px;
  font-weight: 800;
}
.live-chip i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #28b982;
  box-shadow: 0 0 0 5px rgba(40, 185, 130, 0.12);
}
.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(135deg, #087da9, #0ba7d9);
  color: #fff;
  padding: 12px 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(11, 167, 217, 0.2);
}
/* 04. DASHBOARD STATISTICS AND PANELS */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}
.stat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 18px;
  box-shadow: 0 8px 22px rgba(13, 44, 64, 0.035);
}
.stat-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.stat-top em {
  font-style: normal;
  font-size: 9px;
  color: #94a2ab;
  background: #f4f7f8;
  border-radius: 99px;
  padding: 6px 8px;
}
.stat-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-style: normal;
  font-weight: 800;
}
.stat-icon.water {
  background: #e4f6fb;
  color: #0785b1;
}
.stat-icon.alert {
  background: #fff1dd;
  color: #cf8014;
}
.stat-icon.schedule {
  background: #e9edff;
  color: #6172d8;
}
.stat-icon.success {
  background: #e8f8f1;
  color: #168a5f;
}
.stat-card > small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 15px;
}
.stat-card > strong {
  display: block;
  font:
    700 31px/1.2 "Space Grotesk",
    sans-serif;
  margin-top: 4px;
}
.stat-card > p {
  margin: 4px 0 0;
  color: #96a3ab;
  font-size: 10px;
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.45fr 0.8fr;
  gap: 14px;
  margin-bottom: 14px;
}
.activity-panel,
.pipeline-panel,
.records-panel,
.detail-main,
.detail-side {
  padding: 21px;
}
.panel-head,
/* 05. ENQUIRY RECORDS, FILTERS AND TABLE */
.records-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.panel-head h2,
.records-top h2,
.detail-main h2 {
  font:
    700 20px "Space Grotesk",
    sans-serif;
  margin: 0;
}
.panel-head > span,
.records-top > span {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #7d8d97;
  background: #f3f7f9;
  padding: 7px 9px;
  border-radius: 99px;
  font-weight: 800;
}
.chart {
  height: 220px;
  display: flex;
  align-items: flex-end;
  gap: 13px;
  padding: 30px 6px 0;
  position: relative;
}
.chart-lines {
  position: absolute;
  inset: 25px 0 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.chart-lines i {
  border-top: 1px dashed #e6edf1;
}
.bar-item {
  height: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.bar-wrap {
  height: 180px;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.bar {
  width: min(34px, 75%);
  min-height: 9px;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, #4bd5f4, #0b8fbe);
  position: relative;
  box-shadow: 0 8px 18px rgba(11, 143, 190, 0.15);
}
.bar b {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
}
.bar-item small {
  font-size: 9px;
  color: var(--muted);
  margin-top: 7px;
}
.pipeline-list {
  display: grid;
  margin-top: 10px;
}
.pipeline-list a {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px;
  padding: 10px 0;
  border-bottom: 1px solid #edf2f4;
}
.pipeline-list a > span {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
}
.pipeline-list a > strong {
  font-size: 11px;
}
.pipeline-list a > div {
  grid-column: 1/-1;
  height: 4px;
  background: #edf2f4;
  border-radius: 99px;
  overflow: hidden;
}
.pipeline-list a > div b {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #0b91bf, #55d8f4);
  border-radius: 99px;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #0ba7d9;
}
.dot.contacted {
  background: #6a7fe0;
}
.dot.quoted {
  background: #e89b2c;
}
.dot.scheduled {
  background: #9c67d5;
}
.dot.completed {
  background: #1aa36f;
}
.records-top p:last-child {
  color: var(--muted);
  font-size: 11px;
  margin: 6px 0 0;
}
.filters {
  display: grid;
  grid-template-columns: minmax(250px, 1fr) 150px 220px auto auto;
  gap: 9px;
  margin: 18px 0;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  background: #fff;
}
.search-box span {
  color: var(--blue);
}
.search-box input {
  border: 0;
  outline: 0;
  width: 100%;
  padding: 11px 0;
  background: transparent;
  font-size: 11px;
}
.filters select,
.detail-side select {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 11px;
  font-size: 11px;
  color: var(--ink);
}
.filters button {
  border: 0;
  border-radius: 10px;
  padding: 0 16px;
  background: var(--navy2);
  color: #fff;
  font-weight: 800;
  font-size: 11px;
  cursor: pointer;
}
.clear-link {
  display: grid;
  place-items: center;
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 930px;
}
th {
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  color: #86959e;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.11em;
}
td {
  padding: 14px 12px;
  border-bottom: 1px solid #edf2f4;
  font-size: 11px;
  vertical-align: middle;
}
td > strong {
  display: block;
}
.customer {
  display: flex;
  align-items: center;
  gap: 10px;
}
.customer > span,
.detail-person > span {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #dff6fb, #bfeaf4);
  color: #087fa7;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 10px;
  flex: 0 0 auto;
}
.customer div {
  display: grid;
  gap: 3px;
}
.customer small,
.message-preview,
.subtle {
  display: block;
  color: #8b9aa3;
  font-size: 9px;
}
.message-preview {
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 4px;
}
.status {
  display: inline-flex;
  align-items: center;
  padding: 6px 9px;
  border-radius: 99px;
  font-size: 9px;
  font-weight: 800;
}
.status-new {
  background: #e2f5fb;
  color: #087fa7;
}
.status-contacted {
  background: #e9edff;
  color: #586cc8;
}
.status-quoted {
  background: #fff0dc;
  color: #bd761a;
}
.status-scheduled {
  background: #f0e8fb;
  color: #7d52ad;
}
.status-completed {
  background: #e4f7ef;
  color: #168358;
}
.status-cancelled {
  background: #fbe7e7;
  color: #b34b4b;
}
.table-action {
  font-weight: 800;
  color: #078bb8;
}
.table-action span {
  margin-left: 5px;
}
.empty-state {
  text-align: center;
  padding: 44px;
  color: var(--muted);
}
.empty-state > span {
  display: block;
  font-size: 26px;
  margin-bottom: 8px;
}
.empty-state strong {
  display: block;
  color: var(--ink);
  font: 700 18px "Space Grotesk";
}
.empty-state p {
  font-size: 11px;
}
.flash {
  padding: 12px 15px;
  border-radius: 11px;
  margin-bottom: 15px;
  font-size: 11px;
}
.flash.success {
  background: #e4f7ef;
  color: #176e4e;
}
.flash.warning {
  background: #fff0dc;
  color: #8f5d1c;
}
.flash.danger {
  background: #fbe7e7;
  color: #a04444;
}
.back-link {
  display: inline-block;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 18px;
}
.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.detail-person {
  display: flex;
  align-items: center;
  gap: 14px;
}
.detail-person > span {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  font-size: 15px;
}
/* 06. ENQUIRY DETAIL VIEW */
.detail-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.7fr;
  gap: 14px;
}
.message-box {
  margin: 18px 0;
  background: #f4fafc;
  border-left: 3px solid var(--blue);
  padding: 18px;
  line-height: 1.7;
  font-size: 12px;
  white-space: pre-wrap;
}
.detail-data {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.detail-data div {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px;
}
.detail-data small,
.contact-action span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  margin-bottom: 5px;
}
.contact-action {
  display: block;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}
.contact-action.whatsapp strong {
  color: #168a5f;
}
.detail-side hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 18px 0;
}
.detail-side form {
  display: grid;
  gap: 9px;
  margin-top: 10px;
}
.detail-side label {
  display: grid;
  gap: 7px;
  font-size: 10px;
  font-weight: 800;
}
.danger-btn {
  border: 1px solid #f0c8c8;
  background: #fff;
  color: var(--red);
  border-radius: 10px;
  padding: 10px;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}
.row-actions {
  display: flex;
  gap: 7px;
}
.row-actions form {
  margin: 0;
}
.row-actions button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 9px;
  cursor: pointer;
}
.row-actions .delete-link {
  color: var(--red);
}
/* 07. ADMIN LOGIN */
.login-body {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  background: #fff;
}
.login-visual {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(3, 25, 39, 0.88), rgba(4, 38, 57, 0.72)),
    url("brand-mark.jpg") center/cover no-repeat;
  display: flex;
  align-items: flex-end;
  padding: 8vw;
  color: #fff;
}
.login-visual:before {
  content: "";
  position: absolute;
  inset: auto -15% -30% -10%;
  height: 55%;
  background: radial-gradient(
    ellipse at center,
    rgba(74, 213, 244, 0.3),
    transparent 65%
  );
  transform: rotate(-8deg);
}
.login-glow {
  position: absolute;
  top: 12%;
  right: 8%;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 1px solid rgba(86, 215, 244, 0.18);
  box-shadow:
    0 0 0 35px rgba(86, 215, 244, 0.035),
    0 0 0 70px rgba(86, 215, 244, 0.02);
}
.visual-copy {
  position: relative;
  max-width: 560px;
}
.visual-copy h2 {
  font: 700 clamp(36px, 5vw, 66px) / 1.02 "Space Grotesk";
  margin: 22px 0 14px;
}
.visual-copy > p {
  color: #a8c3d1;
  line-height: 1.7;
  max-width: 500px;
}
.visual-stats {
  display: flex;
  gap: 40px;
  margin-top: 35px;
}
.visual-stats div {
  display: grid;
}
.visual-stats strong {
  font: 700 20px "Space Grotesk";
}
.visual-stats small {
  color: #8fabba;
  font-size: 9px;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.login-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 50px;
}
.login-inner {
  width: min(410px, 100%);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 60px;
}
.login-brand > span {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(13, 44, 64, 0.12);
}
.login-brand img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.login-brand div {
  display: grid;
}
.login-brand small {
  color: #0b90bd;
}
.login-card h1 {
  font: 700 44px/1 "Space Grotesk";
  margin: 0;
}
.muted {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.login-form {
  display: grid;
  gap: 15px;
  margin-top: 24px;
}
.login-form label {
  display: grid;
  gap: 7px;
  font-size: 10px;
  font-weight: 800;
}
.login-form label > div {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0 12px;
}
.login-form label > div:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(11, 167, 217, 0.08);
}
.login-form input {
  border: 0;
  outline: 0;
  width: 100%;
  padding: 12px 0;
}
.login-note {
  display: block;
  color: #91a0a9;
  margin-top: 15px;
  font-size: 9px;
}
.overlay {
  display: none;
}
/* 08. RESPONSIVE LAYOUT — tablet first, then mobile. */
@media (max-width: 1100px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  .dashboard-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .filters {
    grid-template-columns: 1fr 1fr;
  }
  .search-box {
    grid-column: 1/-1;
  }
  .login-body {
    grid-template-columns: 1fr;
  }
  .login-visual {
    display: none;
  }
  .login-card {
    min-height: 100vh;
  }
  .login-brand {
    margin-bottom: 40px;
  }
}
@media (max-width: 760px) {
  .sidebar {
    transform: translateX(-100%);
    transition: 0.25s;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
  }
  .menu-btn {
    display: block;
  }
  .topbar {
    padding: 0 16px;
  }
  .topbar-copy {
    display: none;
  }
  .top-actions > a:first-child {
    display: none;
  }
  .page-wrap {
    padding: 20px 14px;
  }
  .welcome-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .welcome-actions {
    width: 100%;
    justify-content: space-between;
  }
  .stats-grid {
    gap: 9px;
  }
  .stat-card {
    padding: 14px;
  }
  .stat-icon {
    width: 33px;
    height: 33px;
  }
  .stat-card > strong {
    font-size: 25px;
  }
  .stat-card > p {
    display: none;
  }
  .filters {
    grid-template-columns: 1fr;
  }
  .search-box {
    grid-column: auto;
  }
  .filters button {
    padding: 11px;
  }
  .detail-head {
    align-items: flex-start;
  }
  .detail-data {
    grid-template-columns: 1fr;
  }
  .overlay.show {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.42);
    z-index: 35;
  }
  .login-card {
    padding: 28px 22px;
  }
  .login-card h1 {
    font-size: 38px;
  }
  .visual-stats {
    gap: 20px;
  }
}
