:root {
  --navy: #03111f;
  --navy-deep: #020b14;
  --navy-mid: #061b30;
  --navy-soft: #0a2239;
  --blue: #0b2d5b;

  --brass: #d4af37;
  --brass-light: #edcc72;
  --brass-dark: #9e7825;

  --white: #f7f4ed;
  --muted: #89939e;
  --muted-light: #b8c0c7;

  --line: rgba(255, 255, 255, 0.09);
  --line-brass: rgba(212, 175, 55, 0.28);

  --panel: rgba(255, 255, 255, 0.025);
  --panel-hover: rgba(255, 255, 255, 0.045);

  --success: #70c695;
  --warning: #e1b95c;
  --danger: #d98282;

  --sidebar-width: 260px;
  --header-height: 96px;

  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--navy-deep);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 75% 10%, rgba(11, 45, 91, 0.16), transparent 36rem),
    var(--navy-deep);
  color: var(--white);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

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

button {
  color: inherit;
}

button,
select {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--brass);
  color: var(--navy-deep);
}


/* =========================================================
   SHARED BRAND
========================================================= */

.eyebrow,
.header-eyebrow {
  display: block;
  color: var(--brass);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.28em;
  line-height: 1.4;
}

.brand-symbol {
  position: relative;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-brass);
  border-radius: 50%;
  color: var(--brass-light);
  font-family: var(--serif);
  font-size: 29px;
}

.brand-symbol.small {
  width: 44px;
  height: 44px;
  font-size: 22px;
}

.brand-diamond {
  position: absolute;
  top: -5px;
  left: 50%;
  width: 7px;
  height: 7px;
  background: var(--brass-light);
  transform: translateX(-50%) rotate(45deg);
}

.brand-word {
  color: var(--white);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.34em;
}

.brand-subtitle {
  margin-top: 5px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.24em;
}


/* =========================================================
   LOGIN
========================================================= */

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(440px, 0.82fr) 1.18fr;
  background: var(--navy-deep);
}

.login-panel {
  min-height: 100vh;
  padding: 52px clamp(44px, 6vw, 96px);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
  border-right: 1px solid var(--line);
}

.login-brand,
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.login-copy {
  margin: auto 0 42px;
  max-width: 540px;
}

.login-copy h1,
.welcome-row h1,
.page-heading h1 {
  margin: 18px 0 22px;
  font-family: var(--serif);
  font-size: clamp(58px, 6vw, 88px);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.9;
}

.login-copy h1 em,
.welcome-row h1 em,
.page-heading h1 em {
  color: var(--brass-light);
  font-weight: 400;
}

.login-copy p {
  max-width: 430px;
  margin: 0;
  color: var(--muted-light);
  font-size: 14px;
  line-height: 1.8;
}

.login-form {
  width: 100%;
  max-width: 520px;
  margin-bottom: auto;
}

.login-form > label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted-light);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.password-field {
  display: flex;
  align-items: stretch;
  min-height: 58px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  transition: border-color 180ms ease, background 180ms ease;
}

.password-field:focus-within {
  border-color: var(--brass-dark);
  background: rgba(255, 255, 255, 0.04);
}

.password-field input {
  flex: 1;
  min-width: 0;
  padding: 0 18px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--white);
  font-size: 16px;
}

.password-toggle {
  width: 78px;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.password-toggle:hover {
  color: var(--brass-light);
}

.form-error {
  min-height: 21px;
  margin: 10px 0 4px;
  color: #e69a9a;
  font-size: 12px;
}

.primary-button {
  width: 100%;
  min-height: 58px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  background: linear-gradient(135deg, var(--brass), var(--brass-light));
  color: var(--navy-deep);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  transition: transform 180ms ease, filter 180ms ease;
}

.primary-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.login-footer {
  margin-top: 48px;
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  color: #64707b;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.18em;
}

.login-art {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background:
    linear-gradient(140deg, rgba(11, 45, 91, 0.25), transparent 48%),
    var(--navy);
}

.login-art::before {
  content: "";
  position: absolute;
  width: 600px;
  height: 600px;
  right: -160px;
  top: -160px;
  border: 1px solid rgba(212, 175, 55, 0.08);
  border-radius: 50%;
}

.login-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom left, black, transparent 75%);
}

