/* ============================================================================
   Tobogan · Procurement Suite — Design System
   Colors: purple (#7C3AED) + cyan (#0891B2) on lilac-neutral backgrounds
   ========================================================================== */
:root {
  --brand: #7C3AED; --brand-2: #6D28D9; --brand-3: #8B5CF6; --brand-4: #A78BFA;
  --brand-soft: #F4EFFF; --brand-soft-2: #EBE2FE; --brand-line: #DDD0FB; --brand-ink: #4C1D95;
  --teal: #0891B2; --teal-2: #0E7490; --teal-soft: #E7F6FA; --teal-line: #BCE6F0; --teal-ink: #0C5A6E;
  --ok: #15803D; --ok-soft: #EAF7EF; --ok-line: #BFE6CD;
  --no: #DC2626; --no-soft: #FDEFEF; --no-line: #F5C9C9;
  --amber: #D97706; --amber-soft: #FEF5E6; --amber-line: #F6DCAE; --amber-ink: #92400E;
  --info: #2563EB; --info-soft: #EDF3FE; --info-line: #C9DAFB;
  --pink: #DB2777; --pink-soft: #FDEEF6; --pink-line: #F7CCE0; --pink-ink: #9D174D;

  --bg: #F4F3F9; --fondo: #F9F8FD; --panel: #FFFFFF;
  --tinta: #17132B; --tinta-2: #554E6F; --tinta-3: #8D88A4;
  --linea: #E7E4F1; --linea-2: #F0EEF7;
  --radio: 14px; --radio-sm: 10px;
  --sombra: 0 1px 2px rgba(23,19,43,.05), 0 10px 30px rgba(23,19,43,.07);
  --sombra-lg: 0 24px 60px rgba(23,19,43,.22);
  --sidebar-bg: linear-gradient(185deg, #1B1437 0%, #231A48 58%, #19122F 100%);
  --fuente: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: var(--fuente); font-size: 14px; color: var(--tinta); background: var(--bg); -webkit-font-smoothing: antialiased; line-height: 1.5; }
::selection { background: var(--brand-soft-2); }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ============================================================================
   LOGIN
   ========================================================================== */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.08fr .92fr; background: #140F2B; }

.login-hero { position: relative; overflow: hidden; color: #ECE8FA; padding: 52px 60px; display: flex; flex-direction: column; justify-content: space-between; background: var(--sidebar-bg); }
.login-hero::before { content: ""; position: absolute; width: 620px; height: 620px; border-radius: 50%; background: radial-gradient(circle, rgba(139,92,246,.30), transparent 62%); top: -200px; right: -180px; }
.login-hero::after { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle, rgba(8,145,178,.30), transparent 60%); bottom: -220px; left: -160px; }
.login-hero > * { position: relative; z-index: 1; }

.login-top { display: flex; align-items: center; justify-content: space-between; }
.login-tob { height: 56px; width: auto; vertical-align: middle; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: #C4B5FD; background: rgba(139,92,246,.14); border: 1px solid rgba(167,139,250,.3); padding: 6px 12px; border-radius: 999px; }
.login-hero-mid { max-width: 620px; margin: auto 0; padding-left: 40px; }
.login-hero h1 { font-size: 52px; line-height: 1.08; letter-spacing: -1.2px; margin: 22px 0 18px; font-weight: 800; color: #fff; }
.login-hero h1 span { background: linear-gradient(90deg, #C4B5FD, #67E8F9); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-hero p { font-size: 17.5px; line-height: 1.6; color: #BDB4DC; margin: 0; }

.login-modules { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.login-mod { flex: 1; min-width: 140px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.09); border-radius: 14px; padding: 14px; display: flex; gap: 10px; align-items: center; }
.login-mod-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex: none; }
.login-mod-name { font-weight: 700; color: #fff; font-size: 12.5px; }
.login-mod-desc { font-size: 11px; color: #B3A9D6; margin-top: 1px; }

.login-hero-foot { font-size: 12px; color: #8D83B5; display: flex; gap: 18px; flex-wrap: wrap; }
.login-panel { background: var(--panel); display: flex; align-items: center; justify-content: center; padding: 40px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-size: 23px; margin: 0 0 5px; letter-spacing: -.4px; }
.login-lead { color: var(--tinta-2); font-size: 14px; margin: 0 0 24px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 650; color: var(--tinta-2); margin-bottom: 6px; }
.input { width: 100%; padding: 11px 12px; border: 1px solid var(--linea); border-radius: var(--radio-sm); color: var(--tinta); background: var(--fondo); outline: none; font-family: inherit; font-size: 14px; transition: border-color .15s, box-shadow .15s; }
.input:focus { border-color: var(--brand-3); box-shadow: 0 0 0 3px rgba(124,58,237,.14); background: #fff; }
.login-btn { width: 100%; margin-top: 6px; padding: 13px; border: 0; border-radius: var(--radio-sm); cursor: pointer; background: linear-gradient(180deg, #8B5CF6, #7C3AED); color: #fff; font-weight: 750; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 10px 24px rgba(124,58,237,.32); transition: box-shadow .15s; }
.login-btn:hover { box-shadow: 0 12px 28px rgba(124,58,237,.42); }
.login-error { color: var(--no); font-size: 13px; margin-top: 10px; text-align: center; font-weight: 600; }
.login-hint { font-size: 12px; color: var(--tinta-3); text-align: center; margin-top: 18px; line-height: 1.6; }

@media (max-width: 960px) { .login { grid-template-columns: 1fr; } .login-hero { display: none; } }

/* ============================================================================
   DASHBOARD — Tool Menu
   ========================================================================== */
.shell { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }

.top-bar { height: 64px; flex: none; background: rgba(255,255,255,.9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--linea); display: flex; align-items: center; justify-content: space-between; padding: 0 32px; position: sticky; top: 0; z-index: 20; }
.top-left { display: flex; align-items: center; gap: 12px; }
.top-logo { height: 36px; }
.top-sep { width: 1px; height: 28px; background: var(--linea); }
.top-title { font-weight: 800; font-size: 16px; color: var(--brand-ink); letter-spacing: -.3px; }
.top-right { display: flex; align-items: center; gap: 16px; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--brand-soft); }
.user-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.user-name { font-size: 13px; font-weight: 600; color: var(--brand-ink); }
.logout-btn { font-size: 12.5px; font-weight: 600; color: var(--tinta-3); padding: 6px 12px; border-radius: var(--radio-sm); border: 1px solid var(--linea); background: #fff; transition: .15s; }
.logout-btn:hover { border-color: var(--tinta-3); color: var(--tinta); }

.dash-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 32px; }
.dash-intro { text-align: center; margin-bottom: 48px; }
.dash-intro h1 { font-size: 32px; font-weight: 800; letter-spacing: -.6px; color: var(--tinta); margin-bottom: 8px; }
.dash-intro h1 span { background: linear-gradient(90deg, var(--brand), var(--teal)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.dash-intro p { font-size: 16px; color: var(--tinta-2); max-width: 520px; margin: 0 auto; }

/* Tool cards — horizontal row */
.tool-grid { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; max-width: 1200px; width: 100%; }

.tool-card { flex: 1 1 200px; max-width: 260px; min-height: 220px; background: var(--panel); border: 1px solid var(--linea); border-radius: 18px; padding: 28px 22px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; cursor: pointer; transition: transform .18s, box-shadow .18s, border-color .18s; text-decoration: none; color: inherit; }
.tool-card:hover { transform: translateY(-4px); box-shadow: var(--sombra-lg); border-color: var(--brand-3); }

.tool-icon { width: 56px; height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center; flex: none; }
.tool-icon svg { width: 28px; height: 28px; }
.tool-icon-purple { background: var(--brand-soft); color: var(--brand); }
.tool-icon-teal { background: var(--teal-soft); color: var(--teal); }
.tool-icon-amber { background: var(--amber-soft); color: var(--amber); }
.tool-icon-pink { background: var(--pink-soft); color: var(--pink); }

.tool-name { font-size: 20px; font-weight: 800; letter-spacing: -.3px; }
.tool-desc { font-size: 12.5px; color: var(--tinta-2); line-height: 1.55; }
.tool-badge { font-size: 13px; font-weight: 700; padding: 6px 14px; border-radius: 20px; margin-top: auto; letter-spacing: .3px; }
.tool-badge-purple { background: var(--brand-soft); color: var(--brand-ink); }
.tool-badge-teal { background: var(--teal-soft); color: var(--teal-ink); }
.tool-badge-amber { background: var(--amber-soft); color: var(--amber-ink); }
.tool-badge-pink { background: var(--pink-soft); color: var(--pink-ink); }

.dash-footer { text-align: center; margin-top: 48px; font-size: 12px; color: var(--tinta-3); display: flex; align-items: center; gap: 8px; justify-content: center; }
.dash-footer img { height: 28px; opacity: .5; }

/* ============================================================================
   EMBEDDED TOOL VIEW
   ========================================================================== */
.shell-embed { height: 100vh; overflow: hidden; }
.embed-frame { flex: 1; min-height: 0; position: relative; }
.tool-iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }

.back-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 650; color: var(--brand); padding: 7px 14px; border-radius: var(--radio-sm); border: 1px solid var(--brand-line); background: var(--brand-soft); transition: .15s; }
.back-btn:hover { background: var(--brand-soft-2); border-color: var(--brand-3); }
.back-btn svg { flex: none; }

@media (max-width: 720px) {
  .tool-grid { flex-direction: column; align-items: center; }
  .tool-card { max-width: 340px; min-height: 180px; }
  .dash-intro h1 { font-size: 24px; }
}
