:root{
  --panel-navy:#16284a;
  --panel-navy-2:#0f2140;
  --panel-gold:#c49b3d;
  --panel-gold-soft:#ead8aa;
  --panel-text:#1f2430;
  --panel-muted:#7f8797;
  --panel-line:rgba(255,255,255,.10);
  --panel-card:#ffffff;
  --panel-bg:#f6f3ef;
  --panel-shadow:0 10px 30px rgba(16,27,56,.10);
  --panel-radius:24px;
}

*{box-sizing:border-box}

body{
  margin:0;
  background:var(--panel-bg);
  color:var(--panel-text);
  font-family:'DM Sans',sans-serif;
}

.panel-topbar{
  height:88px;
  background:#fff;
  border-bottom:1px solid rgba(0,0,0,.06);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 30px;
  position:sticky;
  top:0;
  z-index:30;
  width:100%;
  max-width:100%;
  overflow-x:clip;
}

.panel-menu-toggle{
  display:none;
  align-items:center;
  gap:10px;
  min-height:42px;
  padding:0 16px;
  border:1px solid rgba(0,0,0,.08);
  border-radius:999px;
  background:#fff;
  color:#1d2430;
  font-weight:700;
  cursor:pointer;
}

.panel-menu-toggle__icon{
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:4px;
}

.panel-menu-toggle__icon span{
  display:block;
  width:16px;
  height:2px;
  border-radius:999px;
  background:#1d2430;
}

.topbar-brand{
  display:flex;
  align-items:center;
  gap:12px;
  text-decoration:none;
}

.topbar-brand__mark{
  width:52px;
  height:52px;
  flex:0 0 52px;
  display:grid;
  place-items:center;
  border-radius:999px;
  background:radial-gradient(circle at 32% 28%, rgba(255,255,255,.98), rgba(255,249,239,.94) 58%, rgba(239,223,195,.9) 100%);
  border:1px solid rgba(233,197,129,.38);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.72), 0 10px 18px rgba(0,0,0,.16);
}

.topbar-brand__image{
  width:48px;
  height:48px;
  object-fit:contain;
  flex:none;
  display:block;
}

.topbar-brand__wording{
  display:flex;
  flex-direction:column;
  gap:4px;
}

.topbar-brand__name{
  display:flex;
  align-items:baseline;
  gap:0;
  font-family:var(--font-display);
  font-size:30px;
  line-height:.9;
  font-weight:600;
  letter-spacing:-.035em;
  -webkit-font-smoothing:antialiased;
  text-rendering:geometricPrecision;
}

.topbar-brand__name-main{
  color:#fffdf9;
}

.topbar-brand__name-accent{
  color:#d0a355;
}

.topbar-brand__tag{
  color:rgba(255,255,255,.86);
  font-size:9px;
  font-weight:600;
  letter-spacing:.18em;
  text-transform:uppercase;
}

.panel-topbar .topbar-brand__name-main{
  color:var(--panel-navy);
}

.panel-topbar .topbar-brand__tag{
  color:rgba(31,36,48,.7);
}

.topbar-right{
  display:flex;
  align-items:center;
  gap:16px;
}

.badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:9px 14px;
  border-radius:999px;
  font-size:14px;
  font-weight:600;
  line-height:1;
}

.badge-gold{
  background:#f1e0b1;
  color:#8a6820;
}

.badge-navy{
  background:#dbe6ff;
  color:#234a91;
}

.user-chip{
  display:flex;
  align-items:center;
  gap:12px;
  color:#1d2430;
  font-weight:600;
  min-width:0;
}

.user-chip__text{
  display:flex;
  flex-direction:column;
  min-width:0;
  line-height:1.15;
}

