/* --------------------------------------------------------------------------
   The hidden attribute must actually hide.

   The browser's built-in [hidden] { display: none } rule has the lowest
   specificity, so any layout class that sets display silently defeats it.
   .form-grid { display: grid } is one such class, which meant every element
   toggled with hidden in the admin JS - the cover section, the document
   fields, the township plan - stayed visible no matter what the code asked for.

   !important is deliberate: it is the documented way to make hidden win, and
   without it the behaviour depends on which layout class an element carries.

   ------------------------------------------------------------------------ */

[hidden] { display: none !important; }
/* ==========================================================================
   One Touch Marketing — Admin Panel
   "Frosted Nocturne" design system

   Direction: a deep, softly-lit night interior. Panels are frosted glass
   floating over slow-moving colour blooms, corners are generously rounded,
   and every control is a pill. Hairline highlights (inset 1px white) do the
   work that drop-shadows do in flatter systems, so surfaces read as lit from
   above rather than pasted on.

   Two typefaces, used with intent:
     Outfit   — headings, navigation, buttons, numerals. Geometric, a little
                architectural; it carries the "designed" feeling.
     Manrope  — running text, tables, form labels. Quieter, very legible at
                13–15px where most of this UI lives.
     System mono — identifiers, hashes, anything that must align in a column.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Accents */
  --gold:        #E9C463;
  --gold-soft:   #F2D98F;
  --gold-deep:   #B98F2E;
  --gold-glow:   rgba(233, 196, 99, .30);
  --cyan:        #5FC8F5;
  --cyan-glow:   rgba(95, 200, 245, .26);
  --green:       #57DFA6;
  --green-glow:  rgba(87, 223, 166, .22);
  --amber:       #FFC15E;
  --red:         #FF7E88;
  --red-glow:    rgba(255, 126, 136, .22);
  --blue:        #79AEFF;
  --violet:      #A98BFF;

  /* Night base */
  --night-0: #05080F;
  --night-1: #080D18;
  --night-2: #0C1322;
  --night-3: #121B2E;

  /* Glass */
  --glass:        linear-gradient(158deg, rgba(255,255,255,.075), rgba(255,255,255,.022));
  --glass-strong: linear-gradient(158deg, rgba(255,255,255,.115), rgba(255,255,255,.04));
  --glass-sunk:   linear-gradient(158deg, rgba(0,0,0,.22), rgba(0,0,0,.10));
  --hairline:     rgba(255,255,255,.095);
  --hairline-hi:  rgba(255,255,255,.18);
  --edge-light:   inset 0 1px 0 rgba(255,255,255,.075);
  --edge-light-2: inset 0 1px 0 rgba(255,255,255,.13);
  --blur:         blur(26px) saturate(155%);

  /* Ink */
  --text:       #E9EEF8;
  --text-soft:  #B3C0D8;
  --text-dim:   #7F8FAC;
  --text-mute:  #5D6C89;

  /* Geometry */
  --r-2xl: 30px;
  --r-xl:  24px;
  --r-lg:  18px;
  --r-md:  14px;
  --r-sm:  10px;
  --r-pill: 999px;

  /* Elevation — two-part so the glass never looks pasted on */
  --lift-1: 0 2px 6px -2px rgba(0,0,0,.55);
  --lift-2: 0 14px 34px -16px rgba(0,0,0,.85);
  --lift-3: 0 30px 70px -28px rgba(0,0,0,.95);

  --ease: cubic-bezier(.22, 1, .36, 1);
  --sidebar-w: 272px;
}

/* --------------------------------------------------------------------------
   2. Reset
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: 'Manrope', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.55;
  font-feature-settings: 'kern' 1, 'liga' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* Three slow colour blooms sit behind the glass so backdrop-filter has
     something to actually blur. Fixed so they don't travel with the scroll. */
  background-color: var(--night-0);
  background-image:
    radial-gradient(58vw 52vw at 8% -8%,  rgba(95, 200, 245, .20), transparent 62%),
    radial-gradient(52vw 48vw at 104% 6%,  rgba(233, 196, 99, .16), transparent 60%),
    radial-gradient(64vw 58vw at 46% 112%, rgba(121, 174, 255, .17), transparent 64%),
    radial-gradient(40vw 40vw at 82% 62%,  rgba(169, 139, 255, .12), transparent 66%),
    linear-gradient(180deg, var(--night-1), var(--night-0) 58%);
  background-attachment: fixed, fixed, fixed, fixed, fixed;
}

/* Fine film grain keeps the large gradients from banding on wide gamut screens. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.34'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

h1, h2, h3, h4 {
  font-family: 'Outfit', ui-sans-serif, system-ui, sans-serif;
  font-weight: 600;
  letter-spacing: -.018em;
  color: #F4F7FD;
  margin: 0;
}
h1 { font-size: 25px; line-height: 1.15; letter-spacing: -.028em; }
h2 { font-size: 17.5px; letter-spacing: -.02em; }

a { color: var(--gold-soft); text-decoration: none; }
a:hover { color: #FBE9B4; }

hr { border: 0; border-top: 1px solid var(--hairline); margin: 14px 0; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 6px;
}

::selection { background: rgba(233, 196, 99, .28); color: #fff; }

/* Scrollbars, so long tables don't drag a bright grey bar across the glass. */
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.16) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.13);
  border-radius: var(--r-pill);
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.24); background-clip: content-box; }

