/* Sistema Master GP1 — Estilos */
:root {
  --c-bg:        #f5f4f0;
  --c-surface:   #ffffff;
  --c-border:    #e2e0d8;
  --c-text:      #1a1a18;
  --c-muted:     #6b6a64;
  --c-hint:      #9b9a94;

  --c-primary:   #1a1a18;
  --c-primary-h: #333330;

  --c-green:     #0f6e56;
  --c-green-bg:  #e1f5ee;
  --c-amber:     #854f0b;
  --c-amber-bg:  #faeeda;
  --c-red:       #a32d2d;
  --c-red-bg:    #fcebeb;
  --c-blue:      #185fa5;
  --c-blue-bg:   #e6f1fb;
  --c-purple:    #534ab7;
  --c-purple-bg: #eeedfe;

  --r:           8px;
  --r-lg:        12px;
  --shadow:      0 1px 3px rgba(0,0,0,.08);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--c-text);
  background: var(--c-bg);
}

a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── LOGIN ── */
.login-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 1rem;
}
.login-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 2.5rem 2rem;
  width: 100%; max-width: 380px;
  box-shadow: var(--shadow);
}
.login-logo {
  text-align: center; margin-bottom: 2rem;
}
.logo-text {
  font-size: 24px; font-weight: 700; letter-spacing: -.5px;
}
.logo-accent { color: var(--c-green); }
.logo-sub {
  display: block; font-size: 12px; color: var(--c-muted);
  letter-spacing: .5px; text-transform: uppercase; margin-top: 2px;
}

