/* 
  APP_Leyes - Design System & Global Styles
*/

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

:root {
  /* Brand Colors */
  --primary-color: #345D9D; /* Azul SGR */
  --primary-light: #4A75B8; 
  --accent-color: #345D9D; 
  --accent-hover: #2B4E85;
  --secondary-accent: #9BA1A8; /* Plomo */
  
  /* Semantic Colors */
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --info-color: #3b82f6;
  
  /* Backgrounds & Surfaces */
  --bg-color: #f4f6f8; /* Gris súper claro */
  --surface-color: #ffffff;
  --surface-hover: #f8fafc;
  
  /* Text */
  --text-primary: #1f2937;
  --text-secondary: #4b5563;
  --text-muted: #9BA1A8; /* Plomo */
  --text-inverse: #ffffff;
  
  /* Borders */
  --border-color: #e5e7eb;
  
  /* Layout */
  --sidebar-width: 250px;
  --header-height: 70px;
  --border-radius-sm: 4px;
  --border-radius-md: 8px;
  --border-radius-lg: 12px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.05), 0 4px 6px -4px rgb(0 0 0 / 0.05);
  
  /* Transitions */
  --transition-fast: 0.15s ease-in-out;
  --transition-normal: 0.3s ease-in-out;
}

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

body {
  font-family: 'Montserrat', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

a {
  color: var(--info-color);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: #2563eb;
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger-color); }
.text-success { color: var(--success-color); }
.text-info { color: var(--info-color); }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }

.ml-2 { margin-left: 0.5rem; }
.mr-2 { margin-right: 0.5rem; }

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }

.hidden { display: none !important; }

/* Layout Structure */
.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

.sidebar {
  width: var(--sidebar-width);
  background-color: #ffffff;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-normal);
  z-index: 100;
  border-right: 1px solid var(--border-color);
  box-shadow: 2px 0 5px rgba(0,0,0,0.02);
}

.sidebar-header {
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-header h2 {
  color: var(--primary-color);
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.nav-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  margin: 0.25rem 1rem;
  border-radius: var(--border-radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-fast);
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
}

.nav-item i {
  width: 24px;
  font-size: 1rem;
  color: var(--text-muted);
}

.nav-item:hover {
  background-color: var(--surface-hover);
  color: var(--primary-color);
}

.nav-item:hover i {
  color: var(--primary-color);
}

.nav-item.active {
  background-color: var(--primary-color);
  color: var(--text-inverse);
}

.nav-item.active i {
  color: var(--text-inverse);
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--bg-color);
}

.header {
  height: var(--header-height);
  background-color: var(--primary-color);
  color: white;
  border-bottom: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  z-index: 10;
  margin: 15px 15px 0 15px;
  border-radius: var(--border-radius-md);
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-info {
  text-align: right;
}

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

.user-role {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
}

/* View Container */
.view-container {
  max-width: 1200px;
  margin: 0 auto;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