/* The sprite itself must never occupy layout. */
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
/* Inline-block by default so an icon can sit inside a line of text (e.g. the
   likes/comments counts). Flex parents re-align it as a flex item anyway. */
svg.ic {
  width: 1.15em;
  height: 1.15em;
  display: inline-block;
  vertical-align: -.16em;
  flex: none;
  overflow: visible;
}

/* --------------------------------------------------------------------------
   3. Shell
   -------------------------------------------------------------------------- */
.shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  gap: 20px;
  padding: 20px;
  min-height: 100vh;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: calc(100vh - 40px);
  padding: 20px 14px 14px;
  border-radius: var(--r-2xl);
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--hairline);
  box-shadow: var(--lift-3), var(--edge-light-2);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 8px 14px;
  border-bottom: 1px solid var(--hairline);
}
.sidebar-logo {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  object-fit: cover;
  box-shadow: 0 6px 16px -6px rgba(0,0,0,.8), 0 0 0 1px rgba(255,255,255,.10);
}
.sidebar-brand-text { display: flex; flex-direction: column; line-height: 1.22; min-width: 0; }
.sidebar-brand-text strong {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.02em;
}
.sidebar-brand-text span {
  font-size: 10.5px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--text-mute);
  font-weight: 600;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  margin: 0 -4px;
  padding: 2px 4px;
  flex: 1;
}
.sidebar-nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--r-md);
  color: var(--text-soft);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -.006em;
  white-space: nowrap;
  transition: background .22s var(--ease), color .22s var(--ease), transform .22s var(--ease);
}
.sidebar-nav a .ic {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  font-size: 15px;
  color: var(--text-dim);
  background: rgba(255,255,255,.035);
  border: 1px solid transparent;
  transition: color .22s var(--ease), background .22s var(--ease), border-color .22s var(--ease), box-shadow .22s var(--ease);
}
.sidebar-nav a .ic svg { width: 17px; height: 17px; }
.nav-label { overflow: hidden; text-overflow: ellipsis; }

.sidebar-nav a:hover {
  color: #fff;
  background: rgba(255,255,255,.05);
}
.sidebar-nav a:hover .ic {
  color: var(--text);
  background: rgba(255,255,255,.08);
  border-color: var(--hairline);
}

/* Active: a lit gold pill plus a rail on the left edge. */
.sidebar-nav a.active {
  color: #FFF8E6;
  background: linear-gradient(100deg, rgba(233,196,99,.19), rgba(233,196,99,.05) 62%, transparent);
  box-shadow: inset 0 0 0 1px rgba(233,196,99,.22);
}
.sidebar-nav a.active::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 19px;
  border-radius: var(--r-pill);
  background: linear-gradient(180deg, var(--gold-soft), var(--gold-deep));
  box-shadow: 0 0 12px var(--gold-glow);
}
.sidebar-nav a.active .ic {
  color: var(--gold-soft);
  background: rgba(233,196,99,.16);
  border-color: rgba(233,196,99,.30);
  box-shadow: 0 0 16px -4px var(--gold-glow);
}

.nav-badge {
  margin-left: auto;
  min-width: 21px;
  height: 21px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-pill);
  background: linear-gradient(160deg, var(--gold), var(--gold-deep));
  color: #23180A;
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .01em;
  box-shadow: 0 4px 12px -4px var(--gold-glow), inset 0 1px 0 rgba(255,255,255,.4);
}

.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 8px 6px;
  border-top: 1px solid var(--hairline);
}
.sidebar-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sidebar-user-text { min-width: 0; line-height: 1.25; }
.sidebar-user .name {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user .role {
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-mute);
  font-weight: 600;
}
.avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: var(--r-pill);
  background: linear-gradient(150deg, rgba(233,196,99,.30), rgba(121,174,255,.24));
  border: 1px solid var(--hairline-hi);
  color: #FFF6E0;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 14px;
  box-shadow: var(--edge-light);
}
.avatar-sm { width: 32px; height: 32px; font-size: 12.5px; }

.logout {
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: var(--r-pill);
  color: var(--text-dim);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--hairline);
  transition: color .2s var(--ease), background .2s var(--ease), transform .2s var(--ease);
}
.logout svg { width: 16px; height: 16px; }
.logout:hover { color: var(--red); background: var(--red-glow); border-color: rgba(255,126,136,.3); transform: translateY(-1px); }

.sidebar-credit {
  text-align: center;
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-mute);
  padding-top: 2px;
}
.credit-link { font-weight: 700; color: var(--text-dim); }
.credit-link:hover { color: var(--gold); }

.sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(3, 6, 12, .68);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .28s var(--ease), visibility .28s;
}

/* --------------------------------------------------------------------------
   4. Main column + header
   -------------------------------------------------------------------------- */
.main { min-width: 0; display: flex; flex-direction: column; gap: 18px; }

