/* ============================================================
   Zenkweb — design tokens
   Ivory / deep forest / brass. Fraunces for display, Inter for UI.
   ============================================================ */
:root{
  --bg:#F6F4EC;
  --surface:#FFFFFF;
  --surface-alt:#FBF8F0;
  --ink:#152019;
  --ink-soft:#3C473E;
  --muted:#71806F;
  --line:#E7E1D0;
  --line-soft:#EFEADC;

  --forest-900:#0E2F22;
  --forest-800:#123A29;
  --forest-600:#1E6045;
  --forest-500:#237452;

  --brass-600:#A67A2E;
  --brass-500:#C79A45;
  --brass-300:#DDB86B;
  --brass-100:#F3E3BE;

  --amber-bg:#FBF0DC; --amber-ink:#8A5A16;
  --grey-bg:#EEEEE7; --grey-ink:#5C6459;
  --red-bg:#FBEAE3; --red-ink:#A5432A;

  --radius-sm:8px; --radius-md:14px; --radius-lg:22px;
  --shadow-card:0 1px 2px rgba(15,30,22,.04), 0 12px 28px -14px rgba(15,30,22,.16);
  --shadow-pop:0 18px 45px -16px rgba(15,30,22,.35);
  --ease:cubic-bezier(.22,.68,0,1);
}

@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{ animation-duration:.001ms !important; animation-iteration-count:1 !important; transition-duration:.001ms !important; scroll-behavior:auto !important; }
}

*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  margin:0; background:var(--bg); color:var(--ink);
  font-family:'Inter',ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
  -webkit-font-smoothing:antialiased;
}
a{text-decoration:none;color:inherit}
h1,h2,h3{font-family:'Fraunces',ui-serif,Georgia,serif; letter-spacing:-.01em; font-weight:600}
button{font-family:inherit}
::selection{background:var(--brass-300);color:var(--forest-900)}

:focus-visible{outline:2.5px solid var(--brass-500); outline-offset:2px; border-radius:6px}

/* ============================================================
   App shell
   ============================================================ */
.app-shell{display:flex; min-height:100vh}

.sidebar{
  width:258px; background:linear-gradient(185deg,var(--forest-900),var(--forest-800) 85%);
  color:#fff; padding:28px 18px; display:flex; flex-direction:column;
  position:fixed; inset:0 auto 0 0; z-index:40;
  transition:transform .35s var(--ease);
}
.brand{display:flex; align-items:center; gap:11px; margin:4px 8px 40px}
.brand-mark{
  display:grid; place-items:center; width:38px; height:38px; border-radius:11px;
  background:linear-gradient(150deg,var(--brass-300),var(--brass-600));
  color:var(--forest-900); flex-shrink:0;
  box-shadow:0 6px 16px -6px rgba(199,154,69,.55);
}
.brand-mark svg{width:20px;height:20px}
.brand-word{font-family:'Fraunces',serif; font-size:21px; font-weight:600; letter-spacing:-.01em}

