/* JWL Auth - Global CSS */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600;700&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --beige:        #F2EDE4;
  --beige-dark:   #E8E0D4;
  --beige-mid:    #D9CFC2;
  --or:           #A8874A;
  --or-light:     #C4A35A;
  --or-dark:      #8A6B35;
  --noir:         #1A1A1A;
  --noir-soft:    #2C2C2C;
  --blanc:        #FFFFFF;
  --gris-light:   #F8F5F0;
  --gris-border:  #E0D8CE;
  --text-primary: #1A1A1A;
  --text-muted:   #7A6E62;
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg:    0 8px 32px rgba(0,0,0,0.12);
  --shadow-or:    0 4px 20px rgba(168,135,74,0.25);
  --radius-sm:    6px;
  --radius-md:    10px;
  --radius-lg:    16px;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
  --transition:   0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: var(--font-body);
  background: var(--beige);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ── LAYOUT AUTH ── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--beige);
  padding: 24px;
}
.auth-card {
  background: var(--blanc);
  border: 1px solid var(--gris-border);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}
.auth-logo img { height: 40px; }
.auth-logo h1 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--noir);
  margin-top: 12px;
}
.auth-logo p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── DASHBOARD LAYOUT ── */
.dash-wrapper { display: flex; min-height: 100vh; }
.dash-sidebar {
  width: 240px;
  background: var(--noir);
  color: var(--blanc);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}
.dash-sidebar .sidebar-logo {
  padding: 28px 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--or);
  display: flex;
  align-items: center;
  gap: 10px;
}
.dash-sidebar nav { flex: 1; padding: 16px 0; }
.dash-sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 24px;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.65);
  transition: var(--transition);
  border-left: 3px solid transparent;
}
.dash-sidebar nav a:hover,
.dash-sidebar nav a.active {
  color: var(--blanc);
  background: rgba(168,135,74,0.12);
  border-left-color: var(--or);
}
.dash-sidebar nav a svg { flex-shrink: 0; }
.sidebar-user {
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-user img {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid var(--or);
}
.sidebar-user .user-info { flex: 1; overflow: hidden; }
.sidebar-user .user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--blanc);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user .user-role {
  font-size: 0.7rem;
  color: var(--or-light);
}
.dash-main {
  margin-left: 240px;
  flex: 1;
  padding: 40px;
  min-height: 100vh;
}
.dash-header {
  margin-bottom: 32px;
}
.dash-header h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  color: var(--noir);
}
.dash-header p { color: var(--text-muted); margin-top: 4px; }

/* ── CARDS ── */
.card {
  background: var(--blanc);
  border: 1px solid var(--gris-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
.card-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--noir);
}

/* ── FORMS ── */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 11px 14px;
  background: var(--gris-light);
  border: 1.5px solid var(--gris-border);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  color: var(--text-primary);
  transition: var(--transition);
}
.form-control:focus {
  outline: none;
  border-color: var(--or);
  background: var(--blanc);
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  border: none;
}
.btn-primary {
  background: var(--noir);
  color: var(--blanc);
}
.btn-primary:hover { background: var(--noir-soft); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-or {
  background: var(--or);
  color: var(--blanc);
}
.btn-or:hover { background: var(--or-dark); transform: translateY(-1px); box-shadow: var(--shadow-or); }
.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1.5px solid var(--gris-border);
}
.btn-outline:hover { border-color: var(--or); color: var(--or); }
.btn-danger {
  background: #ef4444;
  color: var(--blanc);
}
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 7px 14px; font-size: 0.8rem; }
.btn-full { width: 100%; justify-content: center; }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
  padding: 10px 14px;
  border-bottom: 1.5px solid var(--gris-border);
}
td {
  padding: 12px 14px;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--gris-border);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--gris-light); }

/* ── BADGE ── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-or { background: rgba(168,135,74,0.15); color: var(--or-dark); }
.badge-grey { background: var(--beige-dark); color: var(--text-muted); }
.badge-green { background: rgba(34,197,94,0.12); color: #15803d; }
.badge-red { background: rgba(239,68,68,0.12); color: #dc2626; }

/* ── ALERT ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  margin-bottom: 16px;
}
.alert-error { background: rgba(239,68,68,0.1); color: #dc2626; border: 1px solid rgba(239,68,68,0.2); }
.alert-success { background: rgba(34,197,94,0.1); color: #15803d; border: 1px solid rgba(34,197,94,0.2); }

/* ── MODAL ── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--blanc);
  border-radius: var(--radius-lg);
  padding: 36px;
  width: 100%;
  max-width: 500px;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 24px;
}
.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
}
.modal-close:hover { color: var(--noir); }

/* ── MISC ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.text-muted { color: var(--text-muted); font-size: 0.875rem; }
.text-center { text-align: center; }
.divider { border: none; border-top: 1px solid var(--gris-border); margin: 24px 0; }

/* Stat cards */
.stat-card {
  background: var(--blanc);
  border: 1px solid var(--gris-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.stat-card .stat-value {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--noir);
}
.stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 4px;
}

/* Avatar */
.avatar {
  border-radius: 50%;
  border: 2px solid var(--gris-border);
  object-fit: cover;
}
.avatar-sm { width: 32px; height: 32px; }
.avatar-md { width: 48px; height: 48px; }
.avatar-lg { width: 72px; height: 72px; }

/* Site icon */
.site-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  object-fit: contain;
  background: var(--beige-dark);
  padding: 4px;
}

@media (max-width: 768px) {
  .dash-sidebar { display: none; }
  .dash-main { margin-left: 0; padding: 20px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .auth-card { padding: 32px 24px; }
}
