/* ==========================================================================
   EDICA GLOBAL STYLESHEET
   Architecture: B2B/B2C Institutional Portal
   ========================================================================== */

/* --- 1. GOOGLE FONTS IMPORT --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Playfair+Display:ital,wght@0,400;0,500;0,600;1,400&family=IBM+Plex+Mono:wght@400;500&display=swap');

/* --- 2. CSS VARIABLES (THEME & DESIGN TOKENS) --- */
:root {
  /* Core Colors */
  --black: #050505;
  --ink: #0B0B0C;
  --ink-2: #111113;
  --white: #F7F7F4;
  
  /* Grays / Steels */
  --steel-100: #D4D4D8;
  --steel-300: #A8A8AE;
  --steel-400: #8A8A93;
  --steel-700: #3F3F46;
  
  /* Borders & Lines */
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  
  /* Brand Accents */
  --brass: #B9A47F;
  --brass-dim: #8C7C60;
  
  /* Status Colors */
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #ef4444;

  /* Typography */
  --font-display: 'Playfair Display', serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  /* Layout Measurements */
  --sidebar-w: 260px;
  --nav-h: 76px; /* For the public index page */
}

/* --- 3. RESET & BASE --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--ink);
  color: var(--white);
  font-family: var(--font-body);
  font-weight: 300;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  display: flex;
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.25s ease;
}

::selection {
  background: var(--brass-dim);
  color: var(--white);
}

/* --- 4. TYPOGRAPHY --- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--steel-400);
}

.text-muted {
  color: var(--steel-300);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* --- 5. UI COMPONENTS --- */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.75rem 1.2rem;
  border: 1px solid var(--line-strong);
  cursor: pointer;
  font-family: var(--font-mono);
  background: transparent;
  color: var(--white);
  transition: all 0.25s ease;
  font-weight: 500;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

.btn-primary {
  background: var(--white);
  color: var(--black);
  border-color: var(--white);
}

.btn-primary:hover {
  background: var(--brass);
  border-color: var(--brass);
  color: var(--black);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  text-transform: uppercase;
}

.status-badge.neutral {
  color: var(--brass);
  border-color: rgba(185, 164, 127, 0.3);
  background: rgba(185, 164, 127, 0.05);
}

.status-badge.success {
  color: var(--success);
  border-color: rgba(52, 211, 153, 0.3);
  background: rgba(52, 211, 153, 0.05);
}

.status-badge.warning {
  color: var(--warning);
  border-color: rgba(251, 191, 36, 0.3);
  background: rgba(251, 191, 36, 0.05);
}

.status-badge.danger {
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.05);
}

/* Panels / Cards */
.panel {
  background: var(--black);
  border: 1px solid var(--line);
  margin-bottom: 2.5rem;
  display: flex;
  flex-direction: column;
}

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

.panel-header h3 {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th {
  padding: 1rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--steel-400);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

td {
  padding: 1.2rem 1.5rem;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--line);
  color: var(--steel-100);
}

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

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Form Controls */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--steel-300);
  margin-bottom: 0.6rem;
}

.form-control {
  width: 100%;
  background: var(--ink-2);
  border: 1px solid var(--line-strong);
  color: var(--white);
  padding: 0.9rem 1rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
  border-color: var(--brass);
  box-shadow: 0 0 0 1px rgba(185, 164, 127, 0.2);
}

.form-control::placeholder {
  color: var(--steel-700);
}

/* --- 6. DASHBOARD LAYOUT (B2B & B2C) --- */

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  background: var(--black);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.sidebar-header {
  padding: 2rem 1.5rem;
  border-bottom: 1px solid var(--line);
}

.logo {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

.logo b {
  font-weight: 400;
  background: linear-gradient(180deg, #FFFFFF 0%, #E4E4E7 35%, #A8A8AE 65%, #DADADD 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-menu {
  flex: 1;
  padding: 1.5rem 0;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  color: var(--steel-300);
  font-size: 0.85rem;
  border-left: 2px solid transparent;
  transition: all 0.2s ease;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  opacity: 0.7;
}

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

.nav-item.active {
  border-left-color: var(--brass);
}

.nav-item.active svg {
  opacity: 1;
  color: var(--brass);
}

/* User Profile Widget in Sidebar */
.user-profile {
  padding: 1.5rem;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ink-2);
  border: 1px solid var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--brass);
}

.user-info p {
  font-size: 0.85rem;
  font-weight: 500;
}

.user-info span {
  font-size: 0.7rem;
  color: var(--steel-400);
  font-family: var(--font-mono);
}

/* Main Content Area */
.main-content {
  margin-left: var(--sidebar-w);
  width: calc(100% - var(--sidebar-w));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2.5rem;
  border-bottom: 1px solid var(--line);
  background: var(--ink);
  position: sticky;
  top: 0;
  z-index: 50;
}

.search-bar {
  display: flex;
  align-items: center;
  background: var(--black);
  border: 1px solid var(--line-strong);
  padding: 0.5rem 1rem;
  width: 350px;
}

.search-bar svg {
  width: 16px;
  height: 16px;
  color: var(--steel-400);
  margin-right: 0.5rem;
}

.search-bar input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.85rem;
  width: 100%;
}

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

/* Dashboard Body Wrapper */
.dashboard-body {
  padding: 2.5rem;
  flex: 1;
}

.page-header {
  margin-bottom: 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.page-header h1 {
  font-size: 2.2rem;
  margin-bottom: 0.4rem;
}

/* Grid Layouts */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-bottom: 2.5rem;
}

.stat-card {
  background: var(--black);
  padding: 1.5rem;
}

.stat-card .value {
  font-family: var(--font-mono);
  font-size: 2rem;
  color: var(--white);
  margin-top: 0.5rem;
}

.stat-card .value em {
  color: var(--brass);
  font-style: normal;
}

.content-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2.5rem;
}

/* Lists & Items */
.list-item {
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.list-item:last-child {
  border-bottom: none;
}

.list-item-content h4 {
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
  font-weight: 400;
  color: var(--white);
  font-family: var(--font-body);
}

.list-item-content p {
  font-size: 0.75rem;
  color: var(--steel-400);
}

.list-item-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--brass);
  text-align: right;
  white-space: nowrap;
}