/* ==========================================================================
   EMPIREGOLD - SYSTEM DESIGN & STYLE SHEET (CSS3 VANILLA)
   Color Palette:
   - Primary Gold: #D4AF37
   - Light Gold: #F1D675
   - Deep Black: #111111
   - Dark Gray: #1E1E1E
   - Card Background: #181818
   - Pure White: #FFFFFF
   - Light Gray: #F5F5F5
   - Muted Gray: #9E9E9E
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --primary-gold: #D4AF37;
  --light-gold: #F1D675;
  --dark-gold: #AA820A;
  --gold-gradient: linear-gradient(135deg, #D4AF37 0%, #F1D675 100%);
  --gold-glow: 0 4px 20px rgba(212, 175, 55, 0.25);
  
  --bg-black: #111111;
  --bg-dark: #1E1E1E;
  --bg-card: #181818;
  --bg-input: #262626;
  --border-color: rgba(212, 175, 55, 0.2);
  --border-light: #2A2A2A;
  
  --text-white: #FFFFFF;
  --text-light: #F5F5F5;
  --text-muted: #9E9E9E;
  --text-dark: #111111;

  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --info: #3B82F6;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg-black);
  color: var(--text-light);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, .brand-logo {
  font-family: 'Outfit', sans-serif;
  color: var(--text-white);
  font-weight: 700;
}

a {
  color: var(--primary-gold);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--light-gold);
}

/* Typography Utilities */
.text-gold { color: var(--primary-gold) !important; }
.text-gradient-gold {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.bg-gold { background: var(--gold-gradient) !important; color: var(--bg-black) !important; }
.bg-card { background-color: var(--bg-card) !important; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-gold {
  background: var(--gold-gradient);
  color: var(--bg-black);
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(212, 175, 55, 0.45);
  color: var(--bg-black);
}

.btn-outline-gold {
  background: transparent;
  border-color: var(--primary-gold);
  color: var(--primary-gold);
}

.btn-outline-gold:hover {
  background: rgba(212, 175, 55, 0.1);
  color: var(--light-gold);
  border-color: var(--light-gold);
}

.btn-dark {
  background: var(--bg-dark);
  color: var(--text-white);
  border: 1px solid var(--border-light);
}

.btn-dark:hover {
  background: var(--bg-card);
  border-color: var(--primary-gold);
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

/* Layout App Structure */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 270px;
  background-color: var(--bg-dark);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: var(--transition);
}

.sidebar-header {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.4rem;
  letter-spacing: 1px;
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: var(--gold-gradient);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bg-black);
  font-size: 1.2rem;
  box-shadow: var(--gold-glow);
}

.brand-logo-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 6px;
  display: block;
  background: #000;
}

.auth-logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  margin-bottom: 0.5rem;
}

.auth-logo-wrap .auth-logo {
  width: 88px;
  height: 88px;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}

.auth-logo-wrap .brand-name {
  font-size: 1.35rem;
  letter-spacing: 1px;
  font-weight: 700;
  color: var(--text-white);
}

.sidebar-menu {
  padding: 1.25rem 0.75rem;
  list-style: none;
  flex-grow: 1;
  overflow-y: auto;
}

.sidebar-item {
  margin-bottom: 0.35rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem 1rem;
  color: var(--text-muted);
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition);
}

.sidebar-link i {
  font-size: 1.15rem;
  width: 24px;
  text-align: center;
}

.sidebar-link:hover, .sidebar-link.active {
  color: var(--text-white);
  background: rgba(212, 175, 55, 0.12);
  border-left: 3px solid var(--primary-gold);
}

.sidebar-link.active i {
  color: var(--primary-gold);
}

.sidebar-footer {
  padding: 1.25rem;
  border-top: 1px solid var(--border-light);
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gold-gradient);
  color: var(--bg-black);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.user-info {
  line-height: 1.2;
}

.user-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-white);
}

.user-role {
  font-size: 0.75rem;
  color: var(--primary-gold);
  text-transform: uppercase;
}

/* Main Content */
.main-content {
  margin-left: 0;
  width: 100%;
  flex-grow: 1;
  padding: 2rem 5%;
  min-height: 90vh;
  transition: var(--transition);
}

/* Top App Header */
.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
}

.header-title h1 {
  font-size: 1.75rem;
}

.header-title p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Cards & Widgets */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  transition: var(--transition);
}

