/* File: frontend/public/css/main.css */
:root {
  --color-primary:   #e63946;
  --color-primary-d: #c1121f;
  --color-dark:      #1a1a2e;
  --color-mid:       #16213e;
  --color-accent:    #0f3460;
  --color-bg:        #f4f6f9;
  --color-white:     #ffffff;
  --color-text:      #2d2d2d;
  --color-muted:     #6c757d;
  --color-border:    #dee2e6;
  --color-success:   #2a9d8f;
  --color-warning:   #e9c46a;
  --color-danger:    #e63946;
  --color-info:      #457b9d;
  --sidebar-w:       240px;
  --radius:          8px;
  --shadow:          0 2px 8px rgba(0,0,0,.1);
  --transition:      .2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { font-weight: 600; line-height: 1.3; }

/* ---- Layout principal ---- */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--color-dark);
  color: var(--color-white);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-logo {
  padding: 24px 20px 16px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-primary);
  border-bottom: 1px solid rgba(255,255,255,.1);
  letter-spacing: .5px;
}

.sidebar-logo span { color: var(--color-white); font-weight: 400; font-size: .85rem; display: block; }

.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  color: rgba(255,255,255,.75);
  font-size: .9rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
}

.nav-item:hover, .nav-item.active {
  background: rgba(255,255,255,.1);
  color: var(--color-white);
  text-decoration: none;
}
.nav-item.active { border-left: 3px solid var(--color-primary); }
.nav-item .icon { width: 20px; text-align: center; opacity: .8; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.1);
  font-size: .8rem;
  color: rgba(255,255,255,.5);
}

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: var(--color-white);
  padding: 14px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar h1 { font-size: 1.2rem; color: var(--color-dark); }

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

.user-info {
  font-size: .85rem;
  color: var(--color-muted);
}
.user-info strong { color: var(--color-text); }

.page-content { padding: 28px; flex: 1; }

/* ---- Utilidades ---- */
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8   { margin-top: 8px; }
.mt-16  { margin-top: 16px; }
.mt-24  { margin-top: 24px; }
.mb-16  { margin-bottom: 16px; }
.text-muted { color: var(--color-muted); }
.text-sm    { font-size: .85rem; }
.text-center { text-align: center; }
.w-100  { width: 100%; }

/* ---- Login ---- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-dark) 0%, var(--color-accent) 100%);
}

.login-card {
  background: var(--color-white);
  border-radius: 12px;
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}
.login-logo h1 { font-size: 1.8rem; color: var(--color-primary); }
.login-logo p  { color: var(--color-muted); font-size: .9rem; margin-top: 4px; }

/* ---- Alertas ---- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: .9rem;
}
.alert-error   { background: #fde8ea; color: #c1121f; border: 1px solid #f5c2c7; }
.alert-success { background: #d1f5ef; color: #155f54; border: 1px solid #a8e6df; }
.alert-warning { background: #fef9e7; color: #856404; border: 1px solid #ffe083; }
.alert-info    { background: #d6eaf8; color: #1a5276; border: 1px solid #a9cce3; }
