
:root{
  --bg:#0b0f16;
  --panel:#101827;
  --text:#e7ecf4;
  --muted:#a6b0c3;
  --line:rgba(255,255,255,.08);
  --accent:#7c5cff;
  --good:#2bd576;
  --warn:#ffcc66;
  --bad:#ff5c7a;
  --radius:14px;
  --max:1040px;
}

*{box-sizing:border-box}

html,body{
  height:100%;
  min-height:100%;
  background:var(--bg);
}

body{
  margin:0;
  font:14px/1.45 -apple-system,BlinkMacSystemFont,Segoe UI,Inter,Roboto,Helvetica,Arial,sans-serif;
  color:var(--text);
  background:var(--bg);
}

/* Vintraq background glow (fix for gradient cutoff) */
body::before{
  content:"";
  position:fixed;
  inset:-20%;
  z-index:-1;

  background:
    radial-gradient(900px 600px at 15% 0%, rgba(124,92,255,.30), transparent 60%),
    radial-gradient(700px 500px at 85% 10%, rgba(255,92,122,.22), transparent 55%),
    radial-gradient(600px 400px at 50% 100%, rgba(124,92,255,.12), transparent 60%);

  filter:blur(60px);
  opacity:.9;
}

a{color:inherit; text-decoration:none}
a:hover{text-decoration:underline}

.container{max-width:var(--max); margin:0 auto; padding:18px 14px}

.card{
  background:linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:18px;
}

.header{
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom:18px;
}

.brand{
  display:flex; gap:10px; align-items:center;
}

.logo{
  width:28px; 
  height:28px;
  border-radius:8px;
  background:url("/logo.png") center/contain no-repeat;
}

.brand h1{font-size:16px; margin:0}
.brand p{margin:0; color:var(--muted); font-size:12px}

.nav{
  display:flex; gap:10px; flex-wrap:wrap;
}

.pill{
  display:inline-flex; align-items:center; gap:8px;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.02);
  color:var(--muted);
}

.pill.active{
  color:var(--text);
  border-color:rgba(124,92,255,.45);
  background:rgba(124,92,255,.12)
}

.grid{display:grid; grid-template-columns:1fr; gap:12px}

@media(min-width:820px){
  .grid.cols2{grid-template-columns:1fr 1fr}
}

label{
  display:block;
  color:var(--muted);
  font-size:12px;
  margin:10px 0 6px
}

input,select,textarea{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.02);
  color:var(--text);
  outline:none;
}

input:focus,textarea:focus{
  border-color:rgba(124,92,255,.55);
  box-shadow:0 0 0 3px rgba(124,92,255,.14)
}

.btnrow{display:flex; gap:10px; flex-wrap:wrap; margin-top:14px}

button{
  appearance:none;
  border:1px solid var(--line);
  background:rgba(255,255,255,.03);
  color:var(--text);
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
}

button.primary{
  border-color:rgba(124,92,255,.55);
  background:rgba(124,92,255,.18)
}

button.danger{
  border-color:rgba(255,92,122,.55);
  background:rgba(255,92,122,.12)
}

button:disabled{
  opacity:.6;
  cursor:not-allowed
}

.msg{margin-top:10px; color:var(--muted)}
.msg.good{color:var(--good)}
.msg.bad{color:var(--bad)}
.msg.warn{color:var(--warn)}

.table{
  width:100%;
  border-collapse:collapse;
  overflow:hidden;
}

.table th,.table td{
  padding:10px 10px;
  border-bottom:1px solid var(--line);
  vertical-align:top
}

.table th{
  color:var(--muted);
  font-weight:600;
  text-align:left;
  font-size:12px
}

.table td{font-size:13px}

.footer{
  margin-top:26px;
  color:var(--muted);
  font-size:12px;
  display:flex;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap
}

.stats-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
}

@media(min-width:820px){
  .stats-grid{
    grid-template-columns:repeat(4,1fr);
  }
}