.layer {
  position: absolute;
  width: min(56vw, 720px);
  height: min(34vw, 430px);
  border: 1px solid rgba(212, 175, 55, 0.18);
  transform: rotate(-8deg) skewX(-4deg);
}

.layer-one {
  right: -7%;
  top: 15%;
  background: rgba(11, 45, 91, 0.26);
}

.layer-two {
  right: 3%;
  top: 29%;
  background: rgba(5, 24, 42, 0.78);
}

.layer-three {
  right: 13%;
  top: 43%;
  padding: 52px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background:
    linear-gradient(135deg, rgba(212, 175, 55, 0.07), transparent 60%),
    #06182a;
  box-shadow: 0 40px 100px rgba(0,0,0,.34);
}

.layer-three span {
  display: block;
  color: var(--white);
  font-family: var(--serif);
  font-size: clamp(46px, 6vw, 92px);
  letter-spacing: -0.06em;
  line-height: 0.75;
}

.layer-three span:last-child {
  color: var(--brass-light);
}


/* =========================================================
   ADMIN LAYOUT
========================================================= */

.admin-app {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  width: var(--sidebar-width);
  padding: 32px 24px 26px;
  display: flex;
  flex-direction: column;
  background: #020d17;
  border-right: 1px solid var(--line);
}

.sidebar-brand {
  padding: 0 7px 31px;
  border-bottom: 1px solid var(--line);
}

.sidebar-nav {
  margin-top: 35px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: #8f99a2;
  text-align: left;
  font-size: 12px;
  transition: 160ms ease;
}

.nav-item:hover {
  color: var(--white);
  background: rgba(255,255,255,.025);
}

.nav-item.active {
  color: var(--white);
  border-color: var(--line-brass);
  background:
    linear-gradient(90deg, rgba(212,175,55,.08), transparent);
}

.nav-number {
  color: var(--brass-dark);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.nav-count {
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--muted-light);
  font-size: 9px;
}

.sidebar-bottom {
  margin-top: auto;
}

.system-status {
  margin-bottom: 20px;
  padding: 17px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.018);
}

.status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 5px rgba(112,198,149,.08);
}

.system-status strong,
.system-status small {
  display: block;
}

.system-status strong {
  color: var(--muted-light);
  font-size: 10px;
  font-weight: 600;
}

.system-status small {
  margin-top: 4px;
  color: #65717b;
  font-size: 8px;
  letter-spacing: 0.1em;
}

.logout-button {
  width: 100%;
  padding: 14px;
  display: flex;
  justify-content: space-between;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: #717d87;
  font-size: 10px;
}

.logout-button:hover {
  color: var(--brass-light);
}

.admin-main {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.admin-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--header-height);
  padding: 0 clamp(28px, 4vw, 60px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(2, 11, 20, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.admin-header h2 {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 400;
}

.header-eyebrow {
  font-size: 7px;
  color: var(--muted);
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--muted);
  font-size: 10px;
}

.admin-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-brass);
  border-radius: 50%;
  color: var(--brass-light);
  font-family: var(--serif);
  font-size: 17px;
}

.mobile-menu-button {
  display: none;
}

.admin-content {
  padding: clamp(34px, 5vw, 72px) clamp(28px, 5vw, 72px) 80px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}


/* =========================================================
   DASHBOARD
========================================================= */

.welcome-row,
.page-heading {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 380px);
  align-items: end;
  gap: 60px;
  margin-bottom: 58px;
}

.welcome-row h1,
.page-heading h1 {
  margin-bottom: 0;
  font-size: clamp(48px, 5vw, 76px);
}

