/* ============================================================
   Secure Bhilai Solutions — Admin panel styles
   Clean, standard, practical: light workspace + navy sidebar
   ============================================================ */

:root {
  --a-bg: #F3F5F9;
  --a-panel: #FFFFFF;
  --a-ink: #16233B;
  --a-soft: #4A5872;
  --a-muted: #8592A8;
  --a-line: #E3E8F0;
  --a-navy: #0C1830;
  --a-navy-2: #12203C;
  --a-accent: #2563EB;
  --a-accent-soft: #EAF1FE;
  --a-cyan: #0891B2;
  --a-green: #16A34A;
  --a-amber: #D97706;
  --a-red: #DC2626;
  --a-wa: #1DA851;
  --a-r: 12px;
  --a-shadow: 0 1px 2px rgba(22, 35, 59, .05), 0 8px 24px -12px rgba(22, 35, 59, .12);
}

*, *::before, *::after { box-sizing: border-box; }
body.a-body {
  margin: 0;
  background: var(--a-bg);
  color: var(--a-ink);
  font: 400 15px/1.55 "Inter", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--a-accent); text-decoration: none; }
a:hover { text-decoration: none; }
img { max-width: 100%; }
h1, h2, h3 { font-family: "Sora", "Inter", system-ui, sans-serif; margin: 0; letter-spacing: -.01em; }
button { font-family: inherit; cursor: pointer; }

/* ---------- Layout ---------- */
.a-layout { display: flex; min-height: 100vh; }