.stat-card{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.stat-card strong{
  font-size:24px;
  line-height:1.1;
}

.stat-label{
  color:var(--muted);
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.04em;
}

.stack-list{
  display:grid;
  gap:8px;
}

.stack-item{
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:rgba(255,255,255,.02);
}

/* iPhone / Safari fix for date fields */
@media (max-width: 680px) {
  .grid,
  .grid.cols2,
  .card,
  .btnrow {
    min-width: 0;
  }

  input,
  select,
  textarea {
    min-width: 0;
    max-width: 100%;
  }

  input[type="date"] {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 44px;
    padding: 0 12px;
    font-size: 16px;
    line-height: 44px;
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    overflow: hidden;
  }

  input[type="date"]::-webkit-date-and-time-value {
    text-align: left;
    min-height: 44px;
  }

  input[type="date"]::-webkit-datetime-edit {
    padding: 0;
    white-space: nowrap;
  }

  input[type="date"]::-webkit-calendar-picker-indicator {
    margin: 0;
    padding: 0;
    opacity: .85;
  }
}
.grid.cols3{grid-template-columns:1fr}
@media(min-width:980px){
  .grid.cols3{grid-template-columns:1fr 1fr 1fr}
}
.full{grid-column:1 / -1}
.muted{color:var(--muted)}
.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:5px 9px;
  border-radius:999px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.03);
  color:var(--text);
  font-size:12px;
}
.badge-good{
  border-color:rgba(43,213,118,.35);
  background:rgba(43,213,118,.10);
  color:var(--good);
}
.badge-warn{
  border-color:rgba(255,204,102,.35);
  background:rgba(255,204,102,.10);
  color:var(--warn);
}
.badge-bad{
  border-color:rgba(255,92,122,.35);
  background:rgba(255,92,122,.10);
  color:var(--bad);
}
.file-input{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px dashed var(--line);
  background:rgba(255,255,255,.02);
  color:var(--muted);
}


.permission-list{
  display:grid;
  grid-template-columns:1fr;
  gap:8px;
}
@media(min-width:980px){
  .permission-list{grid-template-columns:1fr 1fr;}
}
.permission-item{
  display:flex;
  align-items:flex-start;
  gap:10px;
  margin:0;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:rgba(255,255,255,.02);
}
.permission-item input{
  width:auto;
  margin-top:2px;
}
.permission-item span{
  display:flex;
  flex-direction:column;
  gap:2px;
}
.permission-item small{
  color:var(--muted);
  font-size:12px;
}


/* =====================================================
   Navigation v2: hamburger + submenu
   ===================================================== */
.header{
  position:relative;
}
.brand{
  min-width:0;
}
.brand-main{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}
.brand-meta{
  min-width:0;
}

.nav-shell{
  display:flex;
  align-items:center;
  gap:10px;
  margin-left:auto;
}

.nav-toggle{
  display:none;
  align-items:center;
  justify-content:center;
  width:42px;
  height:42px;
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.03);
  color:var(--text);
  cursor:pointer;
  flex:0 0 auto;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after{
  display:block;
  width:18px;
  height:2px;
  background:currentColor;
  border-radius:999px;
  position:relative;
  content:"";
}
.nav-toggle span::before{position:absolute; top:-6px; left:0;}
.nav-toggle span::after{position:absolute; top:6px; left:0;}

