
:root {

  --bg: #f4f7fb;

  --sidebar: #20252c;

  --sidebar-2: #171b21;

  --sidebar-hover: #2a3038;

  --border-dark: #333a44;

  --text-dark: #111827;

  --text: #243247;

  --muted: #64748b;

  --muted-2: #94a3b8;

  --line: #e5eaf1;

  --line-2: #d8e0ea;

  --panel: #ffffff;

  --green: #22c55e;

  --green-dark: #16a34a;

  --blue: #2563eb;

  --red: #dc2626;

  --yellow: #f59e0b;

  --radius: 16px;

  --shadow: 0 10px 30px rgba(15, 23, 42, .07);

  --shadow-soft: 0 4px 14px rgba(15, 23, 42, .06);

}



* {

  box-sizing: border-box;

}



html {

  scroll-behavior: smooth;

}



body {

  margin: 0;

  background: var(--bg);

  color: var(--text);

  font-family: Inter, Segoe UI, Roboto, Arial, Helvetica, sans-serif;

  font-size: 15px;

}



a {

  color: var(--blue);

  text-decoration: none;

}



a:hover {

  text-decoration: underline;

}



.layout {

  display: flex;

  min-height: 100vh;

  background:

    radial-gradient(circle at top right, rgba(34, 197, 94, .09), transparent 320px),

    var(--bg);

}



/* SIDEBAR */