nav{display:grid; gap:4px}
nav a{
  padding:11px 13px; border-radius:11px; color:#C9D8CE; font-weight:600; font-size:14.5px;
  display:flex; align-items:center; gap:13px; position:relative;
  transition:background .2s var(--ease), color .2s var(--ease), padding-left .2s var(--ease);
}
nav a svg{width:19px;height:19px; flex-shrink:0; opacity:.85}
nav a:hover{background:rgba(255,255,255,.07); color:#fff}
nav a[aria-disabled="true"]{cursor:default; opacity:.45}
nav a[aria-disabled="true"]:hover{background:none; color:#C9D8CE}
nav a.active{background:rgba(255,255,255,.1); color:#fff; padding-left:17px}
nav a.active::before{
  content:''; position:absolute; left:0; top:8px; bottom:8px; width:3px; border-radius:3px;
  background:linear-gradient(var(--brass-300),var(--brass-600));
}
nav a.active svg{opacity:1}

.sidebar-bottom{margin-top:auto}
.plan{border:1px solid rgba(255,255,255,.14); border-radius:14px; padding:14px; background:rgba(255,255,255,.03)}
.plan-label{font-family:'Fraunces',serif; font-weight:600; font-size:14.5px}
.plan small{color:#9FB8AA; font-size:12px}

.drawer-backdrop{
  position:fixed; inset:0; background:rgba(10,20,15,.45); backdrop-filter:blur(2px);
  opacity:0; pointer-events:none; transition:opacity .3s var(--ease); z-index:35;
}
.drawer-backdrop.show{opacity:1; pointer-events:auto}

.main{margin-left:258px; width:calc(100% - 258px); min-height:100vh}
.topbar{
  height:70px; background:rgba(255,255,255,.85); backdrop-filter:blur(10px);
  border-bottom:1px solid var(--line); display:flex; align-items:center; justify-content:flex-end;
  gap:14px; padding:0 34px; position:sticky; top:0; z-index:20;
}
.top-actions{display:flex; align-items:center; gap:8px}
.icon-btn{
  display:grid; place-items:center; width:38px; height:38px; border-radius:10px; border:0;
  background:transparent; color:var(--ink-soft); cursor:pointer; transition:background .18s var(--ease), color .18s var(--ease);
}
.icon-btn svg{width:18px;height:18px}
.icon-btn:hover{background:var(--surface-alt); color:var(--forest-600)}
.avatar{
  display:grid; place-items:center; width:37px; height:37px; border-radius:50%;
  background:linear-gradient(150deg,var(--brass-300),var(--brass-600)); color:var(--forest-900);
  font-weight:800; font-size:14.5px; font-family:'Fraunces',serif;
}
.mobile-brand{display:none; font-family:'Fraunces',serif; font-weight:600; font-size:19px; margin-right:auto}

.hamburger{
  display:none; flex-direction:column; justify-content:center; gap:4.5px; width:38px; height:38px;
  border:0; background:transparent; cursor:pointer; border-radius:9px; margin-right:4px;
}
.hamburger span{display:block; width:19px; height:2px; background:var(--ink); border-radius:2px; margin:0 auto; transition:transform .3s var(--ease), opacity .3s var(--ease)}
.hamburger:hover{background:var(--surface-alt)}
.hamburger.open span:nth-child(1){transform:translateY(6.5px) rotate(45deg)}
.hamburger.open span:nth-child(2){opacity:0}
.hamburger.open span:nth-child(3){transform:translateY(-6.5px) rotate(-45deg)}

/* ============================================================
   Toast
   ============================================================ */
.toast{
  margin:18px 34px 0; padding:13px 18px; border-radius:12px; display:flex; align-items:center; gap:10px;
  font-size:13.5px; font-weight:600; background:var(--surface-alt); color:var(--forest-600);
  border:1px solid var(--line-soft); box-shadow:var(--shadow-card);
  animation:toastIn .45s var(--ease);
}
.toast svg{width:17px;height:17px; flex-shrink:0}
.toast.hide{animation:toastOut .35s var(--ease) forwards}
.toast.toast-error{background:var(--red-bg); color:var(--red-ink); border-color:#F2D2C2}
@keyframes toastIn{from{opacity:0; transform:translateY(-10px) scale(.98)} to{opacity:1; transform:none}}
@keyframes toastOut{to{opacity:0; transform:translateY(-8px) scale(.98)}}

/* ============================================================
   Content / page head
   ============================================================ */
.content{max-width:1180px; margin:auto; padding:40px 34px 60px}

@keyframes riseIn{from{opacity:0; transform:translateY(14px)} to{opacity:1; transform:none}}
.page-head,.stats,.panel{animation:riseIn .55s var(--ease) both}
.stats{animation-delay:.08s}
.panel{animation-delay:.16s}

.page-head{display:flex; justify-content:space-between; gap:25px; align-items:flex-end; margin-bottom:30px; flex-wrap:wrap}
.eyebrow{
  font-family:'Fraunces',serif; font-style:italic; font-size:14px; color:var(--brass-600);
  margin-bottom:8px; font-weight:500;
}
.page-head h1{font-size:clamp(28px,4vw,38px); line-height:1.08; margin:0 0 9px; color:var(--forest-900)}
.page-head p{margin:0; color:var(--muted); max-width:50ch}

.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px; border:0; border-radius:11px;
  padding:13px 20px; font-weight:700; cursor:pointer; font-size:14px; transition:transform .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
  white-space:nowrap;
}
.btn:active{transform:scale(.97)}
.btn.primary{background:var(--forest-800); color:#fff; box-shadow:0 10px 24px -12px rgba(14,47,34,.55)}
.btn.primary:hover{background:var(--forest-600); box-shadow:0 14px 28px -12px rgba(14,47,34,.6)}
.btn.secondary{background:var(--surface-alt); color:var(--ink); border:1px solid var(--line)}
.btn.secondary:hover{background:var(--line-soft)}

/* ============================================================
   Stats
   ============================================================ */
.stats{display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:24px}
.stat-card{
  background:var(--surface); border:1px solid var(--line-soft); border-radius:var(--radius-md); padding:20px;
  box-shadow:var(--shadow-card); transition:transform .25s var(--ease), box-shadow .25s var(--ease);
  position:relative; overflow:hidden;
}
.stat-card::after{
  content:''; position:absolute; inset:auto 0 0 0; height:3px; transform:scaleX(0); transform-origin:left;
  background:linear-gradient(90deg,var(--brass-500),var(--brass-300)); transition:transform .4s var(--ease);
}
.stat-card:hover{transform:translateY(-3px); box-shadow:var(--shadow-pop)}
.stat-card:hover::after{transform:scaleX(1)}
.stat-card strong{display:block; font-family:'Fraunces',serif; font-size:28px; font-weight:600; color:var(--forest-900)}
.stat-card span{font-size:12.5px; color:var(--muted); font-weight:500}

/* ============================================================
   Panel / table
   ============================================================ */
.panel{background:var(--surface); border:1px solid var(--line-soft); border-radius:var(--radius-lg); padding:26px; box-shadow:var(--shadow-card)}
.panel-title{display:flex; justify-content:space-between; align-items:center; margin-bottom:18px; gap:16px; flex-wrap:wrap}
.panel-title h2{font-size:19px; margin:0}
.muted{font-size:12px; color:var(--muted)}

.toolbar{display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-bottom:18px}
.search-field{
  position:relative; flex:1; min-width:190px; max-width:320px;
}
.search-field svg{position:absolute; left:13px; top:50%; transform:translateY(-50%); width:15px; height:15px; color:var(--muted); pointer-events:none}
.search-field input{width:100%; padding:10px 14px 10px 36px; border-radius:10px; border:1px solid var(--line); background:var(--surface-alt); font:inherit; font-size:13.5px; color:var(--ink); outline:none; transition:border-color .18s, box-shadow .18s}
.search-field input:focus{border-color:var(--brass-500); box-shadow:0 0 0 3px var(--brass-100); background:#fff}

.chips{display:flex; gap:7px; flex-wrap:wrap}
.chip{
  padding:8px 14px; border-radius:999px; border:1px solid var(--line); background:var(--surface-alt);
  font-size:12.5px; font-weight:700; color:var(--ink-soft); cursor:pointer; transition:all .18s var(--ease);
}
.chip:hover{border-color:var(--brass-300)}
.chip.active{background:var(--forest-800); color:#fff; border-color:var(--forest-800)}

.empty{text-align:center; padding:64px 20px}
.empty-icon{
  margin:auto auto 18px; width:60px; height:60px; border-radius:16px; background:var(--surface-alt);
  display:grid; place-items:center; color:var(--forest-600); animation:floaty 3.4s ease-in-out infinite;
}
.empty-icon svg{width:27px;height:27px}
@keyframes floaty{0%,100%{transform:translateY(0)} 50%{transform:translateY(-6px)}}
.empty h3{margin:0 0 7px; font-size:20px}
.empty p{color:var(--muted); margin:0 auto 22px; max-width:420px; font-size:14.5px}

.table-wrap{overflow:auto; border-radius:var(--radius-md)}
table{width:100%; border-collapse:collapse}
th,td{text-align:left; padding:15px; border-bottom:1px solid var(--line-soft); font-size:13.5px}
th{font-size:11px; text-transform:uppercase; color:var(--muted); letter-spacing:.07em; font-weight:700}
tbody tr{transition:background .18s var(--ease)}
tbody tr:hover{background:var(--surface-alt)}
tbody tr.row-hidden{display:none}

.badge{padding:5px 11px; border-radius:999px; font-size:11px; font-weight:800; display:inline-block}
.badge.draft{background:var(--grey-bg); color:var(--grey-ink)}
.badge.active{background:#E4F1E8; color:var(--forest-600)}
.badge.paused{background:var(--amber-bg); color:var(--amber-ink)}

/* ============================================================
   Create-ad form
   ============================================================ */
.progress-track{height:6px; border-radius:99px; background:var(--line-soft); overflow:hidden; margin:22px 0 26px; max-width:420px}
.progress-fill{height:100%; width:0%; border-radius:99px; background:linear-gradient(90deg,var(--brass-500),var(--forest-600)); transition:width .5s var(--ease)}
.progress-label{font-size:12px; color:var(--muted); margin-top:7px; margin-bottom:26px; font-weight:600}

.form-grid{display:grid; grid-template-columns:1fr 1fr; gap:18px; margin-bottom:10px}
label.field{display:grid; gap:8px; font-size:12.5px; font-weight:700; color:var(--ink-soft)}
input[type="text"],input:not([type]){
  width:100%; border:1px solid var(--line); border-radius:10px; padding:13px 14px; font:inherit; color:var(--ink); outline:none;
  background:var(--surface-alt); transition:border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s;
}
input:focus{border-color:var(--forest-500); box-shadow:0 0 0 3px rgba(30,96,69,.1); background:#fff}

.creative-area{margin-top:28px}
.creative-copy h2{margin:0 0 6px; font-size:20px}
.creative-copy p{color:var(--muted); font-size:13.5px; margin:0 0 16px}

.dropzone{
  border:2px dashed var(--line); border-radius:var(--radius-lg); padding:34px 20px; text-align:center;
  cursor:pointer; transition:border-color .22s var(--ease), background .22s var(--ease), transform .22s var(--ease);
  background:var(--surface-alt);
}
.dropzone:hover{border-color:var(--brass-400); background:#fffdf7}
.dropzone.dragover{border-color:var(--forest-500); background:#f1f8f3; transform:scale(1.01)}
.dropzone input{display:none}
.dropzone-icon{
  width:52px; height:52px; margin:0 auto 14px; border-radius:14px; display:grid; place-items:center;
  background:linear-gradient(150deg,var(--brass-100),var(--brass-300)); color:var(--brass-600);
  transition:transform .25s var(--ease);
}
.dropzone:hover .dropzone-icon{transform:translateY(-3px) rotate(-4deg)}
.dropzone-icon svg{width:24px;height:24px}
.dropzone strong{display:block; font-size:15px; margin-bottom:4px}
.dropzone small{color:var(--muted); font-size:12.5px}

.file-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:14px; margin-top:18px}
.file-card{
  position:relative; border:1px solid var(--line-soft); border-radius:var(--radius-md); overflow:hidden; background:var(--surface);
  animation:popIn .35s var(--ease) both; box-shadow:var(--shadow-card);
}
@keyframes popIn{from{opacity:0; transform:scale(.9)} to{opacity:1; transform:none}}
.file-card.removing{animation:popOut .25s var(--ease) forwards}
@keyframes popOut{to{opacity:0; transform:scale(.85)}}
.file-thumb{width:100%; aspect-ratio:4/3; background:#eee; display:block; object-fit:cover}
.file-meta{padding:9px 10px; font-size:11.5px; color:var(--ink-soft)}
.file-meta .name{font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:block}
.file-meta .size{color:var(--muted)}
.file-remove{
  position:absolute; top:7px; right:7px; width:26px; height:26px; border-radius:50%; border:0;
  background:rgba(20,20,20,.55); color:#fff; display:grid; place-items:center; cursor:pointer;
  transition:background .18s, transform .18s; backdrop-filter:blur(3px);
}
.file-remove:hover{background:var(--red-ink); transform:scale(1.08)}
.file-remove svg{width:13px;height:13px}

.checklist{margin-top:30px; padding:20px; border-radius:16px; background:#EFF6FF; border:1px solid #DBEAFF}
.checklist h3{margin:0 0 12px; color:#1D5FC1; font-size:15px}
.checklist div{margin:9px 0; font-size:13.5px; display:flex; align-items:center; gap:9px; color:#33425c; transition:color .25s var(--ease)}
.checklist div.done{color:var(--forest-600); font-weight:600}
.checklist .tick{width:16px; height:16px; border-radius:50%; border:1.6px solid #b9cdf0; flex-shrink:0; display:grid; place-items:center; transition:all .25s var(--ease)}
.checklist div.done .tick{background:var(--forest-600); border-color:var(--forest-600)}
.checklist .tick svg{width:9px; height:9px; opacity:0; transition:opacity .2s var(--ease)}
.checklist div.done .tick svg{opacity:1}

.tip{margin-top:18px; padding:14px 16px; border-radius:12px; background:var(--surface-alt); color:var(--forest-800); font-size:13.5px; border:1px solid var(--line-soft)}
.form-actions{display:flex; justify-content:flex-end; gap:10px; margin-top:28px}

/* ============================================================
   Responsive
   ============================================================ */
@media(max-width:960px){
  .sidebar{transform:translateX(-100%); box-shadow:var(--shadow-pop)}
  .sidebar.open{transform:translateX(0)}
  .main{margin-left:0; width:100%}
  .hamburger{display:flex}
  .mobile-brand{display:block}
  .brand-word{display:inline}
}

@media(max-width:800px){
  .topbar{padding:0 18px}
  .content{padding:26px 18px 50px}
  .page-head{align-items:flex-start; flex-direction:column}
  .stats{grid-template-columns:1fr 1fr}
  .form-grid{grid-template-columns:1fr}
}

@media(max-width:640px){
  .stats{grid-template-columns:1fr 1fr}
  .stat-card{padding:16px}
  .stat-card strong{font-size:23px}
  .panel{padding:18px; border-radius:16px}
  .toast{margin:14px 18px 0}

  /* table -> stacked cards */
  table thead{display:none}
  table,tbody,tr,td{display:block; width:100%}
  tbody tr{
    border:1px solid var(--line-soft); border-radius:14px; margin-bottom:12px; padding:6px 4px;
    background:var(--surface);
  }
  tbody tr:hover{background:var(--surface)}
  td{border:0; padding:8px 12px; display:flex; justify-content:space-between; align-items:center; gap:10px; font-size:13px}
  td::before{content:attr(data-label); font-size:10.5px; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); font-weight:700}
}

@media(max-width:480px){
  .stats{grid-template-columns:1fr}
  .content{padding:20px 14px 44px}
  .page-head h1{font-size:26px}
  .toolbar{flex-direction:column; align-items:stretch}
  .search-field{max-width:none}
  .file-grid{grid-template-columns:repeat(auto-fill,minmax(120px,1fr))}
}
