:root{
  --navy:#0d1b2a;
  --navy-soft:#112338;
  --navy-deep:#08121f;
  --gold:#d4af37;
  --gold-soft:#e2c66f;
  --paper:#f5f1e8;
  --muted:rgba(245,241,232,.76);
  --line:rgba(212,175,55,.28);
  --white-line:rgba(255,255,255,.09);
  --success:#3c8b62;
  --danger:#a84b4b;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  min-height:100vh;
  background:var(--navy);
  color:var(--paper);
  font-family:"Montserrat",Arial,sans-serif;
  line-height:1.5;
}
a{color:inherit;text-decoration:none}
h1,h2,h3{
  margin-top:0;
  font-family:"Cinzel",serif;
  font-weight:500;
  letter-spacing:0;
}
.topbar{
  position:sticky;
  top:0;
  z-index:20;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  min-height:76px;
  padding:12px clamp(20px,4vw,56px);
  border-bottom:1px solid rgba(255,255,255,.06);
  background:rgba(8,18,31,.88);
  backdrop-filter:blur(16px);
}
.brand{display:inline-flex;align-items:center}
.brand img{
  display:block;
  width:clamp(200px,20vw,252px);
  max-width:100%;
  height:auto;
}
nav{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:24px;
  color:rgba(245,241,232,.84);
  font-size:13px;
  font-weight:600;
  text-transform:uppercase;
}
nav a:hover{color:var(--gold-soft)}
.container{
  width:min(1240px,calc(100% - 40px));
  min-height:calc(100vh - 132px);
  margin:0 auto;
  padding:26px 0 34px;
}
.page-heading{
  margin-bottom:18px;
}
.page-heading h1{
  margin-bottom:0;
  font-size:clamp(28px,2.6vw,36px);
}
.footer{
  display:grid;
  gap:3px;
  padding:14px clamp(20px,4vw,56px);
  border-top:1px solid rgba(255,255,255,.08);
  text-align:center;
}
.footer span{
  color:rgba(245,241,232,.52);
  font-size:11px;
  font-weight:600;
  letter-spacing:.22em;
  text-transform:uppercase;
}
.footer strong{
  color:var(--gold-soft);
  font-family:"Cinzel",serif;
  font-size:18px;
  font-weight:500;
}
.eyebrow{
  margin:0 0 10px;
  color:var(--gold-soft);
  font-size:12px;
  font-weight:700;
  text-transform:uppercase;
}
.button,button{
  display:inline-flex;
  min-height:42px;
  align-items:center;
  justify-content:center;
  border:1px solid transparent;
  border-radius:6px;
  background:linear-gradient(135deg,var(--gold),#f0ca64);
  color:#17202b;
  font:inherit;
  font-size:14px;
  font-weight:700;
  text-transform:uppercase;
  padding:0 22px;
  cursor:pointer;
}
.button.secondary{
  border-color:var(--gold);
  background:transparent;
  color:var(--paper);
}
.alert{
  margin-bottom:14px;
  padding:12px 14px;
  border:1px solid var(--line);
  border-radius:6px;
  background:rgba(13,27,42,.86);
}
.alert.success{background:rgba(60,139,98,.15)}
.alert.warning{background:rgba(212,175,55,.12)}
.alert.error{background:rgba(168,75,75,.18)}
form{
  display:grid;
  gap:12px;
}
label{
  display:grid;
  gap:8px;
  color:rgba(245,241,232,.82);
  font-size:13px;
}
input,select,textarea{
  width:100%;
  border:1px solid rgba(255,255,255,.16);
  border-radius:4px;
  background:rgba(255,255,255,.02);
  color:var(--paper);
  font:inherit;
}
input,select{height:44px;padding:0 14px}
textarea{min-height:96px;padding:12px 14px;resize:vertical}
.form-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
  padding:20px;
  border:1px solid var(--line);
  border-radius:6px;
  background:rgba(13,27,42,.86);
}
.premium-form{
  margin-top:14px;
}
.content-card{
  position:relative;
  overflow:hidden;
  margin-top:14px;
  border:1px solid var(--white-line);
  border-radius:6px;
  background:rgba(255,255,255,.02);
  padding:20px;
}
.content-card::after,
.toolbar-panel::after,
.dashboard-hero::after,
.client-hero::after{
  position:absolute;
  inset:0 auto 0 0;
  width:2px;
  background:linear-gradient(180deg,rgba(226,198,111,.9),rgba(226,198,111,0));
  content:"";
}
.intro-panel{
  margin-bottom:14px;
}
.intro-panel h2,
.section-header h2{
  margin-bottom:10px;
}
.intro-panel p:last-child{
  margin-bottom:0;
  max-width:680px;
  color:var(--muted);
}
.full{grid-column:1/-1}
.checkbox{display:flex;align-items:flex-start;gap:10px}
.checkbox input{width:auto;height:auto;margin-top:3px}
.actions{display:flex;align-items:center;flex-wrap:wrap;gap:10px}
.client-nav{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:0 0 14px;
  padding:0;
  color:var(--paper);
  font-size:12px;
  text-transform:none;
}
.client-nav a{
  display:inline-flex;
  min-height:34px;
  align-items:center;
  border:1px solid rgba(212,175,55,.24);
  border-radius:999px;
  color:var(--muted);
  padding:0 14px;
}
.client-nav a.is-active{
  border-color:var(--gold);
  background:rgba(212,175,55,.12);
  color:var(--gold-soft);
}
.link-button{
  min-height:0;
  border:0;
  background:none;
  color:var(--gold-soft);
  font:inherit;
  text-transform:none;
  padding:0;
}
.searchbar,.inline-form{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  margin-bottom:14px;
}
.toolbar-panel{
  position:relative;
  display:grid;
  gap:12px;
  margin-bottom:14px;
  padding:16px;
  border:1px solid var(--white-line);
  border-radius:6px;
  background:rgba(255,255,255,.02);
}
.toolbar-panel .searchbar{margin-bottom:0}
.toolbar-meta{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  color:var(--muted);
}
.quick-filters{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.filter-panel{
  display:grid;
  gap:10px;
  padding-top:14px;
  border-top:1px solid rgba(255,255,255,.08);
}
.filter-panel > span{
  color:var(--gold-soft);
  font-size:11px;
  font-weight:700;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.quick-filters a{
  display:inline-flex;
  min-height:32px;
  align-items:center;
  border:1px solid rgba(212,175,55,.24);
  border-radius:999px;
  color:var(--muted);
  font-size:12px;
  padding:0 12px;
}
.quick-filters a.is-active{
  border-color:var(--gold);
  color:var(--gold-soft);
  background:rgba(212,175,55,.12);
}
.searchbar input{flex:1}
.table-wrap{
  overflow:auto;
  border:1px solid var(--white-line);
  border-radius:6px;
}
.empty-table{
  color:var(--muted);
  text-align:center;
}
table{
  width:100%;
  border-collapse:collapse;
  background:rgba(255,255,255,.02);
}
.premium-table th{
  color:var(--gold-soft);
  font-size:12px;
  font-weight:700;
  text-transform:uppercase;
}
.premium-table tbody tr{
  transition:background 180ms ease;
}
.premium-table tbody tr:hover{
  background:rgba(255,255,255,.025);
}
.row-actions{
  gap:8px;
}
.row-actions a,
.row-actions .link-button,
.row-actions .danger-chip,
.row-actions .table-action{
  display:inline-flex;
  align-items:center;
  min-height:30px;
  border:1px solid rgba(212,175,55,.24);
  border-radius:999px;
  padding:0 11px;
  color:var(--gold-soft);
  font-size:12px;
}
.table-action{
  border:1px solid rgba(212,175,55,.24);
  border-radius:999px;
  background:transparent;
  color:var(--gold-soft);
  font-size:12px;
  font-weight:500;
  min-height:30px;
  padding:0 11px;
  text-transform:none;
}
.danger-action{
  border-color:rgba(168,75,75,.48) !important;
  background:rgba(168,75,75,.12) !important;
  color:#f0c7c7 !important;
}
.row-actions .danger-chip{
  border-color:rgba(168,75,75,.48);
  background:rgba(168,75,75,.12);
  color:#f0c7c7;
  text-transform:none;
}
.row-actions form{
  display:inline;
}
.danger-button{
  border-color:rgba(168,75,75,.55);
  background:rgba(168,75,75,.14);
  color:#f0c7c7;
}
th,td{
  padding:11px 12px;
  border-bottom:1px solid var(--white-line);
  text-align:left;
  vertical-align:top;
}
.detail-grid,.stats,.dashboard-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
}
.detail-grid article,.stats article,.dashboard-grid article,.timeline article,.report{
  position:relative;
  overflow:hidden;
  border:1px solid var(--white-line);
  border-radius:6px;
  background:rgba(255,255,255,.02);
  padding:18px;
}
.detail-grid article::after,.stats article::after,.dashboard-grid article::after,.timeline article::after,.report::after{
  position:absolute;
  inset:0 auto 0 0;
  width:2px;
  background:linear-gradient(180deg,rgba(226,198,111,.9),rgba(226,198,111,0));
  content:"";
}
.detail-grid article{display:grid;gap:8px}
.detail-grid strong,.stats span{color:var(--muted)}
.stats strong{
  display:block;
  margin-bottom:6px;
  color:var(--gold-soft);
  font-family:"Cinzel",serif;
  font-size:30px;
  font-weight:500;
}
.stats article small{
  display:block;
  margin-top:10px;
  color:rgba(245,241,232,.52);
  font-size:12px;
}
.dashboard-hero{
  position:relative;
  display:flex;
  align-items:end;
  justify-content:space-between;
  gap:18px;
  margin-bottom:14px;
  border:1px solid var(--white-line);
  border-radius:6px;
  background:
    linear-gradient(135deg,rgba(212,175,55,.12),transparent 40%),
    rgba(255,255,255,.02);
  padding:20px;
}
.dashboard-hero h2{
  margin-bottom:8px;
  font-size:clamp(24px,2.6vw,32px);
}
.dashboard-hero p:last-child{
  max-width:660px;
  margin-bottom:0;
  color:var(--muted);
}
.hero-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}
.panel-list h2{
  margin-bottom:14px;
  font-size:22px;
}
.panel-list p{
  margin:0;
  padding:10px 0;
  border-bottom:1px solid rgba(255,255,255,.06);
}
.panel-list p:last-child{border-bottom:0;padding-bottom:0}
.latest-list a{color:var(--paper)}
.latest-list span{color:var(--muted)}
.dashboard-grid{margin-top:14px}
.dashboard-filter-panel{
  display:flex;
  align-items:end;
  justify-content:space-between;
  gap:18px;
  margin-bottom:14px;
  border:1px solid var(--white-line);
  border-radius:6px;
  background:rgba(255,255,255,.02);
  padding:18px;
}
.dashboard-filter-panel h2{
  margin-bottom:0;
  font-size:22px;
}
.dashboard-filters{
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:10px;
}
.dashboard-filters a{
  display:grid;
  gap:2px;
  min-width:132px;
  border:1px solid rgba(212,175,55,.24);
  border-radius:999px;
  background:rgba(212,175,55,.05);
  padding:10px 14px;
}
.dashboard-filters strong{font-family:"Cinzel",serif;font-weight:500}
.dashboard-filters span{color:var(--muted);font-size:12px}
.dashboard-grid p{display:flex;justify-content:space-between;gap:12px}
.stack{margin-top:20px}
.timeline{display:grid;gap:14px}
.timeline span{display:block;color:var(--muted);font-size:.92rem}
.report{margin-top:14px}
.client-hero{
  position:relative;
  display:flex;
  align-items:end;
  justify-content:space-between;
  gap:18px;
  margin-bottom:14px;
  border:1px solid var(--white-line);
  border-radius:6px;
  background:
    linear-gradient(135deg,rgba(212,175,55,.12),transparent 40%),
    rgba(255,255,255,.02);
  padding:20px;
}
.client-hero h2{
  margin-bottom:8px;
  font-size:clamp(26px,2.8vw,34px);
}
.client-hero p:last-child{
  margin-bottom:0;
  color:var(--muted);
}
.client-highlights{
  display:grid;
  grid-template-columns:repeat(2,minmax(180px,1fr));
  gap:12px;
}
.client-highlights article{
  min-width:180px;
  border:1px solid rgba(255,255,255,.09);
  border-radius:6px;
  background:rgba(13,27,42,.54);
  padding:14px;
}
.client-highlights span{
  display:block;
  margin-bottom:8px;
  color:var(--muted);
  font-size:12px;
  text-transform:uppercase;
}
.client-highlights strong{
  color:var(--gold-soft);
  font-family:"Cinzel",serif;
  font-size:22px;
  font-weight:500;
}
.action-bar{
  margin-bottom:14px;
}
.section-header{
  margin-bottom:14px;
}
.empty-state{
  color:rgba(245,241,232,.58);
  font-style:italic;
}
.form-status{
  margin:0 0 14px;
  border:1px solid rgba(60,139,98,.45);
  border-radius:6px;
  background:rgba(60,139,98,.14);
  color:#d8f3e6;
  padding:11px 14px;
}
.compact-table{margin-top:12px}
.editable-row{
  display:grid;
  grid-template-columns:1.3fr .7fr .7fr auto;
  align-items:center;
  gap:10px;
}
.editable-row.patrimonio-row{
  grid-template-columns:.55fr 1.15fr .7fr auto;
}
.editable-row .row-actions{
  display:flex;
  flex-wrap:wrap;
}
.editable-row button{
  min-height:36px;
}
.report-section + .report-section{
  margin-top:22px;
}
.report-toolbar{
  display:flex;
  align-items:end;
  justify-content:space-between;
  gap:20px;
  margin-bottom:14px;
  border:1px solid var(--white-line);
  border-radius:6px;
  background:rgba(255,255,255,.02);
  padding:18px;
}
.report-toolbar h2{
  margin-bottom:6px;
  font-size:28px;
}
.report-toolbar p:last-child{
  margin-bottom:0;
  color:var(--muted);
}
.report-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}
.report-grid article{
  display:grid;
  gap:6px;
  border:1px solid var(--white-line);
  border-radius:6px;
  background:rgba(255,255,255,.02);
  padding:14px;
}
.report-grid span{
  color:var(--muted);
  font-size:12px;
  text-transform:uppercase;
}
.report-grid strong{
  font-weight:500;
  line-height:1.5;
}
.report-grid.text-heavy strong{
  white-space:pre-wrap;
}
.report-timeline{
  display:grid;
  gap:12px;
}
.report-timeline article{
  border:1px solid var(--white-line);
  border-radius:6px;
  background:rgba(255,255,255,.02);
  padding:14px;
}
.report-timeline span{
  display:block;
  color:var(--muted);
  font-size:12px;
  margin-top:3px;
}
.report-timeline p{
  margin-bottom:0;
}
.user-actions-cell{
  width:360px;
}
.user-edit-form{
  display:grid;
  grid-template-columns:1fr 1fr auto;
  align-items:center;
  gap:8px;
  margin-bottom:8px;
}
.user-edit-form select{
  min-width:0;
}
.user-edit-form button{
  min-height:40px;
  padding-inline:16px;
}
.user-delete-form{
  display:flex;
  justify-content:flex-start;
}
.compact-danger{
  min-height:34px;
  padding:0 14px;
  border-color:rgba(168,75,75,.55);
  background:rgba(168,75,75,.14);
  color:#f0c7c7;
  font-size:12px;
}
.compact-action{
  min-height:34px !important;
  padding:0 14px !important;
  font-size:12px !important;
}

