@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Playfair+Display:wght@400;600;700&display=swap');

/* ============================================
   THE PRESTIGE THEME - VARIABLES
   ============================================ */
:root {
  /* Palette - Executive Slate & Gold */
  --bg-app: #FAFAF9;        /* Soft Cream/Off-White Background */
  --bg-surface: #FFFFFF;    /* Pure White Surface */
  --bg-sidebar: #1E293B;    /* Deep Slate/Charcoal */
  --bg-topbar: #FFFFFF;
  
  --text-main: #334155;     /* Dark Slate Gray */
  --text-muted: #64748B;    /* Muted Slate */
  --text-light: #F8FAFC;    /* Off-white text for dark backgrounds */
  
  --primary: #1E293B;       /* Deep Slate */
  --accent: #D4AF37;        /* Muted Gold */
  --accent-hover: #B59326;
  
  --border-subtle: #E2E8F0;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  
  /* Dimensions */
  --sidebar-width: 260px;
  --topbar-height: 70px;
}

/* ============================================
   RESET & TYPOGRAPHY
   ============================================ */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  background-color: var(--bg-app);
  font-family: 'Inter', sans-serif;
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', serif;
  color: var(--primary);
  font-weight: 700;
  letter-spacing: -0.02em;
}

a {
  text-decoration: none;
  color: var(--primary);
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent);
}

/* ============================================
   LAYOUT STRUCTURE
   ============================================ */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR */
.app-sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  color: var(--text-light);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-icon {
  font-size: 1.5rem;
  color: var(--accent);
  margin-right: 0.75rem;
}

.brand-text {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: #FFF;
  letter-spacing: 0.5px;
}

.sidebar-nav {
  flex: 1;
  padding: 1.5rem 1rem;
  overflow-y: auto;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 0.875rem 1rem;
  border-radius: 8px;
  color: #94A3B8;
  font-weight: 500;
  margin-bottom: 0.5rem;
  transition: all 0.2s ease;
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: #FFF;
  transform: translateX(4px);
}

.nav-link.active {
  background-color: rgba(212, 175, 55, 0.15); /* Gold tint */
  color: var(--accent);
  border-left: 3px solid var(--accent);
}

.nav-icon {
  margin-right: 1rem;
  width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* MAIN CONTENT AREA */
.app-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
}

/* TOPBAR */
.app-topbar {
  height: var(--topbar-height);
  background-color: var(--bg-topbar);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 90;
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--primary);
    cursor: pointer;
    padding: 0.5rem;
    margin-right: 1rem;
}

/* RESPONSIVE LAYOUT */
@media (max-width: 991.98px) {
  .app-sidebar {
    transform: translateX(-100%);
    width: 280px; /* Slightly wider on mobile for better touch */
  }

  .app-sidebar.show {
    transform: translateX(0);
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
  }

  .app-main {
    margin-left: 0;
    width: 100%;
  }

  .mobile-toggle {
    display: block;
  }
  
  .app-topbar {
    padding: 0 1rem;
    justify-content: flex-start;
  }
  
  .topbar-title {
    display: none; /* Hide title on mobile to save space, or keep if short */
  }

  .user-menu {
    margin-left: auto; /* Push user menu to right */
  }

  /* Overlay for mobile sidebar */
  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
  }

  .sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
  }
}

.topbar-title {
  font-size: 1.1rem;
  color: var(--text-muted);
  font-weight: 500;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-login {
    background-color: var(--primary);
    color: white !important;
    padding: 0.5rem 1.5rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    transition: all 0.2s;
}

.btn-login:hover {
    background-color: #0f172a;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* CONTENT */
.main-content {
  padding: 2rem;
  width: 100%;
}

/* ============================================
   COMPONENTS
   ============================================ */

/* Buttons */
/* Buttons */
.btn {
  border-radius: 4px; /* Sharper corners */
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.75rem 1.5rem;
  transition: all 0.3s ease;
}

.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #FFFFFF;
}

.btn-primary:hover, .btn-primary:focus {
  background-color: var(--accent); /* Turn Gold on hover */
  border-color: var(--accent);
  color: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-accent {
  background-color: var(--accent);
  color: #FFF;
  border: none;
}

.btn-accent:hover {
  background-color: #B59326;
  color: #FFF;
}

.btn-outline-primary {
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline-primary:hover {
  background-color: var(--primary);
  color: #FFF;
}

/* Cards */
.card {
  background: var(--bg-surface);
  border: 1px solid rgba(0,0,0,0.05); /* Very subtle border */
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  overflow: hidden;
}

.card:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  transform: translateY(-2px);
}

.card-header {
  background-color: #FFF;
  border-bottom: 2px solid var(--border-subtle);
  padding: 1.25rem 1.5rem;
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--primary);
}

/* Forms */
/* Forms */
.form-control {
  border: 1px solid var(--border-subtle);
  padding: 0.75rem 1rem;
  border-radius: 4px;
  background-color: #FFF;
  transition: all 0.2s;
  font-size: 0.95rem;
}

.form-control:focus {
  background-color: #FFF;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

/* Fix for Chrome Autofill background color */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active{
    -webkit-box-shadow: 0 0 0 30px white inset !important;
    -webkit-text-fill-color: var(--primary) !important;
}

/* Tables */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table thead th {
  background-color: #F1F5F9;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  padding: 1rem;
  border-bottom: 2px solid var(--border-subtle);
}

.table tbody td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

/* ============================================
   IDENTITY / MANAGE PROFILE NAV
   ============================================ */
.nav-pills .nav-link {
    color: var(--text-muted);
    font-weight: 500;
    border-radius: 6px;
    padding: 1rem 1.5rem;
    transition: all 0.2s;
}

.nav-pills .nav-link:hover {
    background-color: rgba(30, 41, 59, 0.03);
    color: var(--primary);
    transform: translateX(4px);
}

.nav-pills .nav-link.active {
    background-color: var(--primary) !important;
    color: var(--accent) !important;
    border-left: 4px solid var(--accent);
    box-shadow: var(--shadow-md);
    border-radius: 4px; /* Slight rounding but distinct */
}

.nav-pills .nav-link i {
    color: var(--accent); /* Icons always gold-ish */
    opacity: 0.8;
}

.nav-pills .nav-link.active i {
    color: var(--accent);
    opacity: 1;
}