.user-chip__name{
  color:#1d2430;
  font-size:15px;
  font-weight:700;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.user-chip__email{
  color:#6b7280;
  font-size:12px;
  font-weight:500;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.account-menu{
  position:relative;
  min-width:0;
}

.account-chip{
  appearance:none;
  -webkit-appearance:none;
  display:flex;
  align-items:center;
  gap:12px;
  min-height:48px;
  padding:8px 16px;
  border:1px solid rgba(31,41,68,.12);
  border-radius:999px;
  background:rgba(255,255,255,.94);
  box-shadow:0 8px 20px rgba(31,41,68,.08);
  min-width:0;
  cursor:pointer;
  list-style:none;
}

.account-chip::-webkit-details-marker{
  display:none;
}

.account-chip__text{
  display:flex;
  flex-direction:column;
  min-width:0;
}

.account-chip__label{
  color:#6b7280;
  font-size:10px;
  font-weight:700;
  letter-spacing:.08em;
  text-transform:uppercase;
  line-height:1.1;
}

.account-chip__value{
  color:#1d2430;
  font-size:13px;
  font-weight:700;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  line-height:1.2;
}

.account-menu__chevron{
  width:9px;
  height:9px;
  border-right:2px solid #5c6474;
  border-bottom:2px solid #5c6474;
  transform:rotate(45deg) translateY(-1px);
  flex:none;
  transition:transform .18s ease;
}

.account-menu[open] .account-menu__chevron{
  transform:rotate(-135deg) translateX(-1px);
}

.account-menu__body{
  position:absolute;
  top:calc(100% + 10px);
  right:0;
  width:220px;
  display:flex;
  flex-direction:column;
  gap:8px;
  padding:10px;
  border:1px solid rgba(31,41,68,.12);
  border-radius:18px;
  background:#fff;
  box-shadow:0 18px 40px rgba(31,41,68,.16);
  z-index:50;
}

.account-menu__action{
  appearance:none;
  -webkit-appearance:none;
  display:flex;
  align-items:center;
  width:100%;
  min-height:42px;
  padding:0 14px;
  border:1px solid rgba(31,41,68,.10);
  border-radius:12px;
  box-sizing:border-box;
  background:#fff;
  color:#1d2430;
  font:inherit;
  font-size:14px;
  font-weight:700;
  text-align:left;
  text-decoration:none;
  cursor:pointer;
  transition:background .18s ease, border-color .18s ease, transform .18s ease;
}

.account-menu__action:hover{
  background:#f8fafc;
  border-color:rgba(31,41,68,.18);
  transform:translateY(-1px);
}

.user-avatar{
  width:48px;
  height:48px;
  border-radius:50%;
  overflow:hidden;
  background:#f0f0f0;
  flex:none;
}

.user-avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.app-layout{
  display:flex;
  min-height:calc(100vh - 88px);
  width:100%;
  max-width:100%;
  overflow-x:clip;
}

.panel-nav-overlay{
  display:none;
}

.sidebar{
  width:302px;
  background:linear-gradient(180deg,var(--panel-navy) 0%, var(--panel-navy-2) 100%);
  color:#fff;
  padding:18px 16px 22px;
  flex:none;
  box-shadow:inset -1px 0 0 rgba(255,255,255,.06);
}

.sidebar-profile-card{
  background:linear-gradient(180deg,#18305b 0%, #112446 100%);
  border:1px solid rgba(255,255,255,.08);
  border-radius:24px;
  padding:22px 18px 18px;
  text-align:center;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.04);
  margin-bottom:22px;
}

.sidebar-profile-card__eyebrow{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:28px;
  padding:0 12px;
  margin-bottom:14px;
  border-radius:999px;
  background:rgba(234,216,170,.14);
  color:var(--panel-gold-soft);
  font-size:11px;
  font-weight:700;
  letter-spacing:.14em;
  text-transform:uppercase;
}

.sidebar-profile-card__photo-ring{
  width:112px;
  height:112px;
  border-radius:50%;
  margin:0 auto 16px;
  padding:6px;
  background:linear-gradient(180deg,#b8913d 0%, #8b6a22 100%);
  box-shadow:0 10px 24px rgba(0,0,0,.20);
}

.sidebar-profile-card__photo{
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;
  border-radius:50%;
  border:4px solid rgba(255,255,255,.92);
  background:#e9e9e9;
}

.sidebar-profile-card__content{
  display:flex;
  flex-direction:column;
  gap:4px;
}

.sidebar-profile-card__name{
  display:block;
  color:#fff;
  font-size:18px;
  line-height:1.25;
  font-weight:700;
}

.sidebar-profile-card__email,
.sidebar-profile-card__meta{
  display:block;
  color:rgba(255,255,255,.78);
  font-size:13px;
  font-weight:500;
  line-height:1.35;
}

.sb-section{
  display:flex;
  flex-direction:column;
  gap:6px;
  margin-bottom:10px;
}

.sb-label{
  display:block;
  padding:10px 12px 6px;
  color:rgba(255,255,255,.62);
  font-size:12px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.12em;
}

.sb-section a{
  display:flex;
  align-items:center;
  justify-content:space-between;
  min-height:50px;
  padding:0 16px;
  border-radius:16px;
  color:rgba(255,255,255,.88);
  text-decoration:none;
  font-size:16px;
  font-weight:600;
  transition:.18s ease;
}

.sb-link__main{
  display:inline-flex;
  align-items:center;
  gap:12px;
  min-width:0;
}

.sb-link__icon{
  width:28px;
  height:28px;
  border-radius:10px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:rgba(255,255,255,.08);
  color:rgba(255,255,255,.86);
  font-size:14px;
  line-height:1;
  flex-shrink:0;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.05);
  transition:background .18s ease, color .18s ease, transform .18s ease;
}

.sb-section a:hover{
  background:rgba(255,255,255,.07);
  color:#fff;
  transform:translateX(2px);
}

.sb-section a:hover .sb-link__icon{
  background:rgba(255,255,255,.14);
  color:#fff;
  transform:scale(1.04);
}

.sb-section a.active{
  background:linear-gradient(180deg,#c9a343 0%, #b98f2f 100%);
  color:#fff;
  box-shadow:0 12px 24px rgba(0,0,0,.18);
}

.sb-section a.active .sb-link__icon{
  background:rgba(255,255,255,.18);
  color:#fff;
}

.sb-divider{
  height:1px;
  background:var(--panel-line);
  margin:18px 12px;
}

.main-content{
  flex:1;
  padding:34px 38px 42px;
  min-width:0;
  width:100%;
  max-width:100%;
}

.page-header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:20px;
  margin-bottom:26px;
}

.page-header h1{
  margin:0 0 8px;
  font-family:'Cormorant Garamond',serif;
  font-size:64px;
  font-weight:500;
  line-height:1;
  color:#26221f;
}

.page-header .sub{
  margin:0;
  color:#514d49;
  font-size:18px;
}

.stats-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:20px;
  margin-bottom:28px;
}

.stat-card{
  background:#fff;
  border-radius:24px;
  padding:28px 24px;
  box-shadow:var(--panel-shadow);
  min-height:132px;
  display:flex;
  align-items:center;
}

.stat-data strong{
  display:block;
  font-size:28px;
  line-height:1;
  margin-bottom:10px;
  color:#111827;
}

.stat-data span{
  display:block;
  color:#5e6675;
  font-size:14px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.04em;
}

.card{
  background:#fff;
  border-radius:28px;
  box-shadow:var(--panel-shadow);
  overflow:hidden;
}

.card-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:22px 24px;
  border-bottom:1px solid rgba(0,0,0,.06);
}

