/* ==========================================================================
   MahalluConnect Luxury SaaS Design System
   Emerald & Arabian Gold Aesthetic (Bilingual Malayalam + English)
   ========================================================================== */

:root {
  --primary: #061e18;
  --primary-light: #0d382e;
  --primary-dark: #030f0c;
  --accent-gold: #c59b27;
  --accent-gold-light: #f7e7b4;
  --accent-gold-dark: #8e6c13;
  --gold-gradient: linear-gradient(135deg, #d4af37 0%, #f6d87d 50%, #c59b27 100%);
  --gold-glow: 0 4px 20px rgba(212, 175, 55, 0.28);
  
  --bg-page: #f5f6f8;
  --bg-surface: #ffffff;
  --bg-subtle: #f8fafc;
  
  --text-main: #0f1c24;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --text-on-dark: #ffffff;
  
  --border-light: #e2e8f0;
  --border-gold: rgba(197, 155, 39, 0.35);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  
  --shadow-sm: 0 2px 6px rgba(15, 28, 36, 0.04);
  --shadow-md: 0 8px 24px rgba(15, 28, 36, 0.06);
  --shadow-lg: 0 16px 40px rgba(15, 28, 36, 0.08);
  --shadow-card: 0 4px 20px rgba(6, 30, 24, 0.05);

  --font-sans: 'Manrope', 'Noto Sans Malayalam', system-ui, -apple-system, sans-serif;
  --font-display: 'Manrope', 'Gayathri', 'Noto Sans Malayalam', sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
}

/* ================= TOPBAR & NAVIGATION ================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(6, 30, 24, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 2px solid var(--accent-gold);
  padding: 12px max(20px, calc((100% - 1160px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 21px;
  letter-spacing: -0.02em;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.topbar nav a {
  color: #e2e8f0;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: all 0.18s ease;
}

.topbar nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.nav-user {
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid var(--border-gold);
  color: var(--accent-gold-light);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 30px;
}

.inline-form {
  display: inline;
}

.link-button {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: color 0.15s;
}

.link-button:hover {
  color: #f87171;
}

/* ================= LAYOUT CONTAINER ================= */
.container {
  max-width: 1160px;
  margin: 32px auto;
  padding: 0 20px;
  min-height: 75vh;
}

/* ================= BUTTONS ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 700;
  padding: 12px 22px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.18s ease;
  background: var(--gold-gradient);
  color: var(--primary-dark);
  box-shadow: 0 3px 12px rgba(197, 155, 39, 0.25);
}

.btn:hover {
  transform: translateY(-1.5px);
  box-shadow: var(--gold-glow);
  opacity: 0.96;
}

.btn:active {
  transform: translateY(0);
}

.btn.secondary {
  background: var(--bg-surface);
  color: var(--primary);
  border: 1.5px solid #d0d7e2;
  box-shadow: var(--shadow-sm);
}

.btn.secondary:hover {
  border-color: var(--primary);
  background: #f1f5f9;
  box-shadow: var(--shadow-md);
}

.btn.danger {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
  box-shadow: none;
}

.btn.danger:hover {
  background: #dc2626;
  color: #fff;
}

.btn.full {
  width: 100%;
}

/* ================= PANELS & CARDS ================= */
.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 26px;
  margin: 20px 0;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.2s;
}

.panel:hover {
  box-shadow: var(--shadow-md);
}

.panel.narrow {
  max-width: 580px;
  margin: 32px auto;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.page-head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.025em;
}

.eyebrow {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 1.5px;
  font-weight: 800;
  color: var(--accent-gold);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.muted {
  color: var(--text-muted);
}

/* ================= HERO SECTION ================= */
.hero {
  background: linear-gradient(145deg, #061c16 0%, #0d352b 50%, #154c3e 100%);
  color: #fff;
  border-radius: var(--radius-xl);
  padding: clamp(36px, 6vw, 76px);
  margin-top: 10px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(6, 28, 22, 0.25);
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.hero::after {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.18) 0%, transparent 70%);
  pointer-events: none;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(32px, 5.5vw, 56px);
  line-height: 1.15;
  margin: 12px 0 20px;
  max-width: 720px;
  font-weight: 800;
}

.hero p {
  font-size: 17px;
  max-width: 620px;
  color: #d1fae5;
  margin: 0 0 28px;
}

/* ================= METRIC STATS ================= */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.stat {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.stat::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent-gold);
}

.stat span {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat strong {
  display: block;
  font-size: 32px;
  font-weight: 800;
  color: var(--primary);
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

.stat .small-value {
  font-size: 18px;
  overflow-wrap: anywhere;
}

/* ================= TABLES ================= */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: #fff;
  margin-top: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}

th {
  background: #f8fafc;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 14px 18px;
  border-bottom: 1.5px solid var(--border-light);
  text-align: left;
}

td {
  padding: 15px 18px;
  border-bottom: 1px solid #edf2f7;
  color: #1e293b;
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: #fbfcfe;
}

/* ================= PILLS & BADGES ================= */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 750;
  background: #f1f5f9;
  color: #334155;
}

/* ================= FORMS & INPUTS ================= */
label {
  display: block;
  font-weight: 650;
  font-size: 14px;
  color: #1e293b;
  margin: 16px 0 6px;
}

input, textarea, select {
  display: block;
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 15px;
  color: #0f172a;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(6, 30, 24, 0.1);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.search-form {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.search-form input {
  flex: 1;
}

/* ================= ALERTS ================= */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  margin: 16px 0;
  font-weight: 600;
  font-size: 14.5px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert.success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert.error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* ================= FOOTER ================= */
.footer {
  text-align: center;
  color: var(--text-muted);
  padding: 36px 20px;
  font-size: 13px;
  border-top: 1px solid var(--border-light);
  margin-top: 60px;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 768px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 14px 18px;
  }
  .topbar nav {
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
  }
  .page-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .two-col {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .panel {
    padding: 20px 16px;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
  }
}
