/* ==========================================================
   Portal de clientes · Devani & Carrizo
   Misma paleta y tipografías que la web y los informes.
   ========================================================== */

:root {
  --olive: #B4B000;
  --olive-dark: #867f00;
  --olive-light: #d9d340;
  --navy: #1a2438;
  --navy-2: #222e46;
  --navy-3: #2c3a57;
  --navy-text: #e7ebf3;
  --navy-muted: #a9b2c4;
  --bg: #faf9f3;
  --surface: #ffffff;
  --surface-2: #f2f0e6;
  --text: #1c1c18;
  --text-muted: #6c6a5a;
  --border: #e7e4d5;
  --verde: #28935f;
  --rojo: #b4232f;

  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-wide: "Montserrat", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --stripes: repeating-linear-gradient(-45deg, var(--olive) 0 10px, transparent 10px 22px);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--font-sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
p { margin: 0 0 1em; }
a { color: inherit; }
[hidden] { display: none !important; }

/* ---------- Encabezado ---------- */
.topbar { background: var(--navy); color: var(--navy-text); border-bottom: 3px solid var(--olive); }
.topbar-in { max-width: 1080px; margin: 0 auto; padding: 0 16px; height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; }
.brand img { width: 28px; height: 36px; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name { font: 400 19px var(--font-serif); }
.brand-sub { font: 300 8px var(--font-wide); letter-spacing: 2.2px; text-transform: uppercase; margin-top: 6px; }
.top-actions { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.top-user { color: var(--navy-muted); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) { .top-user { display: none; } }

/* ---------- Botones y formularios ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 10px; border: 1.5px solid transparent;
  font: 600 15px var(--font-sans); text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s;
}
.btn:disabled { opacity: .6; cursor: wait; }
.btn-primary { background: var(--olive); color: var(--navy); }
.btn-primary:hover { background: var(--olive-light); }
.btn-dark { background: var(--navy); color: #fff; }
.btn-dark:hover { background: var(--navy-3); }
.btn-ghost { border-color: rgba(231, 235, 243, .35); color: var(--navy-text); background: none; padding: 7px 14px; font-size: 14px; }
.btn-ghost:hover { border-color: var(--olive); }
.btn-line { border-color: var(--border); background: var(--surface); color: var(--navy); padding: 7px 12px; font-size: 13.5px; }
.btn-line:hover { border-color: var(--olive); }
.link-btn { background: none; border: 0; padding: 0; color: var(--olive-dark); font: 600 14px var(--font-sans); cursor: pointer; text-decoration: underline; }

/* align-content: start evita que el casillero baje cuando el campo de al lado tiene una aclaración */
.field { display: grid; gap: 6px; align-content: start; font-size: 14px; font-weight: 600; color: var(--navy); }
.field input, .field select {
  font: 400 16px var(--font-sans); color: var(--text); width: 100%;
  padding: 0 13px; height: 46px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--bg);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--olive); background: #fff; }
.field small { font-weight: 400; color: var(--text-muted); font-size: 12.5px; }

/* Ojito para mostrar u ocultar la contraseña */
.pass-wrap { position: relative; display: block; }
.pass-wrap input { padding-right: 48px; }
.pass-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border: 0; background: none; border-radius: 8px;
  display: grid; place-items: center; cursor: pointer; color: var(--text-muted);
}
.pass-toggle:hover { color: var(--navy); background: var(--surface-2); }
.pass-toggle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.msg { font-size: 14px; border-radius: 10px; padding: 10px 14px; margin: 0; }
.msg-error { background: #fbe9eb; color: var(--rojo); }
.msg-ok { background: #e3f3ea; color: var(--verde); }

/* ---------- Cartel de confirmación ---------- */
.dialogo {
  border: 0; border-radius: 16px; padding: 0; width: min(420px, calc(100% - 32px));
  box-shadow: 0 24px 60px rgba(26, 36, 56, .3); border-top: 4px solid var(--olive);
}
.dialogo::backdrop { background: rgba(26, 36, 56, .55); }
.dialogo form { padding: 26px 24px 22px; }
.dialogo h2 { font: 600 22px var(--font-serif); color: var(--navy); margin-bottom: 8px; }
.dialogo p { color: var(--text-muted); font-size: 15px; }
.dialogo-acciones { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.dialogo-acciones .btn { padding: 10px 18px; font-size: 14.5px; }

/* ---------- Pantalla de ingreso ---------- */
.login-page { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; }
.login-wrap { display: grid; place-items: center; padding: 40px 16px; position: relative; overflow: hidden; }
.login-wrap::before {
  content: ""; position: absolute; right: -10%; top: -20%; width: 40%; height: 140%;
  background: var(--stripes); opacity: .06; transform: skewX(-8deg); pointer-events: none;
}
.login-card {
  position: relative; width: 100%; max-width: 420px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 18px; padding: 32px 28px;
  box-shadow: 0 20px 50px rgba(26, 36, 56, .12); display: grid; gap: 16px;
}
.login-card .kicker { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--olive-dark); margin: 0; }
.login-card h1 { font: 400 32px/1.1 var(--font-serif); color: var(--navy); }
.login-card .lead { color: var(--text-muted); font-size: 15px; margin: 0; }
.login-card .btn { width: 100%; }
.login-foot { text-align: center; font-size: 13.5px; color: var(--text-muted); margin: 0; }

/* ---------- Página del cliente ---------- */
.container { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.hello { background: var(--navy); color: var(--navy-text); padding: 40px 0 44px; position: relative; overflow: hidden; }
.hello::after { content: ""; position: absolute; right: -40px; top: -40px; width: 260px; height: 320px; background: var(--stripes); opacity: .07; }
.hello .kicker { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--olive-light); margin-bottom: 8px; }
.hello h1 { font: 400 clamp(30px, 4.5vw, 44px)/1.1 var(--font-serif); color: #fff; }
.hello-meta { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 18px; font-size: 14px; color: var(--navy-muted); }
.hello-meta b { display: block; color: #fff; font: 500 15px var(--font-mono); }

.cards { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); padding: 32px 0 56px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 24px;
  display: flex; flex-direction: column; gap: 10px;
}
.card-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--navy); display: grid; place-items: center; }
.card-icon svg { width: 22px; height: 22px; fill: none; stroke: var(--olive-light); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.card h2 { font: 600 21px var(--font-serif); color: var(--navy); margin-top: 6px; }
.card p { color: var(--text-muted); font-size: 15px; margin: 0; }
.card .btn { align-self: flex-start; margin-top: auto; }
.card-soon { background: var(--surface-2); border-style: dashed; }
.tag-soon { align-self: flex-start; font: 600 11px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--olive-dark); border: 1px solid var(--olive); border-radius: 99px; padding: 3px 10px; }

.center-msg { max-width: 520px; margin: 64px auto; text-align: center; padding: 0 16px; }
.center-msg h1 { font: 400 30px var(--font-serif); color: var(--navy); margin-bottom: 12px; }

/* ---------- Panel del estudio ---------- */
.admin-head { padding: 32px 0 8px; display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; }
.admin-head h1 { font: 400 34px var(--font-serif); color: var(--navy); }
.admin-head p { color: var(--text-muted); margin: 4px 0 0; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 24px; margin: 20px 0; }
.panel h2 { font: 600 20px var(--font-serif); color: var(--navy); margin-bottom: 16px; }
.form-grid { display: grid; gap: 18px 20px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: start; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 18px; }

.table-wrap { overflow-x: auto; }
table.clientes { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 720px; }
.clientes th { text-align: left; font: 600 11.5px var(--font-sans); letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); padding: 10px 12px; border-bottom: 2px solid var(--navy); }
.clientes td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.clientes td.mono { font-family: var(--font-mono); font-size: 13.5px; }
.clientes .acciones { display: flex; flex-wrap: wrap; gap: 6px; }
.estado { font: 700 11px var(--font-sans); letter-spacing: .05em; text-transform: uppercase; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.estado-on { background: #e3f3ea; color: var(--verde); }
.estado-off { background: var(--surface-2); color: var(--text-muted); }
.vacio { text-align: center; color: var(--text-muted); padding: 28px 0; }