.topbar {
  position: sticky;
  top: 20px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 20px;
  border-radius: var(--r-xl);
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--hairline);
  box-shadow: var(--lift-2), var(--edge-light-2);
}
.topbar h1 { flex: 1; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px 6px 10px;
  border-radius: var(--r-pill);
  background: rgba(255,255,255,.045);
  border: 1px solid var(--hairline);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--text-dim);
  white-space: nowrap;
}
.status-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-mute);
}
.status-pill.is-ok { color: #CDEFE1; border-color: rgba(87,223,166,.26); background: rgba(87,223,166,.09); }
.status-pill.is-ok .dot {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(87,223,166,.16), 0 0 10px var(--green-glow);
  animation: pulse-dot 2.6s var(--ease) infinite;
}
.status-pill.is-down { color: #FFD9DC; border-color: rgba(255,126,136,.28); background: rgba(255,126,136,.1); }
.status-pill.is-down .dot { background: var(--red); box-shadow: 0 0 10px var(--red-glow); }

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 3px rgba(87,223,166,.16), 0 0 10px var(--green-glow); }
  50%      { box-shadow: 0 0 0 5px rgba(87,223,166,.07), 0 0 14px var(--green-glow); }
}

.hamburger {
  display: none;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: var(--r-md);
  background: rgba(255,255,255,.05);
  border: 1px solid var(--hairline);
  color: var(--text);
  cursor: pointer;
}
.hamburger svg { width: 19px; height: 19px; }

.content {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-bottom: 28px;
}

/* --------------------------------------------------------------------------
   5. Stat tiles
   -------------------------------------------------------------------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(216px, 1fr));
  gap: 14px;
}
.stat-card {
  position: relative;
  overflow: hidden;
  padding: 18px 18px 17px;
  border-radius: var(--r-xl);
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--hairline);
  box-shadow: var(--lift-2), var(--edge-light);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
/* A whisper of colour in the corner so the grid isn't uniformly grey. */
.stat-card::after {
  content: '';
  position: absolute;
  inset: -40% 55% 55% -40%;
  background: radial-gradient(circle at 30% 70%, var(--gold-glow), transparent 70%);
  opacity: .5;
  pointer-events: none;
  transition: opacity .3s var(--ease);
}
.stat-card:nth-child(3n+2)::after { background: radial-gradient(circle at 30% 70%, var(--cyan-glow), transparent 70%); }
.stat-card:nth-child(3n)::after   { background: radial-gradient(circle at 30% 70%, rgba(121,174,255,.22), transparent 70%); }
.stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--hairline-hi);
  box-shadow: var(--lift-3), var(--edge-light-2);
}
.stat-card:hover::after { opacity: .95; }

.stat-card .label {
  position: relative;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.stat-card .value {
  position: relative;
  margin-top: 7px;
  font-family: 'Outfit', sans-serif;
  font-size: 29px;
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  color: #F7FAFF;
}
.stat-card .sub {
  position: relative;
  margin-top: 5px;
  font-size: 12px;
  color: var(--text-dim);
}
.stat-card .sub a { font-weight: 600; }

/* --------------------------------------------------------------------------
   6. Panels
   -------------------------------------------------------------------------- */
.panel {
  border-radius: var(--r-2xl);
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--hairline);
  box-shadow: var(--lift-2), var(--edge-light);
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 18px 22px;
  border-bottom: 1px solid var(--hairline);
  background: linear-gradient(180deg, rgba(255,255,255,.035), transparent);
}
.panel-head h2 { flex: 1; min-width: 160px; }
.panel-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.panel-body { padding: 20px 22px; }