.welcome-row > p,
.page-heading-copy p {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.stat-card {
  min-height: 210px;
  padding: 25px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  background: var(--panel);
}

.stat-card.featured {
  border-color: var(--line-brass);
  background:
    linear-gradient(135deg, rgba(212,175,55,.07), transparent 65%),
    var(--panel);
}

.stat-top {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.15em;
}

.stat-index {
  color: var(--brass-dark);
}

.stat-card strong {
  margin-top: auto;
  color: var(--white);
  font-family: var(--serif);
  font-size: 64px;
  font-weight: 400;
  letter-spacing: -0.05em;
  line-height: 1;
}

.stat-card.featured strong {
  color: var(--brass-light);
}

.stat-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.panel {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.018);
}

.recent-panel {
  padding: 28px;
}

.panel-heading {
  margin-bottom: 25px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
}

.panel-heading h3 {
  margin: 7px 0 0;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 400;
}

.text-button {
  padding: 8px 0;
  display: flex;
  gap: 16px;
  border: 0;
  background: transparent;
  color: var(--muted-light);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.text-button:hover {
  color: var(--brass-light);
}


/* =========================================================
   ENQUIRY LIST
========================================================= */

.enquiry-list {
  border-top: 1px solid var(--line);
}

.enquiry-row {
  min-height: 82px;
  padding: 16px 8px;
  display: grid;
  grid-template-columns: minmax(190px, 1.3fr) minmax(140px, 1fr) minmax(130px, .8fr) 110px 110px 30px;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  transition: background 150ms ease;
}

.enquiry-row:hover {
  background: rgba(255,255,255,.022);
}

.enquiry-primary strong,
.enquiry-business strong {
  display: block;
  color: var(--white);
  font-size: 11px;
  font-weight: 600;
}

.enquiry-primary small,
.enquiry-business small,
.enquiry-date,
.enquiry-project {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.reference {
  color: var(--brass-dark) !important;
  font-size: 8px !important;
  letter-spacing: 0.08em;
}

.status-badge {
  width: fit-content;
  padding: 7px 9px;
  border: 1px solid var(--line);
  color: var(--muted-light);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.status-badge.new {
  border-color: rgba(212,175,55,.3);
  color: var(--brass-light);
}

.status-badge.contacted,
.status-badge.qualified {
  color: #9fbde0;
}

.status-badge.won {
  color: var(--success);
}

.status-badge.closed {
  color: #777f86;
}

.row-open {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--brass-dark);
  font-size: 16px;
}

.row-open:hover {
  color: var(--brass-light);
}

.empty-state {
  padding: 52px 20px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 20px;
  text-align: center;
}


/* =========================================================
   ENQUIRIES PAGE
========================================================= */

.toolbar {
  margin-bottom: 14px;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 190px;
  gap: 12px;
}

.search-field {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.02);
  color: var(--muted);
}

.search-field input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--white);
  font-size: 11px;
}

.search-field input::placeholder {
  color: #66717b;
}

.toolbar select {
  padding: 0 14px;
  border: 1px solid var(--line);
  outline: 0;
  background: #06131f;
  color: var(--muted-light);
  font-size: 10px;
}

.table-header {
  min-height: 46px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: minmax(190px, 1.3fr) minmax(140px, 1fr) minmax(130px, .8fr) 110px 110px 30px;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  color: #65717b;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: .16em;
}

.table-body .enquiry-row {
  padding-left: 24px;
  padding-right: 24px;
}


/* =========================================================
   DRAWER
========================================================= */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 6, 12, .65);
  opacity: 0;
  visibility: hidden;
  transition: 220ms ease;
  backdrop-filter: blur(3px);
}

.drawer-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.enquiry-drawer {
  position: fixed;
  z-index: 90;
  inset: 0 0 0 auto;
  width: min(640px, 92vw);
  display: flex;
  flex-direction: column;
  background: #04111e;
  border-left: 1px solid var(--line-brass);
  transform: translateX(101%);
  transition: transform 260ms cubic-bezier(.22,.8,.24,1);
  box-shadow: -30px 0 90px rgba(0,0,0,.32);
}