.card:hover {
  border-color: rgba(212, 175, 55, 0.4);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.card-title {
  font-size: 1.15rem;
  color: var(--text-white);
}

/* Dashboard KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--gold-gradient);
}

.kpi-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: rgba(212, 175, 55, 0.15);
  color: var(--primary-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.kpi-data h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}

.kpi-data .kpi-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-white);
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--text-light);
}

.table th {
  background-color: var(--bg-dark);
  color: var(--primary-gold);
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 1px;
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.table th:first-child { border-top-left-radius: var(--radius-sm); }
.table th:last-child { border-top-right-radius: var(--radius-sm); }

.table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.95rem;
  vertical-align: middle;
}

.table tbody tr:hover {
  background-color: rgba(212, 175, 55, 0.04);
}

/* Status Badges */
.badge {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-success { background: rgba(16, 185, 129, 0.2); color: #10B981; border: 1px solid rgba(16, 185, 129, 0.4); }
.badge-warning { background: rgba(245, 158, 11, 0.2); color: #F59E0B; border: 1px solid rgba(245, 158, 11, 0.4); }
.badge-danger { background: rgba(239, 68, 68, 0.2); color: #EF4444; border: 1px solid rgba(239, 68, 68, 0.4); }
.badge-info { background: rgba(59, 130, 246, 0.2); color: #3B82F6; border: 1px solid rgba(59, 130, 246, 0.4); }
.badge-gold { background: rgba(212, 175, 55, 0.2); color: var(--primary-gold); border: 1px solid var(--primary-gold); }

/* Forms & Inputs */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.form-control, .form-select {
  width: 100%;
  padding: 0.8rem 1rem;
  background-color: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-white);
  font-size: 0.95rem;
  font-family: inherit;
  transition: var(--transition);
}

.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary-gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

/* Public Website Navigation */
.public-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 5%;
  background: rgba(17, 17, 17, 0.9);
  backdrop-filter: blur(15px);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--border-color);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-link {
  color: var(--text-light);
  font-weight: 500;
  font-size: 0.95rem;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary-gold);
}

/* Public Hero Section */
.hero-section {
  padding: 10rem 5% 5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  min-height: 90vh;
}

.hero-content h1 {
  font-size: 3.5rem;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--primary-gold);
  font-weight: 600;
  margin-bottom: 1rem;
}

.hero-text {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 540px;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
}

.hero-preview-img {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 40px rgba(212, 175, 55, 0.2);
}

/* Calculator Card */
.calculator-box {
  background: linear-gradient(145deg, #1C1C1C 0%, #141414 100%);
  border: 1px solid var(--primary-gold);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--gold-glow);
}

.calc-result-box {
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid var(--primary-gold);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  margin-top: 1.5rem;
}

.calc-result-val {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--primary-gold);
}

/* Toasts & Alerts */
.flash-alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
}

.flash-alert.success { background: rgba(16, 185, 129, 0.15); border: 1px solid #10B981; color: #10B981; }
.flash-alert.warning { background: rgba(245, 158, 11, 0.15); border: 1px solid #F59E0B; color: #F59E0B; }
.flash-alert.danger { background: rgba(239, 68, 68, 0.15); border: 1px solid #EF4444; color: #EF4444; }
.flash-alert.info { background: rgba(59, 130, 246, 0.15); border: 1px solid #3B82F6; color: #3B82F6; }

/* Responsive Mobile Navigation */
.mobile-toggle {
  display: none;
  font-size: 1.5rem;
  color: var(--primary-gold);
  cursor: pointer;
}

@media (max-width: 992px) {
  .hero-section {
    grid-template-columns: 1fr;
    padding-top: 7rem;
    text-align: center;
  }

  .hero-buttons {
    justify-content: center;
  }

  .sidebar {
    transform: translateX(-100%);
  }

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

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

  .mobile-toggle {
    display: block;
  }
}

/* Admin Top Navbar */
.admin-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 2rem;
  background-color: var(--bg-dark);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 999;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.admin-nav-menu {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  overflow-x: auto;
}

.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  white-space: nowrap;
}

.admin-nav-link:hover, .admin-nav-link.active {
  color: var(--text-white);
  background: rgba(212, 175, 55, 0.15);
}

.admin-nav-link.active i {
  color: var(--primary-gold);
}

.site-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1.5rem;
  padding: 0.6rem;
  background: var(--bg-card, var(--bg-dark));
  border: 1px solid var(--border-color, rgba(212,175,55,0.14));
  border-radius: 10px;
}

.site-subnav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.8rem;
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 600;
  border-radius: 8px;
}

.site-subnav-link:hover,
.site-subnav-link.active {
  color: var(--text-white);
  background: rgba(212, 175, 55, 0.15);
}

.site-subnav-preview {
  margin-left: auto;
}

.site-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.site-hub-card {
  display: block;
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: transform .15s ease, border-color .15s ease;
}

.site-hub-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary-gold, #D4AF37);
}

.site-hub-card p {
  color: var(--text-muted);
  margin: 0.6rem 0 0.8rem;
  font-size: 0.92rem;
}

.site-hub-meta {
  color: var(--primary-gold, #D4AF37);
  font-size: 0.82rem;
  font-weight: 600;
}