.card-header h2{
  margin:0;
  font-size:24px;
  font-weight:700;
  color:#1f2430;
}

.empty-box{
  padding:28px 24px;
}

.empty-box h3{
  margin:0 0 8px;
}

.empty-box p{
  margin:0 0 16px;
  color:#6b7280;
}

.alert{
  padding:14px 16px;
  border-radius:16px;
  font-weight:600;
}

.alert-success{
  background:#e7f7eb;
  color:#1d6b34;
}

.alert-error{
  background:#fdeceb;
  color:#aa2e25;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:46px;
  padding:0 22px;
  border-radius:999px;
  border:none;
  text-decoration:none;
  font-weight:700;
  transition:.18s ease;
}

.btn-sm{
  min-height:38px;
  padding:0 16px;
  font-size:14px;
}

.btn-primary{
  background:linear-gradient(180deg,#c9a343 0%, #b98f2f 100%);
  color:#fff;
  box-shadow:0 10px 24px rgba(185,143,47,.28);
}

.btn-primary:hover{
  transform:translateY(-1px);
}

.btn-navy{
  background:linear-gradient(180deg,#20355f 0%, #16284a 100%);
  color:#fff;
  box-shadow:0 10px 24px rgba(22,40,74,.25);
}

.btn-navy:hover{
  transform:translateY(-1px);
}

.btn-outline{
  background:#fff;
  color:#1d2430;
  border:1px solid rgba(0,0,0,.10);
}

@media (max-width: 1180px){
  .stats-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .page-header{
    flex-direction:column;
    align-items:flex-start;
  }
}

@media (max-width: 900px){
  .panel-menu-toggle{
    display:inline-flex;
  }

  .panel-nav-overlay{
    position:fixed;
    inset:88px 0 0;
    display:block !important;
    background:rgba(8,15,29,.46);
    backdrop-filter:blur(3px);
    -webkit-backdrop-filter:blur(3px);
    opacity:0;
    pointer-events:none;
    transition:opacity .2s ease;
    z-index:39;
  }

  .app-layout{
    flex-direction:column;
    min-height:auto;
  }

  .sidebar{
    display:block;
    position:fixed;
    top:88px;
    left:0;
    bottom:0;
    width:min(360px, calc(100vw - 18px));
    max-width:100%;
    transform:translateX(calc(-100% - 20px));
    transition:transform .22s ease;
    padding:18px 14px 28px;
    overflow-y:auto;
    overscroll-behavior:contain;
    box-shadow:0 24px 56px rgba(6,15,31,.34);
    border-top:1px solid rgba(255,255,255,.08);
    border-top-right-radius:24px;
    visibility:hidden;
    z-index:40;
  }

  body.panel-nav-open{
    overflow:hidden;
  }

  body.panel-nav-open .panel-nav-overlay{
    opacity:1;
    pointer-events:auto;
  }

  body.panel-nav-open .sidebar{
    transform:translateX(0);
    visibility:visible;
    animation:panelSidebarReveal .22s ease;
  }

  .main-content{
    padding:24px 18px 28px;
  }

  .page-header h1{
    font-size:46px;
  }
}

@media (max-width: 640px){
  .panel-nav-overlay{
    inset:76px 0 0;
  }

  .panel-topbar{
    padding:10px 16px 12px;
    height:auto;
    min-height:76px;
    display:grid;
    grid-template-columns:minmax(0, 1fr) auto;
    align-items:center;
    gap:10px 12px;
    overflow:hidden;
  }

  .topbar-brand{
    min-width:0;
  }

  .topbar-brand__mark{
    width:44px;
    height:44px;
    flex-basis:44px;
  }

  .topbar-brand__image{
    width:40px;
    height:40px;
  }

  .topbar-brand__wording{
    gap:3px;
  }

  .topbar-brand__name{
    font-size:22px;
  }

  .topbar-brand__tag{
    font-size:7px;
  }

  .panel-menu-toggle{
    min-height:38px;
    padding:0 14px;
    justify-self:end;
  }

  .topbar-right{
    width:100%;
    grid-column:1 / -1;
    display:grid;
    grid-template-columns:minmax(0, 1fr) auto;
    align-items:start;
    gap:10px;
    padding-top:4px;
    min-width:0;
  }

  .topbar-right > .btn,
  .topbar-right > .badge,
  .topbar-right > .account-menu{
    grid-column:1 / -1;
    width:100%;
  }

  .panel-lang-switcher{
    grid-column:1;
    min-width:0;
    max-width:100%;
    width:fit-content;
    justify-self:start;
    flex-wrap:wrap;
  }

  .badge,
  .btn-sm{
    font-size:13px;
  }

  .badge{
    padding:8px 12px;
  }

  .user-avatar{
    width:42px;
    height:42px;
  }

  .user-chip{
    min-width:0;
    max-width:100%;
    gap:10px;
    grid-column:2;
    justify-self:end;
  }

  .user-chip__text{
    max-width:120px;
  }

  .user-chip__name{
    font-size:14px;
  }

  .account-chip{
    border-radius:18px;
    padding:10px 14px;
  }

  .account-menu__body{
    position:static;
    width:100%;
    margin-top:8px;
    box-shadow:none;
  }

  .account-chip__value{
    font-size:12px;
  }

  .main-content{
    padding:20px 14px 24px;
  }

  .stats-grid{
    grid-template-columns:1fr;
  }

  .sidebar{
    top:76px;
    padding:16px 14px 18px;
    width:min(100vw - 12px, 360px);
    border-top-right-radius:22px;
  }

  .sidebar-profile-card{
    margin-bottom:18px;
    padding:18px 16px 16px;
    border-radius:26px;
    background:
      radial-gradient(circle at top, rgba(201,163,67,.22), transparent 34%),
      linear-gradient(180deg,#18305b 0%, #102345 100%);
  }

  .sidebar-profile-card__eyebrow{
    margin-bottom:12px;
    min-height:26px;
    padding:0 10px;
    font-size:10px;
  }

  .sidebar-profile-card__photo-ring{
    width:92px;
    height:92px;
    margin-bottom:12px;
    padding:5px;
  }

  .sidebar-profile-card__photo{
    border-width:3px;
  }

  .sidebar-profile-card__name{
    font-size:16px;
  }

  .sidebar-profile-card__meta{
    font-size:12px;
    letter-spacing:.02em;
  }

  .sb-label{
    padding:8px 14px 4px;
    font-size:11px;
    letter-spacing:.16em;
    color:rgba(234,216,170,.72);
  }

  .sb-section{
    gap:8px;
    margin-bottom:14px;
  }

  .sb-section a{
    min-height:54px;
    padding:0 18px;
    border-radius:18px;
    background:rgba(255,255,255,.02);
    border:1px solid rgba(255,255,255,.04);
    font-size:15px;
    font-weight:700;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.02);
  }

  .sb-link__main{
    gap:14px;
  }

  .sb-link__icon{
    width:30px;
    height:30px;
    border-radius:11px;
    font-size:15px;
    background:rgba(255,255,255,.09);
  }

  .sb-section a::after{
    content:"";
    width:7px;
    height:7px;
    border-right:2px solid currentColor;
    border-top:2px solid currentColor;
    transform:rotate(45deg);
    opacity:.32;
    transition:opacity .18s ease, transform .18s ease;
  }

  .sb-section a:hover::after,
  .sb-section a.active::after{
    opacity:.9;
    transform:translateX(2px) rotate(45deg);
  }

  .sb-section a.active{
    box-shadow:
      0 14px 28px rgba(0,0,0,.18),
      inset 0 1px 0 rgba(255,255,255,.18);
  }

  .sb-divider{
    margin:10px 14px 16px;
    background:linear-gradient(90deg, rgba(255,255,255,.02), rgba(234,216,170,.35), rgba(255,255,255,.02));
  }
}

@keyframes panelSidebarReveal{
  from{
    opacity:0;
    transform:translateY(-10px);
  }
  to{
    opacity:1;
    transform:translateY(0);
  }
}
