:root {
  --bg: #0b1220;
  --card: #131c2e;
  --border: #223049;
  --text: #e6edf7;
  --muted: #93a3bf;
  --accent: #4f8cff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar-logo { position: fixed; top: 20px; left: 32px; z-index: 20; }
.topbar-logo img { height: 30px; display: block; }

.dashboard-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.dashboard-nav a {
  color: var(--muted); text-decoration: none; font-size: 13.5px;
  padding: 7px 12px; border-radius: 8px;
}
.dashboard-nav a:hover { color: var(--text); background: var(--card); }
.nav-dropdown { position: relative; }
.nav-dropdown > button {
  background: none; cursor: pointer; font-family: inherit;
  color: var(--muted); font-size: 13.5px; padding: 7px 12px; border-radius: 8px; border: none;
}
.nav-dropdown:hover > button, .nav-dropdown:focus-within > button { color: var(--text); background: var(--card); }
.nav-dropdown-menu {
  display: none; position: absolute; top: 100%; left: 0; margin-top: 0;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 6px; min-width: 190px; box-shadow: 0 16px 40px -12px rgba(0,0,0,0.6); z-index: 30;
}
.nav-dropdown.hover-open .nav-dropdown-menu, .nav-dropdown:focus-within .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a { display: block; padding: 8px 12px; border-radius: 6px; white-space: nowrap; font-size: 13.5px; }
.nav-toggle { display: none; }

/* Login */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  width: 100%;
  max-width: 360px;
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 20px;
}

.login-card p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
}

.login-card label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
  margin-top: 14px;
}

.login-card input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0e1626;
  color: var(--text);
  font-size: 14px;
}

.login-card button {
  width: 100%;
  margin-top: 22px;
  padding: 11px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.login-card button:hover { opacity: 0.9; }

.error {
  color: #ff6b6b;
  font-size: 13px;
  background: rgba(255,107,107,0.1);
  border-radius: 6px;
  padding: 8px 10px;
}

.msg-ok {
  color: #1de9b6;
  font-size: 13px;
  background: rgba(29,233,182,0.1);
  border-radius: 6px;
  padding: 8px 10px;
}

/* Dashboard */
.dashboard-body { min-height: 100vh; }

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
}

.dashboard-header h1 { font-size: 20px; margin: 0; }

.usuario-actual {
  color: var(--muted);
  font-size: 13px;
  margin-right: 12px;
}

.logout-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
}

.logout-link:hover { color: var(--text); border-color: var(--accent); }

.reportes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(620px, 1fr));
  gap: 20px;
  padding: 24px 32px;
}

.reporte-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.reporte-card h2 {
  font-size: 15px;
  margin: 0 0 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.reporte-embed {
  position: relative;
  width: 100%;
  padding-top: 62.25%; /* proporcion 600x373.5 */
  border-radius: 8px;
  overflow: hidden;
}

.reporte-embed iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

@media (max-width: 700px) {
  .reportes-grid { grid-template-columns: 1fr; padding: 16px; }
  .dashboard-header { padding: 16px; flex-wrap: wrap; }
  .topbar-logo { position: static; margin-bottom: 8px; }
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--border);
    background: var(--card); color: var(--text); font-size: 18px; cursor: pointer;
  }
  .dashboard-nav { display: none; width: 100%; order: 3; margin-top: 14px; flex-direction: column; align-items: stretch; gap: 2px; }
  .dashboard-nav.nav-open { display: flex; }
  .dashboard-nav a { padding: 12px 14px; }
  .nav-dropdown { width: 100%; }
  .nav-dropdown > button { width: 100%; text-align: left; padding: 12px 14px; }
  .nav-dropdown-menu {
    display: none; position: static; box-shadow: none; border: none;
    background: none; padding: 0 0 0 16px; margin: 0; min-width: 0;
  }
  .nav-dropdown-menu a { padding: 10px 14px; }
  .nav-dropdown.hover-open .nav-dropdown-menu, .nav-dropdown:focus-within .nav-dropdown-menu { display: none; }
  .nav-dropdown.dropdown-open .nav-dropdown-menu { display: block; }
}

/* Admin (aprobacion de solicitudes) */
.admin-main { max-width: 1000px; margin: 0 auto; padding: 100px 24px 40px; }
.admin-main h1 { font-size: 20px; margin: 0 0 20px; }
.admin-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.admin-table th, .admin-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.admin-table th { color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; }
.admin-table tr:last-child td { border-bottom: none; }

.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.tag-pendiente { background: rgba(255,193,7,0.15); color: #ffc107; }
.tag-activo { background: rgba(29,233,182,0.15); color: #1de9b6; }
.tag-rechazado { background: rgba(255,107,107,0.15); color: #ff6b6b; }

.btn-mini { padding: 6px 12px; font-size: 12.5px; border-radius: 6px; border: none; cursor: pointer; background: var(--accent); color: #fff; font-weight: 600; }
.btn-mini:hover { opacity: 0.9; }
.btn-mini-secondary { background: transparent; border: 1px solid var(--border); color: var(--text); margin-left: 6px; }