.nav-desktop{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.nav-group{
  position:relative;
}
.nav-group > .pill{
  cursor:pointer;
}
.nav-submenu{
  display:none;
  position:absolute;
  top:calc(100% + 8px);
  right:0;
  min-width:220px;
  padding:8px;
  border-radius:14px;
  border:1px solid var(--line);
  background:rgba(16,24,39,.98);
  box-shadow:0 14px 40px rgba(0,0,0,.28);
  z-index:40;
}
.nav-group:hover .nav-submenu,
.nav-group:focus-within .nav-submenu{
  display:grid;
  gap:8px;
}
.nav-submenu .pill{
  width:100%;
  justify-content:flex-start;
}
.nav-drawer{
  display:none;
}
.nav-backdrop{
  display:none;
}

@media (max-width: 920px) {
  .brand{
    width:100%;
    justify-content:space-between;
  }

  .nav-shell{
    margin-left:0;
  }

  .nav-toggle{
    display:inline-flex;
  }

  .nav-desktop{
    display:none;
  }

  .nav-backdrop{
    display:none;
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.4);
    z-index:70;
  }

  .nav-drawer{
    display:block;
    position:fixed;
    top:0;
    right:0;
    height:100vh;
    width:min(360px, 88vw);
    padding:18px 14px 22px;
    background:rgba(11,15,22,.98);
    border-left:1px solid var(--line);
    box-shadow:-12px 0 30px rgba(0,0,0,.25);
    transform:translateX(105%);
    transition:transform .22s ease;
    z-index:80;
    overflow-y:auto;
  }

  body.nav-open .nav-backdrop{
    display:block;
  }

  body.nav-open .nav-drawer{
    transform:translateX(0);
  }

  .nav-drawer-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    margin-bottom:14px;
  }

  .nav-close{
    width:40px;
    height:40px;
    border-radius:12px;
    border:1px solid var(--line);
    background:rgba(255,255,255,.03);
    color:var(--text);
    cursor:pointer;
  }

  .nav-drawer-group{
    display:grid;
    gap:8px;
    margin-bottom:14px;
  }

  .nav-group-label{
    color:var(--muted);
    font-size:12px;
    text-transform:uppercase;
    letter-spacing:.05em;
    padding:2px 4px;
  }

  .nav-drawer .pill{
    width:100%;
    justify-content:flex-start;
  }
}


.muted{color:var(--muted)}
.card-head-row{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;flex-wrap:wrap}
.link-btn{background:none;border:none;padding:0;color:var(--text);cursor:pointer;text-align:left;font:inherit;text-decoration:underline;text-underline-offset:3px}
.support-layout{align-items:start}
.support-table-wrap{overflow:auto;margin-top:10px}
.support-thread-head{align-items:end}
.support-status-box{min-width:150px}
.support-status-box label{display:block;margin-bottom:6px}
.support-messages{display:grid;gap:12px;max-height:520px;overflow:auto;margin-top:14px;padding-right:4px}
.support-message{padding:14px 16px;border:1px solid var(--line);border-radius:16px;background:rgba(255,255,255,.03);backdrop-filter:blur(16px)}
.support-message.mine{background:rgba(124,92,255,.10);border-color:rgba(124,92,255,.28)}
.support-message-head{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:8px;color:var(--muted);font-size:12px}
.support-message-head strong{color:var(--text);font-size:13px}
.support-message-body{white-space:normal;word-break:break-word;line-height:1.55}
.table tr.is-selected td{background:rgba(124,92,255,.08)}
@media(max-width:820px){
  .support-thread-head{align-items:flex-start}
  .support-status-box{width:100%}
}
.support-toolbar{display:flex;gap:8px;align-items:center}
.support-columns{display:grid;grid-template-columns:1fr;gap:14px;margin-top:14px}
.support-sidepanel{display:grid;gap:12px;align-content:start}
.support-sidecard{padding:14px;border:1px solid var(--line);border-radius:16px;background:rgba(255,255,255,.025);backdrop-filter:blur(16px)}
.support-inline-note{margin-top:6px;font-size:12px}
.support-admin-grid{display:grid;grid-template-columns:1fr;gap:10px;min-width:min(100%,340px)}
.support-check-wrap{display:flex;align-items:flex-end}
.checkline{display:flex;align-items:center;gap:8px;margin:0;color:var(--text);font-size:13px}
.checkline input{width:auto}
.support-attachment-list,.support-note-list{display:grid;gap:8px}
.support-attachment-item,.support-note-item{padding:10px 12px;border-radius:12px;border:1px solid var(--line);background:rgba(255,255,255,.03)}
.support-attachment-item a{font-weight:600}
.support-attachment-meta,.support-note-meta{margin-top:4px;color:var(--muted);font-size:12px}
.support-message.is-internal{border-color:rgba(255,204,102,.28);background:rgba(255,204,102,.08)}
.support-message-flags{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:8px}
.support-chip{display:inline-flex;align-items:center;padding:4px 8px;border-radius:999px;font-size:11px;border:1px solid var(--line);color:var(--muted);background:rgba(255,255,255,.03)}
.support-chip.warn{border-color:rgba(255,204,102,.35);color:var(--warn)}
.link-btn{appearance:none;background:none;border:none;padding:0;color:var(--text);cursor:pointer;text-decoration:underline}
tr.is-selected{background:rgba(124,92,255,.08)}
@media(min-width:980px){
  .support-columns{grid-template-columns:minmax(0,1fr) 320px}
  .support-admin-grid{grid-template-columns:1fr 1fr}
}


