/* ============================================================
   TAJ AL MADA COMPANY — ADMIN PANEL CMS STYLESHEET
   Executive SaaS CMS Design (Deep Navy #061D2E | Royal Gold #F5B41A)
   ============================================================ */

:root {
  --navy-deep: #061D2E;
  --navy: #0A324B;
  --navy-light: #124363;
  --gold: #F5B41A;
  --gold-rich: #C98A06;
  --gold-soft: #FEF8E8;
  --bg: #F2F5F9;
  --white: #FFFFFF;
  --ink: #142636;
  --body: #3D5063;
  --muted: #6A7D91;
  --border: #DCE4EE;
  --danger: #C92A3E;
  --success: #107C41;
  --radius: 10px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}

button, input, textarea, select { font-family: inherit; font-size: inherit; }

.hidden { display: none !important; }

/* ==================== LOGIN VIEW ==================== */
.login-shell {
  min-height: 100vh;
  background: linear-gradient(145deg, #041421 0%, var(--navy-deep) 45%, var(--navy) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 430px;
  background: var(--white);
  border-radius: 16px;
  padding: 36px 34px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  border-top: 5px solid var(--gold);
}

.login-brand {
  text-align: center;
  margin-bottom: 24px;
}

.login-brand img {
  width: 96px;
  margin: 0 auto 10px auto;
}

.login-brand h1 {
  font-size: 1.35rem;
  color: var(--navy-deep);
  font-weight: 800;
}

.login-brand p {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ==================== ADMIN SHELL LAYOUT ==================== */
.admin-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 266px;
  background: var(--navy-deep);
  color: var(--white);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-brand img {
  height: 40px;
  width: auto;
}

.sidebar-brand-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1.2;
}

.sidebar-brand-sub {
  font-size: 0.7rem;
  color: var(--gold);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-group-label {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: rgba(255, 255, 255, 0.44);
  padding: 12px 12px 4px 12px;
}

.nav-item {
  width: 100%;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.82);
  padding: 10px 12px;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.18s ease;
}

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

.nav-item.active {
  background: linear-gradient(90deg, rgba(245, 180, 26, 0.22), rgba(245, 180, 26, 0.08));
  color: var(--gold);
  border-left: 3px solid var(--gold);
}

.badge-count {
  background: var(--gold);
  color: var(--navy-deep);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 999px;
}

.sidebar-footer {
  padding: 14px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ==================== MAIN WORKSPACE ==================== */
.main-area {
  flex: 1;
  margin-left: 266px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.topbar-title h2 {
  font-size: 1.22rem;
  font-weight: 800;
  color: var(--navy-deep);
}

.topbar-title p {
  font-size: 0.82rem;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.dirty-pill {
  background: #FFF3CD;
  color: #856404;
  border: 1px solid #FFE082;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
}

.workspace {
  padding: 24px 28px 60px 28px;
  max-width: 1120px;
  width: 100%;
}

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.86rem;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
  text-decoration: none;
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold), #FFD15C);
  color: var(--navy-deep);
}

.btn-gold:hover { filter: brightness(1.03); transform: translateY(-1px); }

.btn-navy {
  background: var(--navy);
  color: var(--white);
}

.btn-navy:hover { background: var(--navy-deep); }

.btn-outline {
  background: var(--white);
  border-color: var(--border);
  color: var(--navy);
}

.btn-outline:hover { border-color: var(--navy); background: var(--bg); }

.btn-danger {
  background: #FDECEC;
  color: var(--danger);
  border-color: #F5B8BF;
}

.btn-danger:hover { background: var(--danger); color: var(--white); }

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

/* ==================== CARDS & FORMS ==================== */
.panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(6, 29, 46, 0.04);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.panel-header h3 {
  font-size: 1.04rem;
  font-weight: 800;
  color: var(--navy-deep);
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}

.field label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--navy);
}

.field input[type="text"],
.field input[type="password"],
.field input[type="email"],
.field input[type="url"],
.field select,
.field textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  background: #FAFBFD;
  color: var(--ink);
  transition: border-color 0.16s ease, background 0.16s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--navy);
  background: var(--white);
}

.field small { font-size: 0.74rem; color: var(--muted); }

/* Image Uploader Field */
.img-field-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}

.img-preview {
  width: 96px;
  height: 62px;
  border-radius: 6px;
  object-fit: cover;
  background: #0A324B;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.img-preview.logo-contain {
  object-fit: contain;
  padding: 6px;
}

.img-field-controls {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Repeatable Item Cards */
.repeat-item {
  background: #F8FAFC;
  border: 1px solid var(--border);
  border-left: 4px solid var(--navy);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.repeat-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.repeat-item-head strong {
  color: var(--navy);
  font-size: 0.88rem;
}

/* Dashboard KPI Cards */
.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-top: 4px solid var(--gold);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.stat-card-val {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--navy-deep);
  line-height: 1.1;
}

.stat-card-lbl {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
  margin-top: 4px;
}

/* Toggle Switch */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  background: #F8FAFC;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #CBD5E1;
  transition: 0.2s;
  border-radius: 24px;
}

.slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
}

.switch input:checked + .slider { background-color: var(--navy); }
.switch input:checked + .slider::before { transform: translateX(20px); background-color: var(--gold); }

/* Sector Sub-Tabs */
.sector-pills-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.sector-pill-btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--navy);
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
}

.sector-pill-btn.active {
  background: var(--navy);
  border-color: var(--gold);
  color: var(--gold);
}

/* Inquiries Table */
.inq-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 4px solid var(--navy);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 12px;
}

.inq-card.status-new { border-left-color: var(--gold); background: #FFFCF3; }
.inq-card.status-contacted { border-left-color: var(--success); }
.inq-card.status-archived { opacity: 0.72; }

.status-pill {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
}

.status-pill.new { background: #FFF0C2; color: #8A5D00; }
.status-pill.contacted { background: #DFF6EA; color: #0E6B3D; }
.status-pill.archived { background: #E7EDF4; color: #52657A; }

/* Toast Notification */
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 999;
  background: var(--navy-deep);
  color: var(--white);
  border-left: 4px solid var(--gold);
  padding: 13px 20px;
  border-radius: 8px;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: all 0.25s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error { border-left-color: #FF5A6E; }

@media (max-width: 960px) {
  .sidebar { width: 220px; }
  .main-area { margin-left: 220px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .admin-shell { flex-direction: column; }
  .sidebar { position: static; width: 100%; height: auto; }
  .main-area { margin-left: 0; }
}
