/* ============================================
   POLITEF ADMINISTRATIVOS - DESIGN SYSTEM
   Colors: Teal #2DAAB1 | Gold #D6B531 | Blue #1E6DB4 | White #FFF
   ============================================ */

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

:root {
  /* Brand Colors */
  --primary: #2DAAB1;
  --primary-dark: #1E8A90;
  --primary-light: #3CC4CB;
  --secondary: #D6B531;
  --secondary-dark: #B89A1F;
  --accent: #1E6DB4;
  --accent-light: #2A85D6;

  /* Neutral Palette */
  --bg-dark: #0F1923;
  --bg-card: #162231;
  --bg-card-hover: #1C2D40;
  --bg-sidebar: #0C141D;
  --border: rgba(45, 170, 177, 0.15);
  --border-strong: rgba(45, 170, 177, 0.3);

  /* Text */
  --text-primary: #FFFFFF;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.45);

  /* Status */
  --success: #2ECC71;
  --warning: #F39C12;
  --danger: #E74C3C;
  --info: #3498DB;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 20px rgba(45, 170, 177, 0.15);

  /* Spacing */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Transitions */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ============== LAYOUT ============== */

.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: var(--transition);
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
}

.sidebar-header img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: contain;
}

.sidebar-header h2 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.sidebar-header span {
  font-size: 0.72rem;
  color: var(--primary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

.nav-section-title {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 12px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
  margin-bottom: 2px;
  cursor: pointer;
}

.nav-item:hover {
  background: rgba(45, 170, 177, 0.08);
  color: var(--text-primary);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(45, 170, 177, 0.15), rgba(30, 109, 180, 0.1));
  color: var(--primary);
  border-left: 3px solid var(--primary);
}

.nav-item .icon {
  font-size: 1.15rem;
  width: 24px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 14px;
  border-top: 1px solid var(--border);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.user-profile:hover {
  background: rgba(255,255,255,0.05);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
}

.user-info .name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

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

/* Main Content Area */
.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 0;
  min-height: 100vh;
}

/* Top Bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: rgba(15, 25, 35, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-left h1 {
  font-size: 1.35rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--text-primary), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--primary);
  text-decoration: none;
}

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

.topbar-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar-btn:hover {
  background: rgba(45, 170, 177, 0.1);
  border-color: var(--border-strong);
  color: var(--primary);
}

.notification-badge {
  position: relative;
}

.notification-badge::after {
  content: '';
  position: absolute;
  top: 6px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--bg-dark);
}

/* Page Content */
.page-content {
  padding: 28px 32px;
}

/* ============== KPI CARDS ============== */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0;
  transition: var(--transition);
}

.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
  border-color: var(--border-strong);
}

.kpi-card:hover::before {
  opacity: 1;
}

.kpi-card.gold::before { background: linear-gradient(90deg, var(--secondary), var(--secondary-dark)); opacity: 1; }
.kpi-card.teal::before { background: linear-gradient(90deg, var(--primary), var(--primary-dark)); opacity: 1; }
.kpi-card.blue::before { background: linear-gradient(90deg, var(--accent), var(--accent-light)); opacity: 1; }
.kpi-card.red::before { background: linear-gradient(90deg, var(--danger), #c0392b); opacity: 1; }

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.kpi-icon.teal { background: rgba(45, 170, 177, 0.15); color: var(--primary); }
.kpi-icon.gold { background: rgba(214, 181, 49, 0.15); color: var(--secondary); }
.kpi-icon.blue { background: rgba(30, 109, 180, 0.15); color: var(--accent); }
.kpi-icon.red { background: rgba(231, 76, 60, 0.15); color: var(--danger); }

.kpi-trend {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
}

.kpi-trend.up { background: rgba(46, 204, 113, 0.15); color: var(--success); }
.kpi-trend.down { background: rgba(231, 76, 60, 0.15); color: var(--danger); }

.kpi-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}

.kpi-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ============== CHART CARDS ============== */

.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: var(--transition);
}

.chart-card:hover {
  border-color: var(--border-strong);
}

