:root{
  --blue: #94BD1F;          /* header azul (similar a tu referencia) */
  --blue-dark: #084f91;
  --sidebar-bg: #ffffff;
  --page-bg: #FFFFF5;

  --text: #3A5F7A;
  --muted: rgba(58,95,122,.72);
  --accent: #94BD1F;

  --border: 1px solid rgba(58,95,122,.16);
  --shadow: 0 14px 30px rgba(0,0,0,.10);
  --shadow-soft: 0 10px 20px rgba(0,0,0,.08);

  --radius: 14px;
  --font: "Red Hat Display", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;

  --topbar-h: 60px;
  --sidebar-w: 260px;
}

*{ box-sizing:border-box; }
html, body{ height:100%; }
body{
  margin:0;
  font-family: var(--font);
  background: var(--page-bg);
  color: var(--text);
}
a{ color: inherit; text-decoration:none; }

.layout{
  min-height: 100vh;
  background: var(--page-bg);
}

/* ===== TOPBAR ===== */
.topbar{
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--blue);
  z-index: 50;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 0 16px;
  box-shadow: 0 10px 18px rgba(0,0,0,.12);
}

.topbar__left{
  display:flex;
  align-items:center;
  gap: 14px;
}

.topbar__brand{
  display:flex;
  align-items:center;
  gap: 10px;
}
.topbar__logo{
  height: 24px;
  width: auto;
  display:block;
}

.topbar__burger{
  width: 42px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.10);
  cursor:pointer;
  display:grid;
  place-items:center;
}
.topbar__burger span{
  display:block;
  width: 18px;
  height: 2px;
  background: rgba(255,255,255,.92);
  margin: 2px 0;
  border-radius: 99px;
}

.topbar__right{
  display:flex;
  align-items:center;
  gap: 10px;
  color: #fff;
}

/* User dropdown */
.userMenu{
  position: relative;
  outline: none;
}
.userMenu__btn{
  display:flex;
  align-items:center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.10);
  cursor: pointer;
  font-weight: 800;
}
.userMenu__icon{ opacity:.95; }
.userMenu__name{ max-width: 240px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.userMenu__caret{ opacity:.9; }

.userMenu__dropdown{
  position:absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 200px;
  background:#fff;
  color: var(--text);
  border: var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow:hidden;
  display:none;
}
.userMenu:focus-within .userMenu__dropdown,
.userMenu:hover .userMenu__dropdown{
  display:block;
}
.userMenu__dropdown a{
  display:block;
  padding: 10px 12px;
  font-weight: 800;
  border-bottom: 1px solid rgba(58,95,122,.10);
}
.userMenu__dropdown a:last-child{ border-bottom:none; }
.userMenu__dropdown a:hover{
  background: rgba(148,189,31,.12);
}

/* ===== SIDEBAR ===== */
.sidebar{
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  width: var(--sidebar-w);
  height: calc(100vh - var(--topbar-h));
  background: var(--sidebar-bg);
  border-right: var(--border);
  z-index: 40;
  overflow:auto;
}

.sidebar__profile{
  padding: 14px;
  display:flex;
  gap: 10px;
  align-items:center;
  border-bottom: var(--border);
}
.sidebar__avatar{
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: var(--border);
  background: rgba(255,255,255,.7);
  display:grid;
  place-items:center;
  overflow:hidden;
}
.sidebar__avatar img{
  width: 34px;
  height: 34px;
  object-fit: contain;
}
.sidebar__profileName{
  font-weight: 900;
  line-height: 1.1;
}
.sidebar__status{
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  margin-top: 4px;
  display:flex;
  align-items:center;
  gap: 8px;
}
.sidebar__status .dot{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34,197,94,.16);
}

.nav{
  padding: 10px;
  display:flex;
  flex-direction:column;
  gap: 8px;
}

.nav__sep{
  height: 1px;
  background: rgba(58,95,122,.12);
  margin: 6px 4px;
}

