:root{
  --bg:#FCE8E8;
  --card:#FFFAFA;
  --text:#3E2A27;
  --muted:#6B4B45;
  --brand:#A84C4C;
  --brand-2:#8F4040;
  --border: rgba(62,42,39,.12);
  --shadow: 0 12px 30px rgba(0,0,0,.08);
  --shadow-soft: 0 8px 18px rgba(0,0,0,.06);
  --radius: 18px;

  --container: 1080px;
  --header-h: 76px;
}

*{margin:0;padding:0;box-sizing:border-box;}
html{scroll-behavior:smooth;}
body{
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
  overflow-x:hidden;
  min-height: 100vh;
}
a{color:inherit;text-decoration:none;}
img{max-width:100%;display:block;}

.container{
  width:min(var(--container), calc(100% - 40px));
  margin: 0 auto;
}

header{
  position: fixed;
  top:0; left:0;
  width:100%;
  height: var(--header-h);
  z-index: 1000;
  background: rgba(255,250,250,1);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
}
.header-inner{
  height: 100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 16px;
}

.brand{
  display:flex;
  align-items:center;
  gap: 12px;
  min-width: 220px;
}
.brand-logo{
  height: 54px;
  width: auto;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.08));
}
.brand-text{
  display:flex;
  flex-direction:column;
  line-height: 1.1;
  gap: 4px;
}
.brand-text strong{
  font-size: 0.98rem;
  letter-spacing: .2px;
}
.brand-text span{
  font-size: 0.84rem;
  color: var(--muted);
}

nav.desktop-nav{
  display:flex;
  gap: 8px;
  align-items:center;
}
.nav-link{
  font-size: 0.95rem;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text);
  transition: background .2s, color .2s;
  white-space: nowrap;
}
.nav-link:hover{
  background: rgba(168,76,76,.10);
  color: var(--brand-2);
}
.nav-link.is-active{
  background: rgba(168,76,76,.12);
  border: 1px solid rgba(168,76,76,.18);
  color: var(--brand-2);
}

.cta{
  display:flex;
  gap: 10px;
  align-items:center;
}
.user-pill{
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(168,76,76,.08);
  border: 1px solid rgba(168,76,76,.14);
  color: var(--brand-2);
  font-weight: 700;
  font-size: .92rem;
  max-width: 280px;
  overflow:hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn{
  border: 1px solid rgba(168,76,76,.22);
  background: #fff;
  color: var(--brand-2);
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 600;
  cursor:pointer;
  transition: transform .15s ease, background .2s, border .2s;
  white-space: nowrap;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
}
.btn:hover{transform: translateY(-1px);}
.btn.primary{
  background: var(--brand);
  color:#fff;
  border-color: var(--brand);
  box-shadow: 0 10px 22px rgba(168,76,76,.22);
}
.btn.primary:hover{background: var(--brand-2); border-color: var(--brand-2);}

main{
  padding-top: var(--header-h);
  min-height: calc(100vh - var(--header-h));
  display:flex;
  flex-direction:column;
}

.page{
  padding: 26px 0 10px;
}

.card{
  background: var(--card);
  border: 1px solid rgba(62,42,39,.10);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad{ padding: 22px 20px; }

.h1{
  font-size: clamp(1.35rem, 2.2vw, 1.9rem);
  line-height: 1.2;
  letter-spacing: -0.3px;
  margin-bottom: 8px;
  color: var(--brand-2);
}
.muted{ color: var(--muted); }

.grid-2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.grid-3{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.kpi{
  padding: 14px 14px;
  border-radius: 16px;
  border: 1px solid rgba(62,42,39,.10);
  background: rgba(255,255,255,.78);
  box-shadow: 0 10px 20px rgba(0,0,0,.05);
}
.kpi strong{ color: var(--brand-2); display:block; font-size: .95rem; }
.kpi .num{ font-size: 1.6rem; font-weight: 900; margin-top: 4px; }

.table{
  width:100%;
  border-collapse: collapse;
  overflow:hidden;
  border-radius: 14px;
  border: 1px solid rgba(62,42,39,.10);
}
.table th, .table td{
  padding: 12px 12px;
  border-bottom: 1px solid rgba(62,42,39,.10);
  text-align:left;
  vertical-align: top;
}
.table th{
  font-size: .92rem;
  color: var(--brand-2);
  background: rgba(168,76,76,.08);
}
.table tr:last-child td{ border-bottom: none; }

.badge{
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: .82rem;
  display:inline-flex;
  align-items:center;
  gap: 6px;
  border: 1px solid rgba(62,42,39,.10);
  background: rgba(255,255,255,.85);
  color: var(--muted);
}
.badge.ok{ background: rgba(46, 204, 113, .12); border-color: rgba(46, 204, 113, .18); color: #1e7f45; }
.badge.warn{ background: rgba(241, 196, 15, .14); border-color: rgba(241, 196, 15, .20); color: #7a5d00; }
.badge.bad{ background: rgba(231, 76, 60, .12); border-color: rgba(231, 76, 60, .18); color: #8e2b21; }

form{ display:flex; flex-direction:column; gap: 10px; }
label{ font-weight: 800; font-size: .92rem; }
input, select, textarea{
  padding: 12px 12px;
  border: 1px solid rgba(62,42,39,.18);
  border-radius: 12px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus{
  border-color: rgba(168,76,76,.55);
  box-shadow: 0 0 0 4px rgba(168,76,76,.12);
}
textarea{ resize: vertical; min-height: 110px; }

.row{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items:center;
}
.row > *{ flex: 1; min-width: 160px; }

hr.sep{
  border: none;
  height: 1px;
  background: rgba(62,42,39,.10);
  margin: 14px 0;
}

.alert{
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(62,42,39,.12);
  background: rgba(255,255,255,.78);
  color: var(--text);
}
.alert.ok{ border-color: rgba(46,204,113,.22); background: rgba(46,204,113,.10); }
.alert.err{ border-color: rgba(231,76,60,.22); background: rgba(231,76,60,.10); }

footer{
  padding: 18px 0 26px;
  color: var(--muted);
  text-align:center;
  font-size: 0.92rem;
}
footer a{
  color: var(--brand-2);
  font-weight: 800;
}
footer a:hover{ text-decoration: underline; }
.footer-sep{ margin: 0 8px; }

@media (max-width: 980px){
  .brand{ min-width: 0; }
  .brand-text{ display:none; }
  .grid-2{ grid-template-columns: 1fr; }
  .grid-3{ grid-template-columns: 1fr; }
  .user-pill{ display:none; }
}
@media (max-width: 780px){
  :root{ --header-h: 70px; }
  .container{ width: calc(100% - 32px); }
  .card-pad{ padding: 18px 16px; }
}
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  .btn{ transition: none; }
}

.mobile-drawer{ display:none; }

@media (max-width: 780px){
  nav.desktop-nav{ display:none; }
  .burger{ display:flex; }
}