.a-sidebar {
  width: 248px; flex: none;
  background: linear-gradient(180deg, var(--a-navy), var(--a-navy-2));
  color: #C9D4E8;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.a-brand {
  display: flex; align-items: center; gap: .7rem;
  padding: 1.15rem 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.a-brand strong { display: block; color: #fff; font: 700 .92rem "Sora", sans-serif; line-height: 1.25; }
.a-brand small { color: #7C8DB0; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; }
.a-nav { display: flex; flex-direction: column; gap: 2px; padding: .9rem .7rem; flex: 1; }
.a-nav a {
  display: flex; align-items: center; gap: .7rem;
  color: #AAB8D0; font: 500 .92rem "Inter", sans-serif;
  padding: .62rem .8rem; border-radius: 9px;
  transition: background .15s ease, color .15s ease;
}
.a-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.a-nav a.active { background: rgba(34, 211, 238, .14); color: #67E8F9; }
.a-nav a.active svg { color: #67E8F9; }
.a-side-foot { padding: 1rem; border-top: 1px solid rgba(255, 255, 255, .07); }
.a-side-foot a { color: #7C8DB0; font-size: .85rem; }
.a-side-foot a:hover { color: #fff; }

.a-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.a-topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--a-line);
  display: flex; align-items: center; gap: 1rem;
  padding: .85rem 1.6rem;
}
.a-topbar h1 { font-size: 1.15rem; font-weight: 700; margin-right: auto; }
.a-burger { display: none; background: none; border: 1px solid var(--a-line); border-radius: 8px; padding: .45rem .55rem; flex-direction: column; gap: 4px; }
.a-burger span { width: 18px; height: 2px; background: var(--a-ink); border-radius: 2px; display: block; }
.a-user { display: flex; align-items: center; gap: .7rem; }
.a-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--a-accent-soft); color: var(--a-accent);
  font: 700 .9rem "Sora", sans-serif;
}
.a-username { font-weight: 600; font-size: .9rem; }
.a-logout-form { margin: 0; }
.a-logout {
  background: none; border: 1px solid var(--a-line); border-radius: 8px;
  padding: .42rem .8rem; font: 600 .82rem "Inter", sans-serif; color: var(--a-soft);
  transition: all .15s ease;
}
.a-logout:hover { border-color: var(--a-red); color: var(--a-red); }

.a-content { padding: 1.6rem; max-width: 1200px; width: 100%; }

/* ---------- Flash ---------- */
.a-flash {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  border-radius: 10px; padding: .8rem 1.1rem; margin-bottom: 1.1rem;
  font-size: .92rem; border: 1px solid;
}
.a-flash-success { background: #ECFDF3; border-color: #ABEFC6; color: #067647; }
.a-flash-error   { background: #FEF3F2; border-color: #FECDCA; color: #B42318; }
.a-flash-info    { background: #EFF8FF; border-color: #B2DDFF; color: #175CD3; }
.a-flash-x { background: none; border: 0; font-size: 1.1rem; color: inherit; opacity: .6; }
.a-flash-x:hover { opacity: 1; }

/* ---------- Stat cards ---------- */
.a-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.4rem; }
.a-stat {
  background: var(--a-panel); border: 1px solid var(--a-line); border-radius: var(--a-r);
  box-shadow: var(--a-shadow);
  display: flex; align-items: center; gap: .9rem; padding: 1.05rem 1.15rem;
}
.a-stat-icon {
  width: 44px; height: 44px; border-radius: 11px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.a-stat strong { display: block; font: 700 1.45rem "Sora", sans-serif; line-height: 1.1; }
.a-stat span { color: var(--a-muted); font-size: .8rem; font-weight: 500; }
.a-stat-total .a-stat-icon { background: #EFF4FF; color: var(--a-accent); }
.a-stat-new   .a-stat-icon { background: #FFF6E6; color: var(--a-amber); }
.a-stat-today .a-stat-icon { background: #ECFDF3; color: var(--a-green); }
.a-stat-conv  .a-stat-icon { background: #E6FAF5; color: #0E9384; }

/* ---------- Cards ---------- */
.a-card {
  background: var(--a-panel); border: 1px solid var(--a-line); border-radius: var(--a-r);
  box-shadow: var(--a-shadow);
  padding: 1.3rem 1.4rem; margin-bottom: 1.4rem;
}
.a-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin-bottom: 1.1rem; flex-wrap: wrap;
}
.a-card-head h2 { font-size: 1.08rem; }
.a-empty {
  color: var(--a-muted); text-align: center; padding: 2.2rem 1rem;
  border: 1px dashed var(--a-line); border-radius: 10px; margin: 0;
}
.a-muted { color: var(--a-muted); }

/* ---------- Buttons ---------- */
.a-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  border-radius: 9px; border: 1px solid transparent;
  padding: .6rem 1.05rem; font: 600 .88rem "Inter", sans-serif;
  transition: all .15s ease; white-space: nowrap;
}
.a-btn-sm { padding: .42rem .8rem; font-size: .82rem; }
.a-btn-block { width: 100%; }
.a-btn-primary { background: var(--a-accent); color: #fff; }
.a-btn-primary:hover { background: #1D4ED8; }
.a-btn-outline { background: #fff; border-color: var(--a-line); color: var(--a-soft); }
.a-btn-outline:hover { border-color: #C4CEDC; color: var(--a-ink); }
.a-btn-danger { background: #FEF3F2; border-color: #FECDCA; color: var(--a-red); }
.a-btn-danger:hover { background: var(--a-red); border-color: var(--a-red); color: #fff; }
.a-btn-wa { background: var(--a-wa); color: #fff; }
.a-btn-wa:hover { background: #158940; }
.a-btn[disabled] { opacity: .6; pointer-events: none; }

/* ---------- Forms ---------- */
.a-form, .a-form-grid { margin: 0; }
.a-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.1rem; margin-bottom: 1rem; }
.a-form-grid.a-cols-2, .a-form-grid.a-cols-3 { margin-bottom: 1.1rem; }
.a-cols-3 { grid-template-columns: repeat(3, 1fr); }
.a-field { display: flex; flex-direction: column; gap: .4rem; }
.a-field label { font: 600 .84rem "Inter", sans-serif; color: var(--a-soft); }
.a-field label h3 { font-size: .95rem; }
.a-hint { color: var(--a-muted); font-size: .78rem; }
.a-input {
  width: 100%;
  border: 1px solid #D5DCE8; border-radius: 9px;
  background: #fff; color: var(--a-ink);
  padding: .62rem .8rem; font: 400 .92rem "Inter", sans-serif;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.a-input:focus { outline: none; border-color: var(--a-accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .14); }
textarea.a-input { resize: vertical; min-height: 90px; }
select.a-input { appearance: auto; }
.a-input-file { padding: .5rem; }
.a-input-file::file-selector-button {
  border: 1px solid var(--a-line); background: #fff; color: var(--a-soft);
  border-radius: 7px; padding: .4rem .8rem; margin-right: .8rem;
  font: 600 .82rem "Inter", sans-serif; cursor: pointer;
}
.a-form-actions { display: flex; gap: .7rem; margin-top: 1.1rem; }
.a-inline-form { display: inline-flex; margin: 0; }
.a-field-check { justify-content: flex-start; gap: .55rem; }
.a-check { display: inline-flex; align-items: center; gap: .5rem; font-size: .9rem; color: var(--a-ink); font-weight: 500; }
.a-check input { width: 16px; height: 16px; accent-color: var(--a-accent); }
.a-check-col { flex-direction: column; align-items: flex-start; justify-content: center; }
.a-detail { display: flex; flex-direction: column; gap: .15rem; }

/* ---------- Tables ---------- */
.a-table-wrap { overflow-x: auto; border: 1px solid var(--a-line); border-radius: 10px; }
.a-table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 640px; }
.a-table th {
  text-align: left; font: 600 .74rem "Inter", sans-serif;
  letter-spacing: .07em; text-transform: uppercase; color: var(--a-muted);
  background: #F8FAFD;
  padding: .7rem .95rem; border-bottom: 1px solid var(--a-line);
  white-space: nowrap;
}
.a-table td { padding: .78rem .95rem; border-bottom: 1px solid var(--a-line); vertical-align: middle; }
.a-table tbody tr:last-child td { border-bottom: 0; }
.a-table tbody tr:hover { background: #FAFBFE; }
.a-actions { display: flex; gap: .45rem; align-items: center; white-space: nowrap; }
.a-flag-col { display: flex; gap: .45rem; align-items: center; flex-wrap: wrap; }
.a-price { font-weight: 700; }
.a-price-call { color: var(--a-amber); font-weight: 600; font-size: .84rem; }

.a-thumb {
  width: 56px; height: 42px; object-fit: cover; border-radius: 7px;
  border: 1px solid var(--a-line); background: #EEF2F8; display: inline-flex;
}
.a-thumb-empty { align-items: center; justify-content: center; color: var(--a-muted); }
.a-thumb-lg { max-width: 220px; max-height: 150px; object-fit: cover; border-radius: 9px; border: 1px solid var(--a-line); }

/* ---------- Toggles & badges ---------- */
.a-toggle {
  border: 1px solid var(--a-line); background: #fff; color: var(--a-muted);
  border-radius: 999px; padding: .3rem .75rem; font: 600 .76rem "Inter", sans-serif;
  transition: all .15s ease; white-space: nowrap;
}
.a-toggle.on { background: #ECFDF3; border-color: #ABEFC6; color: #067647; }
.a-toggle.feat { background: #FFF6E6; border-color: #FDE27A; color: #B54708; }
.a-toggle.plain { opacity: .8; }

.badge {
  display: inline-flex; align-items: center;
  border-radius: 999px; padding: .22rem .62rem;
  font: 600 .72rem "Inter", sans-serif; white-space: nowrap;
  border: 1px solid;
}
.badge-new       { background: #EFF8FF; border-color: #B2DDFF; color: #175CD3; }
.badge-contacted { background: #FFF6E6; border-color: #FDE27A; color: #B54708; }
.badge-follow-up { background: #F4F3FF; border-color: #D9D6FE; color: #5925DC; }
.badge-converted { background: #ECFDF3; border-color: #ABEFC6; color: #067647; }
.badge-closed    { background: #F2F4F7; border-color: #E4E7EC; color: #475467; }

/* Select tinted by current status */
.a-select-sm.status-new       { border-color: #B2DDFF; color: #175CD3; }
.a-select-sm.status-contacted { border-color: #FDE27A; color: #B54708; }
.a-select-sm.status-follow-up { border-color: #D9D6FE; color: #5925DC; }
.a-select-sm.status-converted { border-color: #ABEFC6; color: #067647; }
.a-select-sm.status-closed    { border-color: #E4E7EC; color: #475467; }

/* ---------- Tabs / search / pagination ---------- */
.a-tabs { display: flex; gap: .45rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.a-tab {
  border: 1px solid var(--a-line); background: #fff; color: var(--a-soft);
  border-radius: 999px; padding: .4rem .95rem; font: 600 .84rem "Inter", sans-serif;
}
.a-tab b { color: var(--a-muted); font-weight: 700; margin-left: .15rem; }
.a-tab.active { background: var(--a-navy); border-color: var(--a-navy); color: #fff; }
.a-tab.active b { color: #9FB2D6; }
.a-search-form { display: flex; gap: .5rem; margin: 0; }
.a-search-form .a-input { width: 260px; }
.a-pagination { display: flex; align-items: center; gap: 1rem; margin-top: 1.1rem; }
.a-status-form { display: inline-flex; margin: 0; }

/* ---------- Icon buttons (call / wa) ---------- */
.a-icon-btn {
  width: 32px; height: 32px; border-radius: 8px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--a-line); background: #fff; color: var(--a-accent);
  transition: all .15s ease;
}
.a-icon-btn:hover { border-color: var(--a-accent); background: var(--a-accent-soft); }
.a-icon-btn.wa { color: var(--a-wa); }
.a-icon-btn.wa:hover { border-color: var(--a-wa); background: #ECFDF3; }

/* ---------- Dashboard quick links ---------- */
.a-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.a-quick-card {
  background: var(--a-panel); border: 1px solid var(--a-line); border-radius: var(--a-r);
  box-shadow: var(--a-shadow);
  padding: 1.05rem 1.15rem; color: var(--a-ink);
  display: flex; flex-direction: column; gap: .2rem;
  transition: all .15s ease;
}
.a-quick-card:hover { border-color: #C4CEDC; transform: translateY(-2px); }
.a-quick-card strong { font: 600 .92rem "Sora", sans-serif; color: var(--a-accent); }
.a-quick-card span { color: var(--a-muted); font-size: .8rem; }

/* ---------- Enquiry detail ---------- */
.a-lead-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1.2rem; align-items: center; }
.a-detail-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem;
  margin-bottom: 1.2rem;
}
.a-detail {
  background: #F8FAFD; border: 1px solid var(--a-line); border-radius: 10px;
  padding: .75rem .9rem;
}
.a-detail span { display: block; color: var(--a-muted); font-size: .74rem; letter-spacing: .05em; text-transform: uppercase; margin-bottom: .15rem; }
.a-detail strong { font-weight: 600; }
.a-note-box { background: #FFFBEB; border: 1px solid #FDE27A; border-radius: 10px; padding: .8rem 1rem; margin-bottom: 1.2rem; font-size: .88rem; }
.a-form-grid.a-cols-2 { margin-bottom: 1.2rem; }
.a-meta { color: var(--a-muted); font-size: .8rem; display: grid; gap: .2rem; margin-top: 1.2rem; border-top: 1px dashed var(--a-line); padding-top: 1rem; }
.a-meta-ua { word-break: break-all; }

/* ---------- Admin gallery grid ---------- */
.a-gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.a-gallery-item {
  background: #F8FAFD; border: 1px solid var(--a-line); border-radius: 10px;
  overflow: hidden; display: flex; flex-direction: column;
}
.a-gallery-media { position: relative; aspect-ratio: 4 / 3; background: #EEF2F8; }
.a-gallery-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.a-gallery-order {
  position: absolute; top: .5rem; left: .5rem;
  background: rgba(12, 24, 48, .82); color: #fff;
  font: 600 .7rem "Inter", sans-serif;
  padding: .18rem .5rem; border-radius: 6px;
}
.a-gallery-hidden {
  position: absolute; top: .5rem; right: .5rem;
  background: rgba(220, 38, 38, .92); color: #fff;
  font: 600 .68rem "Inter", sans-serif;
  padding: .18rem .5rem; border-radius: 6px;
}
.a-gallery-info { padding: .7rem .85rem .2rem; }
.a-gallery-info strong { display: block; font-size: .9rem; }
.a-gallery-actions {
  display: flex; align-items: center; gap: .45rem; flex-wrap: wrap;
  padding: .6rem .85rem .85rem;
}
.a-move-group { display: inline-flex; gap: .3rem; }
.a-actions { display: flex; gap: .45rem; margin-left: auto; }

/* ---------- Login ---------- */
.a-login-body {
  background:
    radial-gradient(ellipse 60% 60% at 80% 10%, rgba(37, 99, 235, .16), transparent 60%),
    linear-gradient(160deg, #0A1122, #05080F);
  min-height: 100vh; display: grid; place-items: center; padding: 1.5rem;
}
.a-login-wrap { width: min(420px, 100%); }
.a-login-card {
  background: #fff; border-radius: 16px; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .8);
  padding: 2.2rem 2rem;
}
.a-login-brand { text-align: center; margin-bottom: 1.6rem; display: grid; justify-items: center; gap: .3rem; }
.a-login-brand strong { font: 700 1.1rem "Sora", sans-serif; color: var(--a-ink); }
.a-login-brand span { color: var(--a-muted); font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; }
.a-login-card .a-field { margin-bottom: 1rem; }
.a-login-card .a-btn { margin-top: .4rem; }
.a-login-back { display: block; text-align: center; margin-top: 1.3rem; color: var(--a-muted); font-size: .88rem; }
.a-login-back:hover { color: var(--a-accent); }

/* ---------- Settings page ---------- */
.a-settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; align-items: start; }
.a-settings-grid .a-card { margin-bottom: 0; }
.a-logo-row { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.a-logo-row img { width: 64px; height: 64px; object-fit: contain; border: 1px solid var(--a-line); border-radius: 12px; background: #fff; padding: .3rem; }
.a-settings-actions { display: flex; gap: .7rem; align-items: center; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .a-stats { grid-template-columns: repeat(2, 1fr); }
  .a-quick { grid-template-columns: repeat(2, 1fr); }
  .a-gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .a-settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .a-sidebar {
    position: fixed; z-index: 60; left: 0; top: 0; bottom: 0;
    transform: translateX(-100%); transition: transform .25s ease;
    box-shadow: 20px 0 60px -30px rgba(0, 0, 0, .5);
  }
  .a-sidebar.open { transform: none; }
  .a-burger { display: inline-flex; }
  .a-username { display: none; }
  .a-detail-grid { grid-template-columns: 1fr 1fr; }
  .a-form-grid, .a-cols-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .a-content { padding: 1.1rem; }
  .a-stats, .a-quick, .a-gallery-grid, .a-detail-grid, .a-form-grid, .a-cols-3 { grid-template-columns: 1fr; }
  .a-topbar { padding: .8rem 1rem; }
  .a-search-form .a-input { width: 100%; }
  .a-card { padding: 1.05rem 1rem; }
  .a-lead-actions .a-btn { flex: 1 1 auto; }
}
