:root {
  --navy: #314151; --navy-d: #26323F; --ink: #1F2A36; --text: #3D4A59; --muted: #5A6573;
  --orange: #F8890A; --orange-d: #A35400; --cream: #FFF7EE; --line: #ECE4D9; --gray: #F4F6F8; --line2: #E3E7EC;
  --ok-bg: #E6F4EA; --ok: #1E6B34; --warn-bg: #FFF0DC; --warn: #8A4700; --bad-bg: #FDE8E8; --bad: #A12828;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Roboto, Arial, sans-serif; color: var(--ink); background: var(--gray); }
a { color: var(--orange-d); }
h1, h2, h3 { font-family: 'Roboto Condensed', 'Arial Narrow', sans-serif; color: var(--navy); margin: 0; }
h1 { font-size: 34px; text-transform: uppercase; font-weight: 800; }
h2 { font-size: 24px; font-weight: 700; }
h3 { font-size: 19px; font-weight: 700; }
button, input, select, textarea { font: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1.5px solid var(--navy); background: var(--navy); color: #fff; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--navy-d); }
.btn.alt { background: #fff; color: var(--navy); }
.btn.alt:hover { background: var(--cream); }
.btn.orange { background: var(--orange); border-color: var(--orange); color: var(--ink); }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn.link { background: none; border: 0; color: var(--orange-d); padding: 0 4px; min-height: 36px; text-decoration: underline; }
.btn.danger { background: #fff; color: var(--bad); border-color: #E7B4B4; }
.btn:disabled { opacity: .55; cursor: wait; }

/* formularios */
label { display: block; font-size: 14px; font-weight: 500; color: var(--navy); margin-bottom: 6px; }
input, select, textarea { width: 100%; min-height: 44px; border: 1.5px solid #D5DBE1; border-radius: 10px; padding: 8px 12px; background: #fff; color: var(--ink); }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--orange); outline-offset: 1px; border-color: var(--orange); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; }
.hint { font-size: 13px; color: var(--muted); margin-top: 4px; }
.err { background: var(--bad-bg); color: var(--bad); border-radius: 10px; padding: 10px 14px; font-size: 14px; }

/* acceso */
.login-wrap { min-height: 100vh; display: flex; flex-wrap: wrap; }
.login-side { flex: 1 1 420px; background: var(--navy); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; position: relative; overflow: hidden; }
.login-side::after { content: ''; position: absolute; right: -140px; bottom: -160px; width: 460px; height: 460px; border-radius: 50%; border: 64px solid rgba(248,137,10,.12); }
.login-side h1 { color: #fff; font-size: 48px; line-height: 1; }
.login-side h1 span { color: var(--orange); }
.login-side p { color: #DCE2E8; font-size: 17px; line-height: 1.6; max-width: 460px; }
.login-main { flex: 1 1 420px; display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: #fff; }
.login-card { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 18px; }

/* estructura */
.top { background: #fff; box-shadow: 0 1px 0 var(--line); position: sticky; top: 0; z-index: 5; }
.top-in { max-width: 1180px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.top img { height: 40px; display: block; }
.who { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); flex-wrap: wrap; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1.5px solid transparent; background: none; cursor: pointer; font-weight: 500; color: var(--navy); }
.tab[aria-current="page"] { background: var(--navy); color: #fff; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 26px 20px 80px; display: flex; flex-direction: column; gap: 22px; }
.card { background: #fff; border: 1px solid var(--line2); border-radius: 18px; padding: 22px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.muted { color: var(--muted); font-size: 14px; }
.hero { background: var(--navy); color: #fff; border-radius: 20px; padding: 24px 26px; display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; align-items: center; }
.hero h1 { color: #fff; font-size: 30px; }
.hero .muted { color: #DCE2E8; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.stat { background: #fff; border: 1px solid var(--line2); border-radius: 16px; padding: 16px 18px; }
.stat b { display: block; font-family: 'Roboto Condensed', sans-serif; font-size: 30px; color: var(--navy); }
.stat span { font-size: 14px; color: var(--muted); }
.bar { height: 10px; background: #EEF1F4; border-radius: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--orange); border-radius: 6px; }

/* etiquetas de estado */
.pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.s-Terminado, .s-Pagado { background: var(--ok-bg); color: var(--ok); }
.s-En-proceso { background: var(--orange); color: var(--ink); }
.s-Observado, .s-Vencida { background: var(--bad-bg); color: var(--bad); }
.s-Pendiente { background: #EEF1F4; color: var(--text); }
.s-En-revisión { background: var(--warn-bg); color: var(--warn); }
.s-Anulado { background: #EEF1F4; color: var(--muted); text-decoration: line-through; }

/* listas */
.list { display: flex; flex-direction: column; }
.item { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 14px 4px; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; }
.item .main { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.item .main strong { font-size: 16px; }
.obs { background: var(--cream); border-left: 4px solid var(--orange); border-radius: 6px; padding: 8px 12px; font-size: 14px; color: var(--text); white-space: pre-line; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-family: 'Roboto Condensed', sans-serif; text-transform: uppercase; letter-spacing: .6px; font-size: 13px; color: var(--muted); padding: 10px 8px; border-bottom: 2px solid var(--line2); }
td { padding: 12px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--cream); }
.scroll { overflow-x: auto; }
.drop { border: 2px dashed #C9D0D8; border-radius: 14px; padding: 18px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; background: #FAFBFC; }

/* diálogo */
.modal-bg { position: fixed; inset: 0; background: rgba(15,20,26,.55); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50; }
.modal { background: #fff; border-radius: 18px; padding: 24px; width: 100%; max-width: 620px; max-height: 90vh; overflow: auto; display: flex; flex-direction: column; gap: 16px; }
.secret { font-family: 'Roboto Mono', Consolas, monospace; font-size: 22px; letter-spacing: 1px; background: var(--cream); border: 1.5px dashed var(--orange); border-radius: 12px; padding: 12px 16px; text-align: center; user-select: all; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 15px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 60; max-width: 90vw; }
#toast.show { opacity: 1; }
.empty { text-align: center; padding: 26px 10px; color: var(--muted); }
@media (max-width: 700px) { .login-side { padding: 32px 24px; } .login-side::after { display: none; } .login-side h1 { font-size: 36px; } h1 { font-size: 28px; } .hide-sm { display: none; } }