.login-page .topbar{position:fixed;inset:0 0 auto 0}
.login-page .container{
  width:100%;
  min-height:100vh;
  padding:0;
}
.login-page .footer{display:none}
.login-hero{
  position:relative;
  min-height:100vh;
  display:flex;
  align-items:center;
  overflow:hidden;
  padding:140px clamp(20px,6vw,88px) 56px;
}
.login-hero-image,.login-hero-overlay{
  position:absolute;
  inset:0;
}
.login-hero-image{
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:center;
}
.login-hero-overlay{
  background:
    linear-gradient(90deg,rgba(8,18,31,.98) 0%,rgba(8,18,31,.92) 38%,rgba(8,18,31,.54) 66%,rgba(8,18,31,.78) 100%),
    linear-gradient(180deg,rgba(8,18,31,.2),rgba(8,18,31,.88));
}
.login-shell{
  position:relative;
  z-index:2;
  width:min(1240px,100%);
  margin:0 auto;
  display:grid;
  grid-template-columns:minmax(0,1fr) 420px;
  align-items:end;
  gap:48px;
}
.login-copy{max-width:620px}
.login-copy h1{
  max-width:620px;
  margin-bottom:22px;
  font-size:clamp(38px,5vw,60px);
  line-height:1.04;
}
.login-copy p:last-child{
  max-width:560px;
  color:rgba(245,241,232,.9);
  font-size:18px;
  line-height:1.7;
}
.auth-card{
  padding:26px;
  border:1px solid var(--line);
  border-radius:6px;
  background:rgba(8,18,31,.84);
  backdrop-filter:blur(12px);
}
.auth-card h2{
  margin-bottom:20px;
  font-size:34px;
}
.auth-card form{padding:0}