.sidebar {

  width: 292px;

  min-height: 100vh;

  flex-shrink: 0;

  background: linear-gradient(180deg, #20252c 0%, #171b21 100%);

  color: #cbd5e1;

  position: sticky;

  top: 0;

  overflow-y: auto;

  border-right: 1px solid #111827;

  box-shadow: 8px 0 24px rgba(15, 23, 42, .12);

  z-index: 20;

}



.sidebar::-webkit-scrollbar {

  width: 8px;

}



.sidebar::-webkit-scrollbar-thumb {

  background: #3a4350;

  border-radius: 20px;

}



.brand {

  display: flex;

  align-items: center;

  gap: 13px;

  padding: 24px 20px 18px;

  color: #fff;

}



.brand-icon {

  width: 54px;

  height: 54px;

  border-radius: 18px;

  display: grid;

  place-items: center;

  font-size: 32px;

  font-weight: 900;

  color: #fff;

  background: linear-gradient(135deg, #22c55e, #2563eb);

  box-shadow: 0 12px 28px rgba(34, 197, 94, .24);

}



.brand-name {

  font-size: 28px;

  font-weight: 900;

  line-height: .95;

  letter-spacing: -.8px;

}



.brand-sub {

  color: #86efac;

  font-size: 13px;

  font-weight: 800;

  margin-top: 5px;

  letter-spacing: .4px;

  text-transform: uppercase;

}



.user-box {

  display: flex;

  align-items: center;

  gap: 13px;

  padding: 14px 20px 22px;

  color: #fff;

  border-bottom: 1px solid rgba(255,255,255,.06);

}



.avatar {

  width: 48px;

  height: 48px;

  border-radius: 16px;

  display: grid;

  place-items: center;

  background: linear-gradient(135deg, #3b82f6, #22c55e);

  border: 2px solid rgba(255,255,255,.75);

  box-shadow: var(--shadow-soft);

}



.menu {

  padding: 12px 10px 24px;

}



.menu-item {

  width: 100%;

  border: 0;

  background: transparent;

  color: #b8c4d6;

  display: flex;

  align-items: center;

  gap: 12px;

  padding: 12px 13px;

  margin: 3px 0;

  font-size: 15px;

  font-weight: 600;

  border-radius: 12px;

  text-align: left;

  cursor: pointer;

  transition: .18s ease;

}



.menu-item span {

  width: 26px;

  height: 26px;

  border-radius: 9px;

  display: grid;

  place-items: center;

  background: rgba(255,255,255,.06);

  font-size: 15px;

}



.menu-item b {

  margin-left: auto;

  color: #86efac;

  transition: .18s ease;

}



.menu-item:hover,

.menu-item.active,

.menu-toggle.open {

  background: rgba(255,255,255,.08);

  color: #fff;

  text-decoration: none;

}



.menu-toggle.open b {

  transform: rotate(180deg);

}



.submenu {

  display: none;

  background: rgba(0,0,0,.18);

  border: 1px solid rgba(255,255,255,.05);

  border-radius: 14px;

  padding: 7px;

  margin: 4px 0 8px 38px;

}



.submenu.open {

  display: block;

}



.submenu a {

  display: block;

  padding: 9px 12px;

  color: #aab7c9;

  font-size: 14px;

  border-radius: 10px;

}



.submenu a:hover,

.submenu a.active {

  color: #fff;

  background: rgba(34,197,94,.15);

  text-decoration: none;

}



.logout-form {

  margin: 0;

}



.logout {

  color: #fecaca;

}



/* CONTENT */

.content {

  flex: 1;

  min-width: 0;

}



.topbar {

  height: 72px;

  background: rgba(255,255,255,.92);

  backdrop-filter: blur(10px);

  display: flex;

  align-items: center;

  gap: 14px;

  padding: 0 28px;

  border-bottom: 1px solid var(--line);

  position: sticky;

  top: 0;

  z-index: 10;

  box-shadow: 0 5px 18px rgba(15, 23, 42, .04);

}



.topbar strong {

  display: block;

  color: var(--text-dark);

  font-size: 23px;

  line-height: 1.1;

  letter-spacing: -.3px;

}



.topbar small {

  display: block;

  margin-top: 4px;

  color: var(--muted);

  font-size: 13px;

}



.hamburger {

  border: 1px solid var(--line);

  background: #fff;

  color: var(--text);

  border-radius: 12px;

  padding: 9px 12px;

  font-size: 20px;

  display: none;

  box-shadow: var(--shadow-soft);

}



/* DIRECT PANELS */

.content > .panel {

  margin: 24px 28px;

}



.messages {

  padding: 18px 28px 0;

}



.alert {

  padding: 13px 15px;

  border-radius: 12px;

  margin-bottom: 10px;

  background: #ecfdf5;

  color: #166534;

  border: 1px solid #bbf7d0;

  box-shadow: var(--shadow-soft);

}



.alert.error {

  background: #fef2f2;

  color: #991b1b;

  border-color: #fecaca;

}



.alert.success {

  background: #ecfdf5;

  color: #166534;

  border-color: #bbf7d0;

}



/* DASHBOARD */

.cards {

  display: grid;

  grid-template-columns: repeat(6, minmax(150px, 1fr));

  gap: 18px;

  padding: 24px 28px;

}



.card,

.panel {

  background: var(--panel);

  border: 1px solid var(--line);

  border-radius: var(--radius);

  box-shadow: var(--shadow);

}



.stat {

  position: relative;

  padding: 18px;

  min-height: 118px;

  overflow: hidden;

}



.stat::before {

  content: "";

  position: absolute;

  inset: 0 auto 0 0;

  width: 5px;

  background: linear-gradient(180deg, var(--green), var(--blue));

}



.stat span {

  color: var(--muted);

  font-size: 13px;

  font-weight: 700;

  text-transform: uppercase;

  letter-spacing: .4px;

}



.stat strong {

  display: block;

  color: var(--text-dark);

  font-size: 34px;

  margin: 10px 0 5px;

  letter-spacing: -.8px;

}



.stat small {

  color: var(--muted);

}



.grid {

  display: grid;

  gap: 22px;

  padding: 0 28px 28px;

}



.grid.two {

  grid-template-columns: minmax(0, 1.35fr) minmax(360px, .65fr);

}



.panel {

  padding: 18px;

  overflow: hidden;

}



.panel.narrow {

  max-width: 1050px;

  margin: 24px 28px;

}



.panel-head {

  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 14px;

  margin-bottom: 16px;

  padding-bottom: 14px;

  border-bottom: 1px solid var(--line);

}



.panel-head h2 {

  margin: 0;

  color: var(--text-dark);

  font-size: 21px;

  letter-spacing: -.2px;

}



/* TABLES */

.table-wrap {

  overflow-x: auto;

  border: 1px solid var(--line);

  border-radius: 14px;

}



table {

  width: 100%;

  border-collapse: collapse;

  background: #fff;

}



th,

td {

  text-align: left;

  padding: 13px 12px;

  border-bottom: 1px solid var(--line);

  vertical-align: middle;

}



th {

  color: #475569;

  background: #f8fafc;

  font-size: 13px;

  font-weight: 800;

  text-transform: uppercase;

  letter-spacing: .25px;

  white-space: nowrap;

}



tr:hover td {

  background: #f8fafc;

}



tr:last-child td {

  border-bottom: 0;

}



td small {

  color: var(--muted);

}



/* BUTTONS */

.btn {

  display: inline-flex;

  align-items: center;

  justify-content: center;

  gap: 8px;

  border: 1px solid var(--line-2);

  background: #fff;

  color: var(--text);

  border-radius: 12px;

  padding: 10px 15px;

  font-size: 14px;

  font-weight: 700;

  cursor: pointer;

  transition: .18s ease;

  box-shadow: var(--shadow-soft);

}



.btn:hover {

  transform: translateY(-1px);

  text-decoration: none;

}



.btn.primary {

  background: linear-gradient(135deg, #22c55e, #16a34a);

  border-color: #16a34a;

  color: white;

}



.btn.success {

  background: #16a34a;

  border-color: #16a34a;

  color: white;

}



.btn.danger {

  background: #dc2626;

  border-color: #dc2626;

  color: white;

}



.btn.full {

  width: 100%;

}



.link-button {

  background: none;

  border: 0;

  color: var(--blue);

  cursor: pointer;

  padding: 0;

  font: inherit;

  font-weight: 700;

}



/* BADGES */

.badge {

  display: inline-flex;

  align-items: center;

  gap: 6px;

  border-radius: 999px;

  padding: 6px 10px;

  font-size: 12px;

  font-weight: 800;

  white-space: nowrap;

}



.badge::before {

  content: "";

  width: 7px;

  height: 7px;

  border-radius: 50%;

  background: currentColor;

}



.badge.activo,

.badge.nuevo {

  background: #dcfce7;

  color: #166534;

}



.badge.vencido,

.badge.progreso {

  background: #fef3c7;

  color: #92400e;

}



.badge.cortado,

.badge.suspendido,

.badge.cerrado {

  background: #fee2e2;

  color: #991b1b;

}



.badge.instalacion {

  background: #dbeafe;

  color: #1d4ed8;

}



/* FORMS */

.filters {

  display: flex;

  gap: 10px;

  margin-bottom: 16px;

}



.filters input {

  flex: 1;

}



input,

select,

textarea {

  width: 100%;

  padding: 11px 12px;

  border: 1px solid #cbd5e1;

  border-radius: 12px;

  background: #fff;

  color: #111827;

  font-size: 15px;

  outline: none;

}



input:focus,

select:focus,

textarea:focus {

  border-color: #22c55e;

  box-shadow: 0 0 0 4px rgba(34,197,94,.13);

}



input[type="checkbox"] {

  width: auto;

}



.form-grid {

  display: grid;

  grid-template-columns: repeat(2, minmax(0, 1fr));

  gap: 16px;

}



.form-field label {

  display: block;

  margin-bottom: 7px;

  font-weight: 800;

  color: #374151;

}



.form-field small {

  display: block;

  color: var(--muted);

  margin-top: 4px;

}



.form-field.wide,

.form-actions.wide {

  grid-column: 1 / -1;

}



.form-actions {

  display: flex;

  gap: 10px;

  flex-wrap: wrap;

}



/* DETAILS / LOGS */

.detail-list p {

  margin: 10px 0;

  padding-bottom: 10px;

  border-bottom: 1px dashed var(--line);

}



.actions-row {

  display: flex;

  gap: 10px;

  flex-wrap: wrap;

  margin-top: 18px;

}



.actions-row form,

.actions-inline form {

  display: inline;

}



.timeline {

  display: grid;

  gap: 12px;

}



.tl-item {

  position: relative;

  border-left: 4px solid var(--green);

  padding: 11px 13px;

  background: #f8fafc;

  border-radius: 12px;

}



.tl-item strong {

  color: var(--text-dark);

}



.tl-item p {

  margin: 6px 0;

  color: #475569;

}



.tl-item small {

  color: var(--muted);

}



.empty-module {

  margin: 24px 28px;

}



.module-roadmap {

  display: grid;

  grid-template-columns: repeat(3, 1fr);

  gap: 14px;

  margin-top: 16px;

}



.module-roadmap div {

  background: #f8fafc;

  border: 1px solid var(--line);

  border-radius: 14px;

  padding: 15px;

}



.module-roadmap strong {

  display: block;

  color: var(--text-dark);

}



.module-roadmap small {

  color: var(--muted);

}



/* LOGIN */

.login-page {

  min-height: 100vh;

  display: grid;

  place-items: center;

  background:

    radial-gradient(circle at top left, rgba(34,197,94,.25), transparent 360px),

    linear-gradient(135deg, #111827, #1f2937);

}



.login-card {

  width: min(430px, calc(100vw - 32px));

  background: #fff;

  border-radius: 22px;

  padding: 30px;

  box-shadow: 0 24px 80px rgba(0,0,0,.32);

}



.login-logo {

  font-size: 30px;

  font-weight: 900;

  color: #111827;

}



.login-card p {

  color: var(--muted);

  margin-top: 5px;

}



.login-card label {

  display: block;

  margin: 14px 0 7px;

  font-weight: 800;

}



.login-card small {

  display: block;

  margin-top: 15px;

  color: var(--muted);

}



/* RESPONSIVE */

@media (max-width: 1250px) {

  .cards {

    grid-template-columns: repeat(3, 1fr);

  }



  .grid.two {

    grid-template-columns: 1fr;

  }

}



@media (max-width: 860px) {

  .hamburger {

    display: block;

  }



  .sidebar {

    position: fixed;

    transform: translateX(-105%);

    transition: .2s ease;

  }



  .sidebar.open {

    transform: translateX(0);

  }



  .topbar {

    padding: 0 16px;

  }



  .cards {

    grid-template-columns: repeat(2, 1fr);

    padding: 16px;

  }



  .grid {

    padding: 0 16px 16px;

  }



  .content > .panel,

  .panel.narrow,

  .empty-module {

    margin: 16px;

  }



  .form-grid {

    grid-template-columns: 1fr;

  }



  .filters {

    flex-direction: column;

  }



  .module-roadmap {

    grid-template-columns: 1fr;

  }

}



@media (max-width: 520px) {

  .cards {

    grid-template-columns: 1fr;

  }



  .brand-name {

    font-size: 24px;

  }



  .topbar strong {

    font-size: 19px;

  }

}


.codearea { width:100%; font-family:Consolas, 'Courier New', monospace; font-size:13px; line-height:1.45; background:#0f172a; color:#e5e7eb; border-radius:14px; border:1px solid #334155; padding:14px; }
.badge.borrador { background:#e0f2fe; color:#075985; }
.badge.inactivo { background:#e5e7eb; color:#374151; }