.helper-note {
  /* Was display:flex, which made every text node and every <strong> a separate
     flex item with a 9px gap between them. "Booking price is charged <strong>per
     plot</strong> - the township no longer has one" rendered as three stacked
     columns: "Booking price is" | "per" | "- the township no longer...".
     None of the 28 helper notes in the admin carry an icon, so block flow is
     what they actually want; the icon rule below still applies if one is added. */
  display: block;
  padding: 12px 14px;
  border-radius: var(--r-lg);
  background: rgba(95, 200, 245, .07);
  border: 1px solid rgba(95, 200, 245, .16);
  color: var(--text-soft);
  font-size: 12.5px;
  line-height: 1.5;
}
.helper-note strong { color: #D9ECFA; font-weight: 600; }
.helper-note svg.ic { width: 15px; height: 15px; margin-top: 1px; color: var(--cyan); }

.flex-spacer { flex: 1; }

/* --------------------------------------------------------------------------
   7. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-family: 'Outfit', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -.005em;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  color: var(--text);
  background: rgba(255,255,255,.055);
  border-color: var(--hairline);
  box-shadow: var(--lift-1);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease),
              background .18s var(--ease), border-color .18s var(--ease), opacity .18s var(--ease);
}
.btn svg.ic { width: 15px; height: 15px; }
.btn:hover { background: rgba(255,255,255,.10); border-color: var(--hairline-hi); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled, .btn.is-busy { opacity: .55; pointer-events: none; }

.btn-primary {
  background: linear-gradient(158deg, var(--gold-soft), var(--gold) 42%, var(--gold-deep));
  color: #201703;
  border-color: rgba(255,255,255,.22);
  box-shadow: 0 8px 22px -10px var(--gold-glow), inset 0 1px 0 rgba(255,255,255,.55);
}
.btn-primary:hover {
  background: linear-gradient(158deg, #F8E4A6, var(--gold-soft) 44%, var(--gold));
  box-shadow: 0 12px 28px -10px var(--gold-glow), inset 0 1px 0 rgba(255,255,255,.6);
}
/* Historic alias used by the property-setup screens. */
.btn-gold {
  background: linear-gradient(158deg, var(--gold-soft), var(--gold) 42%, var(--gold-deep));
  color: #201703;
  border-color: rgba(255,255,255,.22);
  box-shadow: 0 8px 22px -10px var(--gold-glow), inset 0 1px 0 rgba(255,255,255,.55);
}
.btn-gold:hover { background: linear-gradient(158deg, #F8E4A6, var(--gold-soft) 44%, var(--gold)); }

.btn-outline {
  background: transparent;
  border-color: rgba(255,255,255,.2);
  color: var(--text-soft);
}
.btn-outline:hover { background: rgba(255,255,255,.07); color: #fff; }

.btn-danger {
  background: var(--red-glow);
  border-color: rgba(255,126,136,.30);
  color: #FFD9DC;
}
.btn-danger:hover { background: rgba(255,126,136,.24); border-color: rgba(255,126,136,.5); color: #fff; }

.btn-sm { min-height: 32px; padding: 6px 14px; font-size: 12.5px; }
/* btn-icon is a fixed 34px square while btn-sm is 32px, so mixing them in one
   row (an "Activate" label beside four icons) left the label sitting a pixel
   off the icons once the row was centred. Give the icon variant the same
   height as the size it is paired with. */
.btn.btn-sm.btn-icon { height: 30px; min-height: 30px; width: 30px; }
.btn-mini { min-height: 27px; padding: 4px 11px; font-size: 11.5px; gap: 5px; }
.btn-mini svg.ic { width: 13px; height: 13px; }
.btn-block { width: 100%; }
.btn-icon {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: var(--r-pill);
}
.btn-icon svg.ic { width: 16px; height: 16px; }

/* --------------------------------------------------------------------------
   8. Forms
   -------------------------------------------------------------------------- */
input, select, textarea {
  width: 100%;
  padding: 10px 14px;
  min-height: 40px;
  border-radius: var(--r-md);
  border: 1px solid var(--hairline);
  background: var(--glass-sunk);
  color: var(--text);
  font-family: 'Manrope', sans-serif;
  font-size: 13.5px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.28);
  transition: border-color .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease);
  appearance: none;
  -webkit-appearance: none;
}
textarea { min-height: 92px; resize: vertical; line-height: 1.55; }
input::placeholder, textarea::placeholder { color: var(--text-mute); }
input:hover, select:hover, textarea:hover { border-color: var(--hairline-hi); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: rgba(233,196,99,.5);
  background: rgba(0,0,0,.30);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.28), 0 0 0 3px rgba(233,196,99,.12);
}
select {
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237F8FAC' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9.5 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 16px;
  cursor: pointer;
}
select option { background: var(--night-2); color: var(--text); }
input[type="checkbox"], input[type="radio"] {
  width: 18px;
  height: 18px;
  min-height: 0;
  flex: none;
  padding: 0;
  border-radius: 6px;
  cursor: pointer;
  background-color: rgba(0,0,0,.3);
}
input[type="checkbox"]:checked, input[type="radio"]:checked {
  background-color: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(233,196,99,.16);
}
input[type="color"] { padding: 3px; height: 40px; cursor: pointer; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, label > span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}
.form-grid .span-2 { grid-column: span 2; }
.cols-1 { grid-template-columns: 1fr; }
.hint { font-size: 11.5px; color: var(--text-mute); line-height: 1.45; }

.search-input { position: relative; display: flex; align-items: center; }
.search-input svg.ic {
  position: absolute;
  left: 13px;
  width: 16px;
  height: 16px;
  color: var(--text-mute);
  pointer-events: none;
}
.search-input input { padding-left: 38px; border-radius: var(--r-pill); }

.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-bottom: 1px solid var(--hairline);
}
.filter-bar .search-input { flex: 1; min-width: 210px; }
.filter-bar select, .filter-bar input { width: auto; min-width: 140px; }

.toggle-label { display: flex; align-items: center; gap: 11px; cursor: pointer; }
.toggle-desc { font-size: 12px; color: var(--text-mute); }

/* --------------------------------------------------------------------------
   9. Tables
   -------------------------------------------------------------------------- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  /* A dense table (Members has eight columns) genuinely cannot fit a laptop
     viewport, and scrolling is the right answer - but only if it is obvious the
     table continues. The default overlay scrollbar is invisible until hovered,
     which made a scrollable table read as a clipped one, with the delete button
     apparently chopped off the right edge. Always show a thin track. */
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.22) transparent;
}
.table-wrap::-webkit-scrollbar { height: 9px; }
.table-wrap::-webkit-scrollbar-track { background: transparent; }
.table-wrap::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.22);
  border-radius: 99px;
}
.table-wrap::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.34); }
table.data {
  /* max-content was wrong and made this worse: it sizes every column to the
     widest its content could ever be, so a table grew past the viewport and the
     row-action buttons - the one thing the admin must be able to reach - were
     pushed off-screen. The table belongs to its container and stays in it.
     Individual unbreakable units opt out with .nowrap instead. */
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
}
/* Only when a table genuinely cannot fit does it scroll, and then everything in
   it - including the actions column - is still reachable. */