@media (max-width:960px){
  .topbar{
    min-height:auto;
    align-items:flex-start;
    flex-direction:column;
  }
  nav{gap:16px}
  .login-shell{grid-template-columns:1fr}
  .login-copy{max-width:680px}
  .auth-card{max-width:420px}
  .dashboard-hero,
  .client-hero,
  .report-toolbar,
  .dashboard-filter-panel{
    align-items:flex-start;
    flex-direction:column;
  }
  .quick-access{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}
@media (max-width:800px){
  .container{width:min(100% - 32px,1240px);padding-top:28px}
  .form-grid,.detail-grid,.stats,.dashboard-grid{grid-template-columns:1fr}
  .client-highlights{grid-template-columns:1fr;width:100%}
  .toolbar-meta{align-items:flex-start;flex-direction:column}
  .editable-row,
  .editable-row.patrimonio-row,
  .report-grid{
    grid-template-columns:1fr;
  }
  .dashboard-filters{
    width:100%;
    justify-content:flex-start;
  }
  .dashboard-filters a{
    min-width:calc(50% - 5px);
  }
  .user-actions-cell{
    width:auto;
  }
  .user-edit-form{
    grid-template-columns:1fr;
  }
}
@media (max-width:640px){
  .topbar{
    padding-inline:18px;
  }
  .brand{
    width:100%;
  }
  .brand img{
    width:min(205px,calc(100vw - 36px));
    max-width:100%;
  }
  .login-hero{padding:124px 18px 36px}
  .login-copy h1{font-size:34px}
  .login-copy p:last-child{font-size:16px}
  .button,button{width:100%}
}
@media print{
  .topbar,.footer,.actions{display:none}
  body{background:#fff;color:#111}
  .report{border:0;background:#fff}
}
