:root {
  --ink: #17233c;
  --muted: #718096;
  --line: #e4eaf2;
  --surface: #ffffff;
  --canvas: #f4f7fb;
  --blue: #a83d69;
  --blue-dark: #742344;
  --green: #16866a;
  --red: #c83c50;
  --yellow: #a86a00;
}

* { box-sizing: border-box; font-family: "Segoe UI", Tahoma, sans-serif; }
body { background:var(--canvas); margin:0; color:var(--ink); }
a { color:inherit; }
.container { max-width:1440px; margin:0 auto; padding:34px 34px 20px; }
.form-heading { margin-bottom:24px; }
.form-heading h1 { margin:0; font-family:Georgia, serif; font-size:34px; font-weight:500; }
.form-heading p:not(.eyebrow) { margin:7px 0 0; color:var(--muted); font-size:14px; }
.form-card { width:100%; max-width:980px; margin:0 auto; padding:42px 48px; }
.modern-form { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:26px 24px; }
.field { min-width:0; }
.field label { display:block; margin:0 0 7px; color:#53647d; font-size:12px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; }
.directo-option { grid-column:1 / -1; padding:14px 16px; border:1px solid #f0c5d5; border-radius:8px; background:#fff7fa; }
.checkbox-label { display:flex; align-items:center; gap:10px; color:var(--blue-dark); font-size:13px; font-weight:700; cursor:pointer; }
.checkbox-label input { width:17px; height:17px; accent-color:var(--blue); }
.field-message { display:block; min-height:18px; margin-top:7px; color:var(--muted); font-size:12px; }
.form-section { grid-column:1 / -1; padding:4px 0 12px; border-bottom:1px solid var(--line); }
.form-section:not(:first-child) { margin-top:12px; }
.form-section h2 { margin:0; color:var(--ink); font-family:Georgia, serif; font-size:21px; font-weight:500; }
.form-section p { margin:5px 0 0; color:var(--muted); font-size:13px; }
.form-actions { grid-column:1 / -1; display:flex; justify-content:flex-end; gap:10px; padding-top:18px; border-top:1px solid var(--line); }
.form-actions .btn-ghost { order:1; }
.form-actions .btn-primary { order:2; }
.form-actions .btn-primary span { margin-left:10px; font-size:18px; line-height:12px; }
.btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; padding:10px 15px; border:0; border-radius:7px; cursor:pointer; font-size:13px; font-weight:700; text-decoration:none; transition:background .2s, transform .2s; }
.btn:hover { transform:translateY(-1px); }
.btn-primary { background:var(--blue); color:#fff; }
.btn-primary:hover { background:var(--blue-dark); }
.btn-danger { background:#fff0f2; color:var(--red); }
.btn-danger:hover { background:#ffe0e5; }
.btn-info { background:#e8f3ff; color:#1d5da8; }
.btn-info:hover { background:#d5eaff; }
.btn-excel { background:#e3f5ee; color:#16755e; }
.btn-excel:hover { background:#d0eee3; }
.btn-warning { background:#fff4db; color:var(--yellow); }
.btn-warning:hover { background:#ffe9b8; }
.btn-ghost { background:#f0f2f6; }
.card, .table-card { background:var(--surface); border:1px solid var(--line); border-radius:10px; box-shadow:0 8px 24px rgba(38,58,91,.06); }
.grid { display:flex; gap:12px; flex-wrap:wrap; }
.form-row { display:flex; gap:12px; margin-bottom:10px; }
.form-row .col { flex:1; }
.input, select, input[type="text"] { width:100%; padding:12px 13px; border:1px solid #d5deea; border-radius:7px; background:#fbfcfe; color:var(--ink); font-size:14px; outline:none; transition:border .2s, box-shadow .2s; }
.input:focus, select:focus, input[type="text"]:focus { border-color:var(--blue); box-shadow:0 0 0 3px rgba(35,100,210,.13); }
.small { display:block; margin:16px 0 7px; font-size:12px; font-weight:700; letter-spacing:.04em; color:#53647d; text-transform:uppercase; }
.actions { display:flex; gap:8px; }
.search { display:flex; gap:8px; margin-bottom:12px; }

.login-page { min-height:100vh; display:grid; grid-template-columns:minmax(340px, .9fr) minmax(420px, 1.1fr); background:#f4f7fb; }
.login-brand { position:relative; display:flex; flex-direction:column; align-items:flex-start; justify-content:center; padding:70px 12%; overflow:hidden; background:linear-gradient(145deg, #742344 0%, #a83d69 52%, #f3b8cc 145%); color:#fff; }
.login-brand::after { content:""; position:absolute; width:360px; height:360px; right:-150px; bottom:-170px; border:70px solid rgba(97,185,171,.22); border-radius:50%; }
.brand-mark { display:grid; place-items:center; width:42px; height:42px; margin-bottom:28px; border-radius:10px; background:#f8c5d8; color:#742344; font-size:30px; font-weight:800; }
.eyebrow { margin:0 0 12px; color:#961f4b; font-size:11px; font-weight:800; letter-spacing:.14em; }
.login-brand h1 { max-width:440px; margin:20px 0 0; font-family:Georgia, serif; font-size:clamp(38px, 4.4vw, 64px); font-weight:500; line-height:1.03; }
.brand-copy { max-width:370px; margin:22px 0 42px; color:#c6d4e7; font-size:16px; line-height:1.6; }
.login-logo { width:min(280px, 90%); height:auto; margin-bottom:28px; object-fit:contain; object-position:left center; opacity:1; }
.login-panel { display:grid; place-items:center; padding:40px 24px; }
.login-card { width:min(100%, 420px); padding:42px; background:#fff; border:1px solid var(--line); border-radius:12px; box-shadow:0 16px 42px rgba(35,55,88,.1); }
.login-card h2 { margin:0; font-family:Georgia, serif; font-size:34px; font-weight:500; }
.login-intro { margin:10px 0 24px; color:var(--muted); font-size:14px; }
.login-submit { width:100%; margin-top:24px; padding:13px 16px; font-size:14px; background:linear-gradient(135deg, #d9789e, #742344); }
.login-submit:hover { background:linear-gradient(135deg, #e69ab7, #8e2e58); }
.login-submit span { margin-left:auto; font-size:20px; line-height:12px; }
.login-footer { position:absolute; bottom:24px; color:var(--muted); font-size:12px; }

.topbar { display:flex; align-items:center; justify-content:space-between; gap:24px; min-height:76px; padding:14px 34px; background:#742344; color:#fff; }
.topbar-brand, .topbar-account, .user-chip { display:flex; align-items:center; }
.topbar-brand { gap:12px; }
.topbar-brand .brand-mark { width:36px; height:36px; margin:0; border-radius:8px; font-size:25px; }
.topbar-brand strong, .topbar-brand span { display:block; }
.topbar-brand strong { font-size:16px; }
.topbar-brand span { margin-top:2px; color:#f2c4d3; font-size:11px; }
.topbar-account { gap:20px; }
.user-chip { gap:10px; }
.user-avatar { display:grid; place-items:center; width:34px; height:34px; border-radius:50%; background:#f8c5d8; color:#742344; font-size:14px; font-weight:800; }
.user-chip b, .user-chip small { display:block; }
.user-chip b { font-size:13px; }
.user-chip small { margin-top:2px; color:#f2c4d3; font-size:11px; }
.page-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:20px; margin-bottom:28px; }
.page-heading h1 { margin:0; font-family:Georgia, serif; font-size:34px; font-weight:500; }
.page-heading p:not(.eyebrow) { margin:7px 0 0; color:var(--muted); font-size:14px; }
.heading-stats { display:flex; flex-direction:row; flex-wrap:nowrap; align-items:stretch; gap:0; }
.heading-stat { display:flex; flex-direction:column; align-items:flex-end; padding-left:28px; border-left:1px solid var(--line); }
.heading-stat + .heading-stat { margin-left:28px; }
.heading-stat strong { font-size:28px; }
.heading-stat span { color:var(--muted); font-size:12px; }
.toolbar { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:18px; }
.search-box { flex:1; max-width:620px; }
.buscador { display:flex; gap:8px; }
.buscador input { min-width:0; }
.toolbar-actions { display:flex; gap:8px; }
.table-card { overflow:hidden; }
.table-scroll { overflow-x:auto; }
table { width:100%; border-collapse:separate; border-spacing:0; background:var(--surface); }
#tablaUsuarios { min-width:1200px; }
th, td { padding:14px 12px; border-bottom:1px solid var(--line); text-align:left; font-size:12px; white-space:nowrap; }
th { background:#f8fafc; color:#61728a; font-size:10px; font-weight:800; letter-spacing:.07em; text-transform:uppercase; }
tbody tr:hover td { background:#f7fbff; }
tr.inactivo td { background:#fff4f4; color:#80545b; }
tr.inactivo:hover td { background:#ffeded; }
#tablaUsuarios .acciones { position:sticky; right:0; min-width:190px; white-space:normal; background:var(--surface); box-shadow:-7px 0 10px rgba(38,58,91,.09); z-index:2; }
#tablaUsuarios thead .acciones { background:#f8fafc; z-index:3; }
#tablaUsuarios tbody tr:hover .acciones { background:#f7fbff; }
#tablaUsuarios tbody tr.inactivo .acciones { background:#fff4f4; }
#tablaUsuarios tbody tr.inactivo:hover .acciones { background:#ffeded; }
#tablaUsuarios .acciones .btn { margin:2px 0; }
.table { width:100%; border-collapse:separate; border-spacing:0; background:var(--surface); overflow:hidden; }
.table th, .table td { padding:13px 14px; border:0; border-bottom:1px solid var(--line); text-align:left; font-size:13px; }
.table th { background:#f8fafc; color:#61728a; font-size:11px; font-weight:800; letter-spacing:.04em; text-transform:uppercase; }
.table tr:last-child td { border-bottom:0; }
.table-responsive { overflow-x:auto; border:1px solid var(--line); border-radius:9px; }
.alert { margin:20px 34px -10px; padding:12px 16px; border-radius:7px; font-size:13px; font-weight:600; }
.alert-success { background:#e3f5ee; color:#16755e; }
.alert-error { background:#fff0f2; color:#a82f42; }
.footer { padding:20px 34px 28px; text-align:center; color:#8794a8; font-size:12px; }

@media(max-width:800px){
  .login-page { display:block; }
  .login-brand { min-height:310px; padding:42px 28px; }
  .login-brand h1 { font-size:42px; }
  .login-logo { width:210px; margin-bottom:18px; }
  .login-panel { padding:28px 18px 60px; }
  .login-card { padding:30px 24px; }
  .login-footer { bottom:18px; }
  .topbar { align-items:flex-start; flex-direction:column; padding:18px 20px; }
  .topbar-account { width:100%; justify-content:space-between; }
  .container { padding:28px 18px 16px; }
  .form-heading h1 { font-size:30px; }
  .form-card { padding:30px 22px; }
  .modern-form { grid-template-columns:1fr; gap:17px; }
  .page-heading { align-items:flex-start; flex-direction:column; }
  .heading-stats { width:100%; justify-content:space-between; gap:10px; }
  .heading-stat, .heading-stat + .heading-stat { flex:1; align-items:center; margin-left:0; padding:0; border-left:0; text-align:center; }
  .toolbar { align-items:stretch; flex-direction:column; }
  .search-box { max-width:none; }
  .toolbar-actions { flex-wrap:wrap; }
  .alert { margin:16px 18px -8px; }
  .footer { padding-left:18px; padding-right:18px; }
  .form-row { flex-direction:column; }
}