table.data { min-width: 720px; }
/* Amounts, dates and identifiers are single tokens; breaking one mid-token makes
   the column unreadable ("PKR 58," / "999"). The nowrap class is applied to a
   span *inside* the cell, so it must be selected as a descendant - td.nowrap
   never matched it. */
table.data td .nowrap,
table.data td .money,
table.data td .num { white-space: nowrap; }
/* Long unbroken strings (a pasted caption, a URL, a run of "AAAA…") used to
   force the whole table wider than the viewport, which pushed the row actions
   off-screen where nobody could reach them. breaking-word only splits a token that
   genuinely cannot fit, and - unlike nywhere - does not shrink the column's
   minimum width the way overflow-wrap:anywhere would. */
table.data th, table.data td {
  overflow-wrap: break-word;
  word-break: break-word;
}
/* A badge, a phone number or an amount is a single unbreakable unit; breaking it
   mid-token is never right, and these cells are never what makes a table wide. */
table.data td:has(> .badge),
table.data td:has(> a.badge),
table.data td.actions {
  overflow-wrap: normal;
  word-break: normal;
}
table.data td { max-width: 460px; }
table.data th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  padding: 12px 13px;
  font-family: 'Outfit', sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--text-mute);
  background: rgba(9, 14, 24, .82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hairline);
  white-space: nowrap;
}
table.data td {
  padding: 13px 13px;
  border-bottom: 1px solid rgba(255,255,255,.05);
  vertical-align: middle;
  color: var(--text-soft);
}
table.data tbody tr { transition: background .16s var(--ease); }
table.data tbody tr:hover td { background: rgba(255,255,255,.035); }
table.data tbody tr:last-child td { border-bottom: 0; }

.cell-strong { color: #F1F5FC; font-weight: 600; }
.cell-muted { color: var(--text-mute); font-size: 12.5px; }
.mono { font-family: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace; font-size: 12px; letter-spacing: -.01em; }
/* Row actions live in a <td> - all 17 .actions in the admin are cells, none are
   divs - and display:flex on a table cell silently stops it being a table cell.
   It collapsed to the buttons' own height and sat at the top of the row, so in
   a 94px Plots row the edit and delete icons floated up top with 60px of dead
   space beneath them, and vertical-align:middle did nothing because there was
   no longer a cell to align. Lay the buttons out inline in the cell instead. */
.actions {
  text-align: right;
  white-space: nowrap;
  vertical-align: middle;
}
/* Inline buttons still shrink if the column is squeezed, and a shrunk text
   button wraps its own label, leaving it two lines tall beside one-line icon
   buttons. Pin each to its natural width; the whitespace between them in the
   markup provides the gap. */
.actions > .btn,
.actions > a.btn {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  vertical-align: middle;
}
.actions > * + * { margin-left: 4px; }
/* The actions column never needs to grow, but an empty header cell in an
   auto-layout table soaks up spare width: in Members it took 241px while Phone
   was left 91px and Paid 75px. Pinning it to 1% makes it shrink to its buttons
   and hands the slack back to the data columns. */
table.data td.actions { width: 1%; }
/* A badge is one unit; breaking it mid-label puts the text on top of itself. */
.badge { white-space: nowrap; }
/* Phone numbers are identifiers, not prose. */
table.data td a[href^="tel:"] { white-space: nowrap; }
.row-del { text-align: right; white-space: nowrap; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); }

/* --------------------------------------------------------------------------
   10. Badges
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 11px;
  border-radius: var(--r-pill);
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .03em;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge svg.ic { width: 12px; height: 12px; }
.badge-gold  { background: rgba(233,196,99,.15); color: var(--gold-soft); border-color: rgba(233,196,99,.28); }
.badge-green { background: var(--green-glow);  color: #9BEFC9; border-color: rgba(87,223,166,.28); }
.badge-red   { background: var(--red-glow);    color: #FFC2C7; border-color: rgba(255,126,136,.30); }
.badge-amber { background: rgba(255,193,94,.15); color: var(--amber); border-color: rgba(255,193,94,.30); }
.badge-blue  { background: rgba(121,174,255,.15); color: #AFCBFF; border-color: rgba(121,174,255,.30); }
.badge-gray  { background: rgba(255,255,255,.07); color: var(--text-dim); border-color: var(--hairline); }

/* --------------------------------------------------------------------------
   11. Empty / skeleton / pagination
   -------------------------------------------------------------------------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 44px 22px;
  text-align: center;
  color: var(--text-mute);
}
.empty-state svg.ic { width: 34px; height: 34px; color: var(--text-mute); opacity: .55; }
.empty-state p { margin: 0; font-size: 13px; }

.skeleton {
  height: 14px;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, rgba(255,255,255,.05), rgba(255,255,255,.12), rgba(255,255,255,.05));
  background-size: 220% 100%;
  animation: shimmer 1.5s linear infinite;
}
.skeleton-row td { padding: 16px; }
@keyframes shimmer { from { background-position: 220% 0; } to { background-position: -20% 0; } }

.pagination {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 15px 20px;
  border-top: 1px solid var(--hairline);
}
.pagination .pages { display: flex; align-items: center; gap: 5px; margin-left: auto; flex-wrap: wrap; }
.pagination button, .pagination .page {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--hairline);
  background: rgba(255,255,255,.04);
  color: var(--text-soft);
  font-family: 'Outfit', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}
.pagination button:hover:not(:disabled) { background: rgba(255,255,255,.09); color: #fff; }
.pagination button:disabled { opacity: .35; cursor: not-allowed; }
.pagination svg.ic { width: 15px; height: 15px; }
.pagination .page.active {
  background: linear-gradient(158deg, var(--gold-soft), var(--gold-deep));
  color: #201703;
  border-color: rgba(255,255,255,.22);
  box-shadow: 0 6px 16px -8px var(--gold-glow);
}

/* --------------------------------------------------------------------------
   12. Modal
   -------------------------------------------------------------------------- */