/* ── LAYOUT ── */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--c-text);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 100;
}
.sidebar-logo {
  padding: 1.25rem 1rem 1rem;
  color: #fff; font-size: 16px; font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-logo span { color: #5DCAA5; }
.sidebar-user {
  padding: .75rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-user-name { color: #fff; font-size: 13px; font-weight: 500; }
.sidebar-user-area {
  font-size: 11px; color: rgba(255,255,255,.5);
  text-transform: uppercase; letter-spacing: .5px;
}
nav.sidebar-nav { flex: 1; padding: .5rem 0; overflow-y: auto; }
.nav-section {
  font-size: 10px; color: rgba(255,255,255,.35);
  text-transform: uppercase; letter-spacing: .8px;
  padding: .75rem 1rem .25rem;
}
.nav-item {
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem 1rem;
  color: rgba(255,255,255,.7);
  font-size: 13px;
  cursor: pointer; transition: background .15s;
  border-left: 3px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active {
  background: rgba(255,255,255,.1); color: #fff;
  border-left-color: #5DCAA5;
}
.nav-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.sidebar-footer {
  padding: .75rem 1rem;
  border-top: 1px solid rgba(255,255,255,.1);
}
.sidebar-footer a {
  color: rgba(255,255,255,.5); font-size: 12px;
}
.sidebar-footer a:hover { color: #fff; }

.main-content {
  margin-left: 220px; flex: 1;
  display: flex; flex-direction: column; min-height: 100vh;
}
.topbar {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  padding: .875rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-size: 16px; font-weight: 600; }
.topbar-actions { display: flex; gap: .5rem; align-items: center; }
.page-body { padding: 1.5rem; flex: 1; }

/* ── CARDS ── */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 1.25rem 1.5rem;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem; padding-bottom: .75rem;
  border-bottom: 1px solid var(--c-border);
}
.card-title { font-size: 14px; font-weight: 600; }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; padding: .625rem .75rem;
  font-size: 11px; font-weight: 600;
  color: var(--c-muted); text-transform: uppercase; letter-spacing: .5px;
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
  white-space: nowrap;
}
td {
  padding: .75rem .75rem;
  border-bottom: 1px solid var(--c-border);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #faf9f7; }
.td-code { font-family: monospace; font-size: 12px; color: var(--c-muted); }
.td-name { font-weight: 500; }
.td-date { white-space: nowrap; color: var(--c-muted); font-size: 12px; }

/* ── SEMÁFOROS ── */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .6rem; border-radius: 20px;
  font-size: 11px; font-weight: 500; white-space: nowrap;
}
.badge-verde   { background: var(--c-green-bg);  color: var(--c-green);  }
.badge-amarillo{ background: var(--c-amber-bg);  color: var(--c-amber);  }
.badge-rojo    { background: var(--c-red-bg);    color: var(--c-red);    }
.badge-gris    { background: var(--c-border);    color: var(--c-muted);  }
.badge-azul    { background: var(--c-blue-bg);   color: var(--c-blue);   }
.badge-morado  { background: var(--c-purple-bg); color: var(--c-purple); }

.dot {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block;
}
.dot-verde    { background: var(--c-green); }
.dot-amarillo { background: #ba7517; }
.dot-rojo     { background: var(--c-red); }
.dot-gris     { background: var(--c-hint); }

/* ── FORMS ── */
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--c-muted); margin-bottom: .375rem;
  text-transform: uppercase; letter-spacing: .4px;
}
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], select, textarea {
  width: 100%; padding: .5rem .75rem;
  border: 1px solid var(--c-border); border-radius: var(--r);
  font-size: 14px; font-family: inherit;
  background: var(--c-surface); color: var(--c-text);
  transition: border-color .15s;
  appearance: none;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--c-primary);
}
textarea { resize: vertical; min-height: 80px; }
.form-row {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.form-hint { font-size: 11px; color: var(--c-hint); margin-top: .25rem; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .5rem 1rem; border-radius: var(--r);
  font-size: 13px; font-weight: 500; font-family: inherit;
  cursor: pointer; border: 1px solid transparent;
  transition: background .15s, opacity .15s;
  white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.btn-primary:hover { background: var(--c-primary-h); }
.btn-outline {
  background: transparent; border-color: var(--c-border); color: var(--c-text);
}
.btn-outline:hover { background: var(--c-bg); }
.btn-sm { padding: .3rem .7rem; font-size: 12px; }
.btn-full { width: 100%; }
.btn-green { background: var(--c-green); color: #fff; border-color: var(--c-green); }
.btn-green:hover { opacity: .9; }

/* ── ALERTS ── */
.alert {
  padding: .75rem 1rem; border-radius: var(--r);
  font-size: 13px; margin-bottom: 1rem;
}
.alert-error   { background: var(--c-red-bg);    color: var(--c-red);   border: 1px solid #f09595; }
.alert-success { background: var(--c-green-bg);  color: var(--c-green); border: 1px solid #5DCAA5; }
.alert-info    { background: var(--c-blue-bg);   color: var(--c-blue);  border: 1px solid #85b7eb; }

/* ── IMAGEN SET ── */
.set-img {
  width: 64px; height: 64px; object-fit: cover;
  border-radius: var(--r); border: 1px solid var(--c-border);
  flex-shrink: 0;
}
.set-img-placeholder {
  width: 64px; height: 64px; border-radius: var(--r);
  background: var(--c-bg); border: 1px solid var(--c-border);
  display: flex; align-items: center; justify-content: center;
  color: var(--c-hint); font-size: 11px; text-align: center;
  flex-shrink: 0;
}

/* ── PROGRESS BAR ── */
.progress-wrap {
  height: 6px; background: var(--c-border); border-radius: 3px;
  overflow: hidden; min-width: 80px;
}
.progress-bar {
  height: 100%; border-radius: 3px; transition: width .3s;
}
.progress-bar.p-low    { background: var(--c-hint); }
.progress-bar.p-mid    { background: #ba7517; }
.progress-bar.p-high   { background: var(--c-green); }
.progress-bar.p-done   { background: var(--c-green); }

/* ── STATS ROW ── */
.stats-row {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--r-lg); padding: 1rem 1.25rem;
}
.stat-label { font-size: 11px; color: var(--c-muted); text-transform: uppercase;
              letter-spacing: .5px; margin-bottom: .25rem; }
.stat-value { font-size: 22px; font-weight: 700; line-height: 1.2; }
.stat-sub   { font-size: 11px; color: var(--c-hint); margin-top: .125rem; }

/* ── MOBILE ── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .page-body { padding: 1rem; }
  .stats-row { grid-template-columns: 1fr 1fr; }
}