.nav__link{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(58,95,122,.10);
  background: rgba(255,255,255,.65);
  font-weight: 700;
  color: rgba(58,95,122,.92);
  font-size: 1rem;
}
.nav__ico{
  width: 22px;
  text-align:center;
  opacity: .92;
}
.nav__link:hover{
  box-shadow: 0 10px 18px rgba(0,0,0,.06);
  transform: translateY(-1px);
}
.nav__link.active{
  background: rgba(11,99,182,.10);
  border-color: rgba(11,99,182,.35);
  color: #0b63b6;
}

/* ===== MAIN ===== */
.main{
  padding-top: var(--topbar-h);
  margin-left: var(--sidebar-w);
  min-height: 100vh;
}
.main__inner{
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 16px 0 26px;
}

/* Components */
.card{
  background: rgba(255,255,255,.78);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 16px;
}

.h1{
  margin: 0 0 6px;
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 900;
}
.muted{ color: var(--muted); }

.grid-2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 980px){
  .grid-2{ grid-template-columns: 1fr; }
}

.table{
  width:100%;
  border-collapse: collapse;
  overflow:hidden;
  border-radius: 14px;
  border: var(--border);
  background: rgba(255,255,255,.7);
}
.table th, .table td{
  padding: 10px 10px;
  border-bottom: var(--border);
  text-align:left;
  vertical-align: top;
}
.table th{
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .7px;
}
.badge{
  display:inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  border: var(--border);
  font-weight: 900;
  font-size: 12px;
  background: rgba(255,255,255,.9);
}

.toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.input, select, textarea{
  width:100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: var(--border);
  background: #fff;
  outline: none;
  font-family: var(--font);
}
textarea{ min-height: 110px; resize: vertical; }

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: var(--border);
  background: #fff;
  font-weight: 900;
  cursor:pointer;
}
.btn.primary{
  background: var(--accent);
  border-color: rgba(148,189,31,.55);
}
.btn.danger{
  background: #ffefef;
  border-color: rgba(220,38,38,.35);
  color: #b91c1c;
}

.flash{
  margin: 14px 0;
  padding: 12px;
  border-radius: 14px;
  border: var(--border);
  background: rgba(255,255,255,.85);
  font-weight: 900;
}
.flash.ok{ border-color: rgba(148,189,31,.55); }
.flash.err{ border-color: rgba(220,38,38,.45); background: rgba(255,239,239,.75); color:#8b1b1b; }

/* ===== Mobile sidebar toggle ===== */
@media (max-width: 980px){
  .main{ margin-left: 0; }
  .sidebar{
    transform: translateX(-105%);
    transition: transform .18s ease;
    box-shadow: var(--shadow);
  }
  body.sidebar-open .sidebar{
    transform: translateX(0);
  }
  body.sidebar-open::before{
    content:"";
    position: fixed;
    inset: var(--topbar-h) 0 0 0;
    background: rgba(0,0,0,.25);
    z-index: 35;
  }
}

/* ===== NAV GROUP (Contacto > Tickets/Temas) ===== */
.nav__group{
  border-radius: 12px;
  border: 1px solid rgba(58,95,122,.10);
  background: rgba(255,255,255,.55);
  overflow: hidden;
}

.nav__groupBtn{
  width: 100%;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-weight: 700;
  color: rgba(58,95,122,.92);
  font-family: var(--font);
  font-size: 1rem;
}

.nav__groupBtn:hover{
  background: rgba(0,0,0,.03);
}

.nav__chev{
  opacity: .85;
  transition: transform .16s ease;
}

.nav__sub{
  display:none;
  padding: 6px 8px 10px;
  border-top: 1px solid rgba(58,95,122,.10);
  background: rgba(255,255,255,.75);
}

.nav__group.open .nav__sub{ display:block; }
.nav__group.open .nav__chev{ transform: rotate(180deg); }

.nav__sublink{
  display:block;
  padding: 9px 10px;
  border-radius: 10px;
  font-weight: 700;
  color: rgba(58,95,122,.88);
  border: 1px solid rgba(58,95,122,.08);
  background: rgba(255,255,255,.80);
  margin-top: 6px;
}
.nav__sublink:hover{
  box-shadow: 0 10px 18px rgba(0,0,0,.06);
  transform: translateY(-1px);
}

.nav__sublink.active{
  background: rgba(11,99,182,.10);
  border-color: rgba(11,99,182,.35);
  color: #0b63b6;
}