/* Structure is  <div class="modal-backdrop"><div class="modal">…</div></div>
   built by Admin.openModal(), which appends the backdrop on open and removes it
   on close - there is no "open" class, so the backdrop must always be the
   visible overlay, and it is also the click-outside target. */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  overflow-y: auto;
  background: rgba(3, 6, 12, .68);
  backdrop-filter: blur(7px) saturate(120%);
  -webkit-backdrop-filter: blur(7px) saturate(120%);
  animation: modal-in .26s var(--ease);
}
.modal {
  position: relative;
  width: min(680px, 100%);
  max-height: calc(100vh - 44px);
  overflow-y: auto;
  border-radius: var(--r-2xl);
  background: linear-gradient(158deg, rgba(23,32,50,.96), rgba(11,17,29,.97));
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--hairline-hi);
  box-shadow: var(--lift-3), var(--edge-light-2);
  animation: card-rise .3s var(--ease);
}
.modal.confirm { width: min(440px, 100%); }
.modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--hairline);
}
.modal-head h2, .modal-head h3 { flex: 1; min-width: 0; }
/* The dismiss button is written as a bare <button data-cancel>&times;</button>,
   so it needs to be dressed here. */
.modal-head > button:not(.btn) {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: var(--r-pill);
  border: 1px solid var(--hairline);
  background: rgba(255,255,255,.05);
  color: var(--text-dim);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  transition: color .18s var(--ease), background .18s var(--ease);
}
.modal-head > button:not(.btn):hover { color: var(--text); background: rgba(255,255,255,.11); }
.modal-body { padding: 22px; }
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid var(--hairline);
  background: rgba(0,0,0,.16);
}
@keyframes modal-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes card-rise { from { opacity: 0; transform: translateY(16px) scale(.985); } to { opacity: 1; transform: none; } }

/* --------------------------------------------------------------------------
   13. Toast + alert
   -------------------------------------------------------------------------- */
.toast-stack {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-width: min(380px, calc(100vw - 44px));
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 16px;
  border-radius: var(--r-lg);
  background: linear-gradient(158deg, rgba(23,32,50,.95), rgba(11,17,29,.97));
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--hairline-hi);
  box-shadow: var(--lift-3);
  color: var(--text-soft);
  font-size: 13px;
  animation: toast-in .32s var(--ease);
}
.toast svg.ic { width: 17px; height: 17px; margin-top: 1px; }
/* toasts are plain text nodes, so the type is carried by a lit left edge */
.toast { border-left: 3px solid var(--hairline-hi); }
.toast.success { border-color: rgba(87,223,166,.34); border-left-color: var(--green); }
.toast.success svg.ic { color: var(--green); }
.toast.error { border-color: rgba(255,126,136,.36); border-left-color: var(--red); }
.toast.error svg.ic { color: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: none; } }

.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 16px;
  border-radius: var(--r-lg);
  font-size: 13px;
  border: 1px solid var(--hairline);
  background: rgba(255,255,255,.05);
  color: var(--text-soft);
}
.alert svg.ic { width: 17px; height: 17px; margin-top: 1px; flex: none; }
.alert-error { background: var(--red-glow); border-color: rgba(255,126,136,.3); color: #FFD2D6; }
.alert-error svg.ic { color: var(--red); }
.info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-dim);
}
.info svg.ic { width: 15px; height: 15px; color: var(--cyan); }

/* --------------------------------------------------------------------------
   14. Feature blocks
   -------------------------------------------------------------------------- */

/* Receipts */
.receipt-modal { max-width: 560px; }
.receipt-thumb {
  border-radius: var(--r-md);
  border: 1px solid var(--hairline);
  box-shadow: var(--lift-1);
  object-fit: cover;
  background: rgba(0,0,0,.3);
}
/* The receipt thumbnail the server generates is 420px on its long edge. Without
   an explicit box the img laid out at its natural size, so drawing a table cell
   pulled in a full-resolution photo - the whole reason the thumbnail was added.
   Pin it to a small preview and let the modal show the original. */