/* =====================================================
   Final polish: landing, dashboard, settings, support
   ===================================================== */
.eyebrow{
  display:inline-flex;
  align-items:center;
  gap:8px;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.06em;
  font-size:12px;
}
.page-intro{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:14px;
  flex-wrap:wrap;
}
.hero-split{
  display:grid;
  grid-template-columns:1.1fr .9fr;
  gap:18px;
}
.hero-split h2{
  font-size:34px;
  line-height:1.08;
  margin:8px 0 10px;
}
.hero-microcopy{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:12px;
}
.step-grid{margin-top:12px}
.step-card h3{margin:8px 0 6px}
.step-no{
  display:inline-flex;
  width:32px;
  height:32px;
  align-items:center;
  justify-content:center;
  border-radius:10px;
  background:rgba(255,255,255,.06);
  border:1px solid var(--line);
  color:var(--text);
  font-size:12px;
  font-weight:700;
}
.feature-panel h3{margin-top:0}
.feature-list{
  margin:12px 0 0;
  padding-left:18px;
  color:var(--text);
}
.feature-list li{margin:8px 0}
.settings-section h2,
.support-panel h2{
  margin:0 0 6px;
}
.section-copy{
  margin:0;
  color:var(--muted);
}
.portal-section-grid{align-items:start}
.support-panel,
.support-thread-card{
  background:linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.02));
}
.stack-item strong{font-weight:700}
@media (max-width: 920px){
  .hero-split{
    grid-template-columns:1fr;
  }
  .hero-split h2{
    font-size:28px;
  }
  .page-intro{
    flex-direction:column;
  }
}


/* Final patch: dashboard + articles + orders + analytics */
.welcome-eyebrow{
  display:inline-flex;
  align-items:center;
  gap:8px;
  width:max-content;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(124,92,255,.28);
  background:rgba(124,92,255,.10);
  color:#d7cbff;
  font-size:12px;
  letter-spacing:.03em;
  text-transform:uppercase;
}
.dashboard-hero{
  display:flex;
  justify-content:space-between;
  gap:16px;
  align-items:flex-end;
  flex-wrap:wrap;
}
.dashboard-stats .card,
.article-kpis .card,
.order-page-stats .card{
  min-height:128px;
}
.article-page-hint input[disabled]{
  opacity:1;
}
.stack-bar{
  display:grid;
  gap:6px;
}
.stack-bar-row{
  display:grid;
  grid-template-columns:minmax(110px,1fr) 2fr auto;
  gap:10px;
  align-items:center;
  padding:8px 10px;
  border:1px solid var(--line);
  border-radius:12px;
  background:rgba(255,255,255,.02);
}
.stack-bar-track{
  height:8px;
  border-radius:999px;
  background:rgba(255,255,255,.06);
  overflow:hidden;
}
.stack-bar-fill{
  height:100%;
  border-radius:999px;
  background:rgba(124,92,255,.55);
}
@media(max-width:820px){
  .stack-bar-row{
    grid-template-columns:1fr;
  }
}


/* Support V3 isolated patch */
.welcome-grid{margin-top:12px}
.feature-panels-spaced{margin-top:12px}
.support-layout{align-items:start}
.support-toolbar select{min-width:140px}
.support-desk-entry{justify-content:flex-end}


/* Support patch */
.welcome-grid{margin-top:12px}
.support-layout{align-items:start}
.support-toolbar select{min-width:140px}
.support-desk-entry{justify-content:flex-end}
