/* ===============================
VARIABLES & RESET
=============================== */

:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --secondary: #10b981;
  --danger: #ef4444;
  --background: #f3f4f6;
  --surface: #ffffff;
  --text-main: #1f2937;
  --text-muted: #6b7280;
  --sidebar-bg: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  --sidebar-hover: rgba(255, 255, 255, 0.1);
  --border-radius-lg: 16px;
  --border-radius-md: 10px;
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*{
  margin:0;
  padding:0;
  box-sizing:border-box;
  font-family: 'Inter', 'Segoe UI', sans-serif;
}

/* ===============================
BODY
=============================== */

html, body {
  width:100%;
  overflow-x:hidden;
  background: var(--background);
  color: var(--text-main);
  animation: fadePage 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadePage {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===============================
SIDEBAR
=============================== */

.sidebar {
  position:fixed;
  top:0;
  left:0;
  width:260px;
  height:100%;
  background: var(--sidebar-bg);
  color: #e2e8f0;
  padding-top:30px;
  overflow-y:auto;
  box-shadow: 4px 0 24px rgba(0,0,0,0.15);
  transition: var(--transition);
  z-index: 1000;
}

.sidebar-logo {
  text-align:center;
  margin-bottom:40px;
}

.sidebar-logo img {
  width:90px;
  display:block;
  margin:auto;
  margin-bottom:15px;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
}

.sidebar-logo img:hover {
  transform: scale(1.15) rotate(3deg);
}

.sidebar h4 {
  font-weight: 600;
  letter-spacing: 1px;
  font-size: 1.1rem;
  color: #f8fafc;
}

/* SIDEBAR LINKS */

.sidebar a {
  display: flex;
  align-items: center;
  padding: 16px 30px;
  color: #94a3b8;
  text-decoration:none;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
  border-left: 4px solid transparent;
}

.sidebar a:hover {
  background: var(--sidebar-hover);
  color: #ffffff;
  padding-left: 36px;
  border-left: 4px solid rgba(255,255,255,0.3);
}

.sidebar a.active {
  background: linear-gradient(90deg, rgba(79, 70, 229, 0.2) 0%, transparent 100%);
  color: #ffffff;
  border-left: 4px solid var(--primary);
  font-weight: 600;
}

/* ===============================
MAIN CONTENT
=============================== */

.main-content {
  margin-left: 260px;
  padding: 40px;
  width: calc(100% - 260px);
  min-height: 100vh;
}

/* ===============================
GLOBAL CARDS (Glassmorphism & Glow)
=============================== */

.card {
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--border-radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  background: var(--surface-hover);
  border-color: rgba(255, 255, 255, 0.8);
}

/* Subte Shine Effect on Hover */
.card::before {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 50%; height: 100%;
  background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0) 100%);
  transform: skewX(-25deg);
  transition: all 0.6s ease;
  pointer-events: none;
}

.card:hover::before {
  left: 200%;
  transition: all 0.8s ease;
}

/* ===============================
MODERN DETACHED TABLES (3D Hover)
=============================== */

.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--border-radius-lg);
  padding: 5px; /* Prevent shadow clipping */
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 12px; /* Detached rows */
}

table th {
  background: transparent;
  padding: 16px 20px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 1px;
  border: none;
}

table td {
  padding: 20px;
  color: var(--text-main);
  background: var(--surface);
  border-top: 1px solid rgba(255,255,255,0.8);
  border-bottom: 1px solid rgba(226, 232, 240, 0.4);
  backdrop-filter: blur(10px);
  transition: var(--transition-smooth);
}

/* Rounded corners for detached rows */
table td:first-child { border-top-left-radius: var(--border-radius-md); border-bottom-left-radius: var(--border-radius-md); border-left: 1px solid rgba(255,255,255,0.8); }
table td:last-child { border-top-right-radius: var(--border-radius-md); border-bottom-right-radius: var(--border-radius-md); border-right: 1px solid rgba(255,255,255,0.8); }

table tr {
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  border-radius: var(--border-radius-md);
}

table tbody tr:hover td {
  background: var(--surface-hover);
  transform: scale(1.02);
  z-index: 10;
  position: relative;
  box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.15);
  border-color: rgba(255,255,255,1);
}

/* ===============================
ADVANCED BUTTONS
=============================== */

.btn {
  border-radius: var(--border-radius-md);
  padding: 12px 24px;
  font-weight: 600;
  transition: var(--transition);
  letter-spacing: 0.5px;
  border: none;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #312e81 100%);
  color: white;
  box-shadow: 0 8px 15px rgba(79, 70, 229, 0.25);
  border: 1px solid rgba(255,255,255,0.1);
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: all 0.5s ease;
  transform: skewX(-25deg);
}

.btn-primary:hover::after { left: 150%; }

.btn-primary:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 15px 25px rgba(79, 70, 229, 0.4);
  background: linear-gradient(135deg, #4338ca 0%, #3730a3 100%);
  color: white;
}

.btn-primary:active {
  transform: translateY(2px) scale(0.98);
}

/* ===============================
ADVANCED INPUTS (Floating effect & glow)
=============================== */

.form-control {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.8);
  color: var(--text-main);
  border-radius: var(--border-radius-md);
  padding: 16px 20px;
  font-size: 1rem;
  transition: var(--transition-smooth);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02), var(--shadow-sm);
  backdrop-filter: blur(5px);
}

.form-control:focus {
  background: #ffffff;
  border-color: #818cf8;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02), 0 0 0 4px rgba(129, 140, 248, 0.2);
  transform: translateY(-2px);
  color: var(--text-main);
  outline: none;
}

/* ===============================
FOOTER
=============================== */

footer {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
}

/* ===============================
RESPONSIVE
=============================== */

@media(max-width: 992px) {
  .sidebar { width: 220px; }
  .main-content { margin-left: 250px; width: calc(100% - 250px); }
  footer { margin-left: 250px; width: calc(100% - 250px); }
}

@media(max-width: 768px) {
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    top: 0; left: 0;
    border-radius: 0;
    padding-bottom: 20px;
  }
  .main-content {
    margin-left: 0;
    width: 100%;
    padding: 20px;
  }
  footer { margin-left: 0; width: 100%; }
}

@media(max-width: 576px) {
  .sidebar {
    padding-top: 14px;
  }

  .sidebar-logo {
    margin-bottom: 20px;
  }

  .sidebar-logo img {
    width: 72px;
    margin-bottom: 10px;
  }

  .sidebar a {
    padding: 12px 16px;
    font-size: 0.92rem;
  }

  .main-content {
    padding: 14px;
  }

  h2 {
    font-size: 1.5rem !important;
    margin-bottom: 16px !important;
  }

  .card {
    border-radius: 12px;
  }

  .card-body {
    padding: 16px !important;
  }

  .btn {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.92rem;
  }

  .form-control {
    padding: 12px 14px;
    font-size: 0.95rem;
  }

  .table-responsive {
    border-radius: 10px;
    padding: 0;
  }

  table {
    border-spacing: 0 8px;
    min-width: 700px;
  }

  table th {
    font-size: 0.72rem;
    padding: 10px;
  }

  table td {
    font-size: 0.88rem;
    padding: 10px;
  }

  footer {
    padding: 20px 12px;
    font-size: 0.82rem;
  }
}