.receipt-thumb {
  display: block;
  width: 64px;
  height: 78px;
  max-width: 100%;
  object-fit: cover;
  cursor: pointer;
}
.society-cover-thumb {
  border-radius: var(--r-md);
  border: 1px solid var(--hairline);
  box-shadow: var(--lift-1);
  object-fit: cover;
  background: rgba(0,0,0,.3);
}
/* The generated cover thumbnail is 400x225. Without an explicit size the img
   laid itself out at its natural width, so one cover made its row ~225px tall
   and pushed the rest of the list off the screen. Pin it to a small 16:9 box. */
.society-cover-thumb {
  display: block;
  width: 88px;
  height: 50px;
  max-width: 100%;
  object-fit: cover;
  /* If the file is ever missing, the browser draws the alt text inside this
     88x50 box and it spills over the next column. The element is replaced by a
     placeholder by societies.js; this keeps the instant before that invisible. */
  overflow: hidden;
  font-size: 0;
  color: transparent;
}
/* Shown in the plot form when a plot has no picture of its own: the picture a
   member will actually see, because the API substitutes the society cover. */
.society-image-fallback {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 10px;
  border: 1px dashed var(--hairline);
  border-radius: var(--r-lg);
  background: rgba(0,0,0,.18);
}
.society-image-fallback img {
  width: 96px;
  height: 54px;
  object-fit: cover;
  border-radius: var(--r-md);
  border: 1px solid var(--hairline);
  flex: 0 0 auto;
}
.receipt-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--r-md);
  background: rgba(255,255,255,.05);
  border: 1px solid var(--hairline);
}
.receipt-file svg.ic { width: 17px; height: 17px; color: var(--text-dim); }
.receipt-meta { display: grid; gap: 8px; }
.receipt-meta .k, .audit-kv .k { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-mute); font-weight: 700; }
.receipt-meta .v, .audit-kv .v { color: var(--text); font-weight: 500; }

/* Feeds moderation */
.feed-preview {
  display: flex;
  gap: 13px;
  padding: 13px;
  border-radius: var(--r-lg);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--hairline);
}
.feed-media-thumb {
  width: 82px;
  height: 82px;
  flex: none;
  border-radius: var(--r-md);
  object-fit: cover;
  border: 1px solid var(--hairline);
  background: rgba(0,0,0,.3);
}
.feed-preview-meta { display: grid; gap: 4px; align-content: start; min-width: 0; max-width: 560px; }
  overflow-wrap: break-word;

/* Cover uploader */
.cover-drop {
  display: grid;
  place-items: center;
  gap: 9px;
  padding: 30px 22px;
  text-align: center;
  border-radius: var(--r-xl);
  border: 1.5px dashed rgba(255,255,255,.2);
  background: rgba(255,255,255,.03);
  color: var(--text-dim);
  cursor: pointer;
  transition: border-color .22s var(--ease), background .22s var(--ease), transform .22s var(--ease);
}
.cover-drop:hover { border-color: rgba(233,196,99,.5); background: rgba(233,196,99,.06); }
.cover-drop svg.ic { width: 26px; height: 26px; color: var(--text-mute); }
.cover-preview { position: relative; border-radius: var(--r-xl); overflow: hidden; border: 1px solid var(--hairline); }
/* The class is put on the <img> itself in the society form (image-picker.js
   wraps it instead), so both shapes need the sizing or the preview renders at
   its natural width and overflows the modal. */
.cover-preview img,
img.cover-preview { display: block; width: 100%; max-height: 260px; object-fit: cover; }
.cover-empty { display: grid; place-items: center; min-height: 150px; color: var(--text-mute); }
.cover-bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: rgba(0,0,0,.4);
  overflow: hidden;
}
.cover-bar > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-soft));
  transition: width .3s var(--ease);
}
.cover-status { font-size: 12px; color: var(--text-dim); }
.cover-bar.is-busy { opacity: 1; }
.cover-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Payment schedule editor */
.sched-editor { display: grid; gap: 10px; }
.sched-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sched-table th {
  text-align: left;
  padding: 9px 11px;
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-mute);
  border-bottom: 1px solid var(--hairline);
}
.sched-table td { padding: 8px 11px; border-bottom: 1px solid rgba(255,255,255,.05); }
.sch-month { font-weight: 600; color: var(--text); white-space: nowrap; }
.sch-amount, .sch-type { font-variant-numeric: tabular-nums; color: var(--text-soft); }
.sch-del { text-align: right; }
.sched-paid { color: var(--green); font-weight: 600; }
.sched-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Taxonomy chips */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  border-radius: var(--r-pill);
  background: rgba(255,255,255,.045);
  border: 1px solid var(--hairline);
  font-size: 13px;
  color: var(--text-soft);
  cursor: pointer;
  transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.chip-check:hover { background: rgba(255,255,255,.08); color: #fff; }
.chip-check:has(input:checked) {
  background: rgba(233,196,99,.14);
  border-color: rgba(233,196,99,.38);
  color: var(--gold-soft);
  box-shadow: 0 0 18px -8px var(--gold-glow);
}
.option-box { display: grid; gap: 10px; }

/* Settings */
.settings-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 20px;
  border-bottom: 1px solid var(--hairline);
}
.settings-group { display: grid; gap: 14px; padding: 18px 22px; border-bottom: 1px solid var(--hairline); }
.settings-group:last-child { border-bottom: 0; }