.enquiry-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  min-height: 110px;
  padding: 26px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.drawer-header h2 {
  margin: 7px 0 0;
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 400;
}

.drawer-close {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted-light);
  font-size: 24px;
  font-weight: 200;
}

.drawer-close:hover {
  border-color: var(--line-brass);
  color: var(--brass-light);
}

.drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 30px;
}

.drawer-loading {
  padding: 50px 0;
  color: var(--muted);
  text-align: center;
}

.detail-section {
  padding: 25px 0;
  border-bottom: 1px solid var(--line);
}

.detail-section:first-child {
  padding-top: 0;
}

.detail-section h3 {
  margin: 0 0 18px;
  color: var(--brass);
  font-size: 8px;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 30px;
}

.detail-item span {
  display: block;
  margin-bottom: 6px;
  color: #66717b;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.detail-item strong,
.detail-item p {
  margin: 0;
  color: var(--muted-light);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.detail-item.full {
  grid-column: 1 / -1;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.detail-tag {
  padding: 7px 9px;
  border: 1px solid var(--line);
  color: var(--muted-light);
  font-size: 8px;
}

.status-control {
  width: 100%;
  min-height: 48px;
  padding: 0 13px;
  border: 1px solid var(--line-brass);
  outline: 0;
  background: var(--navy-deep);
  color: var(--white);
  font-size: 11px;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1100px) {
  :root {
    --sidebar-width: 220px;
  }

  .enquiry-row,
  .table-header {
    grid-template-columns: minmax(170px, 1.2fr) minmax(130px, 1fr) 105px 100px 28px;
  }

  .enquiry-project,
  .table-header span:nth-child(3) {
    display: none;
  }
}

@media (max-width: 860px) {
  .login-screen {
    display: block;
  }

  .login-panel {
    min-height: 100vh;
    border-right: 0;
  }

  .login-art {
    display: none;
  }

  .sidebar {
    width: 270px;
    transform: translateX(-101%);
    transition: transform 220ms ease;
    box-shadow: 20px 0 60px rgba(0,0,0,.4);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .admin-main {
    margin-left: 0;
  }

  .mobile-menu-button {
    width: 40px;
    height: 40px;
    margin-right: 16px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--muted-light);
  }

  .admin-header {
    justify-content: flex-start;
  }

  .header-meta {
    margin-left: auto;
  }

  .welcome-row,
  .page-heading {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stat-card:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 650px) {
  .login-panel {
    padding: 30px 24px;
  }

  .login-copy {
    margin-top: auto;
  }

  .login-copy h1 {
    font-size: 56px;
  }

  .admin-header {
    height: 82px;
    padding: 0 18px;
  }

  .admin-header h2 {
    font-size: 20px;
  }

  .header-meta #currentDate {
    display: none;
  }

  .admin-content {
    padding: 35px 18px 60px;
  }

  .welcome-row,
  .page-heading {
    margin-bottom: 35px;
  }

  .welcome-row h1,
  .page-heading h1 {
    font-size: 48px;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }

  .stat-card:first-child {
    grid-column: auto;
  }

  .stat-card {
    min-height: 160px;
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

  .toolbar select {
    min-height: 48px;
  }

  .table-header {
    display: none;
  }

  .table-body .enquiry-row,
  .enquiry-row {
    padding: 18px;
    grid-template-columns: 1fr auto;
    gap: 10px;
  }

  .enquiry-business,
  .enquiry-project,
  .enquiry-date {
    display: none;
  }

  .status-badge {
    grid-column: 1;
  }

  .row-open {
    grid-column: 2;
    grid-row: 1 / 3;
  }

  .recent-panel {
    padding: 20px;
  }

  .enquiry-drawer {
    width: 100%;
  }

  .drawer-header,
  .drawer-content {
    padding-left: 22px;
    padding-right: 22px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-item.full {
    grid-column: auto;
  }
}