.chart-card.full-width {
  grid-column: 1 / -1;
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.chart-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.chart-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.chart-actions {
  display: flex;
  gap: 6px;
}

.chart-actions button {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.72rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.chart-actions button.active,
.chart-actions button:hover {
  background: rgba(45, 170, 177, 0.12);
  color: var(--primary);
  border-color: var(--primary);
}

.chart-container {
  position: relative;
  height: 280px;
}

/* ============== TABLES ============== */

.data-table-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 28px;
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.table-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

.table-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
}

.table-search input {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 0.82rem;
  outline: none;
  width: 180px;
}

.table-search input::placeholder {
  color: var(--text-muted);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  padding: 12px 24px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(0,0,0,0.15);
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 14px 24px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.data-table tr:hover td {
  background: rgba(45, 170, 177, 0.03);
}

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

.status-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
}

.status-badge.active { background: rgba(46, 204, 113, 0.15); color: var(--success); }
.status-badge.warning { background: rgba(243, 156, 18, 0.15); color: var(--warning); }
.status-badge.danger { background: rgba(231, 76, 60, 0.15); color: var(--danger); }
.status-badge.info { background: rgba(52, 152, 219, 0.15); color: var(--info); }

/* ============== ALERTS SECTION ============== */

.alert-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  transition: var(--transition);
}

.alert-card:hover {
  border-color: var(--border-strong);
}

.alert-card.alert-warning { border-left: 3px solid var(--warning); }
.alert-card.alert-danger { border-left: 3px solid var(--danger); }
.alert-card.alert-info { border-left: 3px solid var(--info); }

.alert-icon {
  font-size: 1.3rem;
  margin-top: 2px;
}

.alert-body h4 {
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 3px;
}

.alert-body p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.alert-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-left: auto;
  white-space: nowrap;
}

/* ============== BUTTONS ============== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  border: none;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 4px 15px rgba(45, 170, 177, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(45, 170, 177, 0.4);
}

.btn-secondary {
  background: rgba(255,255,255,0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: rgba(45, 170, 177, 0.08);
  color: var(--primary);
  border-color: var(--border-strong);
}

/* ============== LOGIN PAGE ============== */

.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-dark);
  position: relative;
  overflow: hidden;
}

.login-bg-effects {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.login-bg-effects .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
  animation: orbFloat 8s ease-in-out infinite;
}

.login-bg-effects .orb:nth-child(1) {
  width: 400px; height: 400px;
  background: var(--primary);
  top: -100px; right: -100px;
}

.login-bg-effects .orb:nth-child(2) {
  width: 300px; height: 300px;
  background: var(--accent);
  bottom: -80px; left: -80px;
  animation-delay: -4s;
}

.login-bg-effects .orb:nth-child(3) {
  width: 200px; height: 200px;
  background: var(--secondary);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -2s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -20px) scale(1.1); }
}

.login-card {
  background: rgba(22, 34, 49, 0.85);
  backdrop-filter: blur(30px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  width: 420px;
  max-width: 90vw;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo img {
  width: 72px;
  height: 72px;
  margin-bottom: 16px;
  border-radius: 14px;
}

.login-logo h1 {
  font-size: 1.4rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-logo p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.login-form .form-group {
  margin-bottom: 20px;
}

.login-form label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.login-form input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  transition: var(--transition);
  outline: none;
}

.login-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(45, 170, 177, 0.15);
}

.login-form input::placeholder {
  color: var(--text-muted);
}

.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  font-size: 0.78rem;
}

.form-options label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  cursor: pointer;
}

.form-options a {
  color: var(--primary);
  text-decoration: none;
}

.login-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(45, 170, 177, 0.35);
}

/* ============== RESPONSIVE ============== */

@media (max-width: 1024px) {
  .sidebar { width: 72px; }
  .sidebar-header h2, .sidebar-header span,
  .nav-item span, .nav-section-title,
  .user-info { display: none; }
  .sidebar-header { justify-content: center; padding: 16px; }
  .nav-item { justify-content: center; padding: 12px; }
  .main-content { margin-left: 72px; }
  .charts-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; }
  .page-content { padding: 16px; }
  .topbar { padding: 12px 16px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .charts-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .login-card { padding: 32px 24px; }
}

/* ============== ANIMATIONS ============== */

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

.animate-in {
  animation: fadeInUp 0.5s ease both;
}

.animate-in:nth-child(1) { animation-delay: 0.05s; }
.animate-in:nth-child(2) { animation-delay: 0.1s; }
.animate-in:nth-child(3) { animation-delay: 0.15s; }
.animate-in:nth-child(4) { animation-delay: 0.2s; }
.animate-in:nth-child(5) { animation-delay: 0.25s; }
.animate-in:nth-child(6) { animation-delay: 0.3s; }