/* Audit log */
.audit-detail {
  display: grid;
  gap: 12px;
  padding: 15px;
  border-radius: var(--r-lg);
  background: var(--glass-sunk);
  border: 1px solid var(--hairline);
}
.audit-kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; font-size: 13px; }
.audit-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-mute); }
.audit-diff {
  font-family: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  font-size: 12px;
  line-height: 1.6;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: rgba(0,0,0,.34);
  border: 1px solid var(--hairline);
  color: var(--text-soft);
  white-space: pre-wrap;
  word-break: break-word;
}
.audit-diff .add { color: var(--green); }
.audit-diff .del { color: var(--red); }

/* Tabs (Feeds / property filters) */
.tab-bar {
  display: flex;
  gap: 4px;
  padding: 5px;
  border-radius: var(--r-pill);
  background: rgba(0,0,0,.28);
  border: 1px solid var(--hairline);
  overflow-x: auto;
}
.tab-btn {
  padding: 8px 17px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text-dim);
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  background: linear-gradient(158deg, rgba(255,255,255,.15), rgba(255,255,255,.07));
  color: #fff;
  box-shadow: var(--edge-light);
}
.tab-pane { display: block; }
/* Panes are shown/hidden with the `hidden` attribute (feeds.js sets
   `pane.hidden = true`), never with an `active` class. Hiding every .tab-pane
   by default would hide the visible one too. */
.tab-pane[hidden] { display: none; }
.tab-pane:not([hidden]) { animation: fade-up .28s var(--ease); }
@keyframes fade-up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* --------------------------------------------------------------------------
   15. Login
   -------------------------------------------------------------------------- */
.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 26px;
}
.login-card {
  width: min(430px, 100%);
  padding: 30px;
  border-radius: 34px;
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--hairline-hi);
  box-shadow: var(--lift-3), var(--edge-light-2);
  animation: card-rise .5s var(--ease);
}
.login-brand { text-align: center; margin-bottom: 22px; }
.login-logo-img {
  width: 62px;
  height: 62px;
  border-radius: 20px;
  object-fit: cover;
  box-shadow: 0 12px 30px -12px rgba(0,0,0,.9), 0 0 0 1px rgba(255,255,255,.12);
}
.login-brand h1 {
  margin-top: 14px;
  font-size: 23px;
  letter-spacing: -.03em;
}
.login-brand p {
  margin: 3px 0 0;
  font-size: 10.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--text-mute);
  font-weight: 700;
}
.login-ayat {
  margin: 18px 0 0;
  padding: 16px 14px;
  border-radius: var(--r-xl);
  background: var(--glass-sunk);
  border: 1px solid var(--hairline);
}
.ayat-arabic {
  margin: 0;
  font-size: 21px;
  line-height: 1.9;
  direction: rtl;
  color: var(--gold-soft);
  letter-spacing: .01em;
}
.ayat-divider { width: 42px; margin: 11px auto; border-top: 1px solid rgba(233,196,99,.34); }
.ayat-urdu { margin: 0; font-size: 13px; line-height: 1.85; direction: rtl; color: var(--text-soft); }
.ayat-english { margin: 9px 0 0; font-size: 12.5px; font-style: italic; color: var(--text-dim); }
.ayat-source { margin: 5px 0 0; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-mute); }

.login-form { display: grid; gap: 13px; margin-top: 20px; }
.login-form label { display: grid; gap: 6px; }
.login-credit {
  margin: 20px 0 0;
  text-align: center;
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.login-card .alert { margin-bottom: 14px; }

/* --------------------------------------------------------------------------
   16. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1080px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: 14px;
    left: 14px;
    bottom: 14px;
    z-index: 50;
    width: min(300px, calc(100vw - 28px));
    max-height: none;
    transform: translateX(calc(-100% - 24px));
    transition: transform .34s var(--ease);
  }
  .sidebar.open { transform: none; }
  .sidebar-overlay.open { opacity: 1; visibility: visible; }
  .hamburger { display: grid; }
  .topbar { top: 14px; }
  .status-pill { display: none; }
}

@media (max-width: 620px) {
  .shell { padding: 12px; gap: 14px; }
  .topbar { padding: 11px 15px; border-radius: var(--r-lg); }
  h1 { font-size: 20px; }
  .stat-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 11px; }
  .stat-card { padding: 15px; border-radius: var(--r-lg); }
  .stat-card .value { font-size: 24px; }
  .panel, .modal-box { border-radius: var(--r-xl); }
  .panel-head, .panel-body, .settings-group { padding: 15px 16px; }
  table.data th, table.data td { padding: 11px 12px; }
  .form-grid .span-2 { grid-column: span 1; }
  .toast-stack { right: 12px; left: 12px; bottom: 12px; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
