/* ============================================================================
   global.tododren.com  ·  estilos del portal de cargas y documentos
   Sistema propio, ligero, sin dependencias externas (self-contained).
   Acento cobalto, tipografia de sistema. Movil-first.
   ============================================================================ */

:root {
  --bg:        #eef2f7;
  --bg-grad-1: #e7f0fb;
  --bg-grad-2: #eef2f7;
  --surface:   #ffffff;
  --ink:       #0b1221;
  --ink-soft:  #5b6472;
  --ink-faint: #9aa3b2;
  --accent:    #2563eb;
  --accent-d:  #1d4ed8;
  --ok:        #16a34a;
  --ok-bg:     #dcfce7;
  --warn:      #b45309;
  --warn-bg:   #fef3c7;
  --err:       #b91c1c;
  --err-bg:    #fee2e2;
  --line:      #e5e9f0;
  --radius:    18px;
  --shadow:    0 10px 30px rgba(16,24,40,.08);
  --shadow-sm: 0 2px 8px rgba(16,24,40,.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(1200px 600px at 70% -10%, var(--bg-grad-1), transparent 60%),
    var(--bg-grad-2);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ── Botones ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .75rem 1.25rem; border-radius: 999px;
  font-weight: 600; font-size: 1rem; line-height: 1;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .08s ease, box-shadow .15s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(37,99,235,.35); }
.btn-primary:hover { background: var(--accent-d); }

/* ── Centrado de pantalla (estados y bienvenida) ─────────────────────────── */
.screen-center {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 1.25rem;
}

/* ── Tarjeta de estado ───────────────────────────────────────────────────── */
.state-card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 2.25rem 2rem;
  max-width: 420px; width: 100%; text-align: center;
}
.state-card__icon {
  width: 72px; height: 72px; margin: 0 auto 1rem;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 2rem; background: var(--warn-bg); color: var(--warn);
}
.state-card--ok    .state-card__icon { background: var(--ok-bg);   color: var(--ok); }
.state-card--error .state-card__icon { background: var(--err-bg);  color: var(--err); }
.state-card--warn  .state-card__icon { background: var(--warn-bg); color: var(--warn); }
.state-card__title { font-size: 1.4rem; margin: .25rem 0 .5rem; }
.state-card__msg { color: var(--ink-soft); font-size: .95rem; line-height: 1.5; margin: 0 0 1.25rem; }
.state-card .btn { margin-top: .25rem; }

/* ── Topbar ──────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .85rem 1.15rem;
  background: rgba(255,255,255,.85); backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar__brand { display: flex; align-items: center; gap: .6rem; }
.topbar__logo {
  font-weight: 800; letter-spacing: .5px; color: #fff;
  background: var(--accent); padding: .35rem .5rem; border-radius: 8px; font-size: .85rem;
}
.topbar__title { font-weight: 700; font-size: 1rem; }
.topbar__right { display: flex; align-items: center; gap: .75rem; }
.topbar__link {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .9rem; font-weight: 600; color: var(--accent);
  padding: .4rem .7rem; border-radius: 999px; border: 1px solid var(--line);
  background: #fff;
}
.topbar__link:hover { border-color: var(--accent); }
.topbar__link-ico { font-size: 1rem; }
.topbar__user { display: flex; align-items: center; gap: .5rem; }
.topbar__avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #e0e7ff; color: var(--accent-d); font-weight: 700; font-size: .95rem;
}
.topbar__uname { font-size: .9rem; color: var(--ink-soft); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__logout { font-size: .9rem; color: var(--ink-faint); }
.topbar__logout:hover { color: var(--err); }

/* ── Layout ──────────────────────────────────────────────────────────────── */
.wrap { max-width: 880px; margin: 0 auto; padding: 1.5rem 1.15rem 3rem; }

.hero { margin: 1rem 0 1.75rem; }
.hero__title { font-size: 1.7rem; margin: 0 0 .35rem; }
.hero__sub { color: var(--ink-soft); font-size: 1rem; line-height: 1.5; margin: 0; max-width: 46ch; }

/* ── Modulos ─────────────────────────────────────────────────────────────── */
.modules { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.module {
  position: relative; display: flex; align-items: center; gap: 1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem; box-shadow: var(--shadow-sm);
  transition: transform .1s ease, box-shadow .15s ease, border-color .15s ease;
}
.module[aria-disabled="true"] { opacity: .75; cursor: default; }
.module:not([aria-disabled="true"]):hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #cdd7e5; }
.module__ico {
  flex: 0 0 auto; width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; font-size: 1.6rem;
}
.module__ico--loads { background: #e0e7ff; }
.module__ico--docs  { background: #dcfce7; }
.module__body { flex: 1 1 auto; }
.module__title { font-size: 1.1rem; margin: 0 0 .2rem; }
.module__desc { color: var(--ink-soft); font-size: .88rem; line-height: 1.4; margin: 0; }
.module__badge {
  position: absolute; top: .8rem; right: .8rem;
  font-size: .68rem; font-weight: 700; letter-spacing: .3px; text-transform: uppercase;
  color: var(--ink-faint); background: #f1f5f9; padding: .2rem .5rem; border-radius: 999px;
}

.skeleton-note { text-align: center; color: var(--ink-faint); font-size: .8rem; margin-top: 2.5rem; }

/* ── Movil ───────────────────────────────────────────────────────────────── */
@media (max-width: 620px) {
  .modules { grid-template-columns: 1fr; }
  .topbar__uname { display: none; }
  .topbar__title { display: none; }
  .hero__title { font-size: 1.45rem; }
}
