/* Bitsain Reports - "Command Center" theme (v3)
   A premium dark SaaS admin shell - inspired by Linear / Vercel / Stripe in
   spirit (glass surfaces, soft glow, restrained motion) but built around its
   own signature: a violet -> magenta -> amber gradient that nods to the
   social platforms this tool reports on. The gradient appears in exactly a
   few deliberate places (ambient backdrop glow, icon badges, active nav,
   primary actions) while data-heavy surfaces (tables, forms) stay calm,
   high-contrast, and easy to scan for daily use.
   NOTE: this file styles the admin panel only. Printed/PDF report output
   (report_print.php) has its own separate, intentionally neutral stylesheet
   and is not touched here. */

@font-face{
  font-family:'Sora';
  src:url('../fonts/sora-600.woff2') format('woff2');
  font-weight:600; font-style:normal; font-display:swap;
}
@font-face{
  font-family:'Sora';
  src:url('../fonts/sora-700.woff2') format('woff2');
  font-weight:700; font-style:normal; font-display:swap;
}
@font-face{
  font-family:'Sora';
  src:url('../fonts/sora-800.woff2') format('woff2');
  font-weight:800; font-style:normal; font-display:swap;
}

:root{
  /* Surfaces - deep, slightly violet-tinted near-black, stepped for depth */
  --bg:#0A0A10;
  --surface:#13131D;
  --surface-2:#191926;
  --surface-3:#222233;
  --border:rgba(255,255,255,.08);
  --border-strong:rgba(255,255,255,.16);

  /* Text */
  --text:#F3F2F8;
  --text-muted:#92909F;
  --text-faint:#5E5C6C;

  /* Signature accent - the one bold thread running through the app */
  --accent:#7C5CFF;
  --accent-dark:#6645E0;
  --accent-2:#FF5BA8;
  --accent-3:#FFB23E;
  --gradient-signature:linear-gradient(135deg, #7C5CFF 0%, #FF5BA8 55%, #FFB23E 100%);
  --glow-violet:rgba(124,92,255,.32);
  --glow-magenta:rgba(255,91,168,.24);
  --glow-amber:rgba(255,178,62,.20);

  /* Semantic */
  --danger:#FB7185;
  --success:#34D399;
  --warning:#FBBF24;

  --radius:14px;
  --radius-sm:10px;
  --shadow:0 1px 0 rgba(255,255,255,.04) inset, 0 14px 36px rgba(0,0,0,.45);
  --font:'Segoe UI', -apple-system, BlinkMacSystemFont, 'Inter', system-ui, sans-serif;
  --font-display:'Sora', var(--font);
  --font-mono:'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  --ease:cubic-bezier(.2,.7,.2,1);
}

*{box-sizing:border-box;}
html{scrollbar-color:var(--surface-3) transparent;}
body{
  margin:0;
  font-family:var(--font);
  background:var(--bg);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
  position:relative;
}
/* Signature ambient glow - fixed behind every page, content sits above it */
body::before{
  content:'';
  position:fixed; inset:0; z-index:0; pointer-events:none;
  background:
    radial-gradient(640px circle at 6% -10%, var(--glow-violet), transparent 60%),
    radial-gradient(520px circle at 106% 8%, var(--glow-magenta), transparent 55%),
    radial-gradient(760px circle at 40% 118%, var(--glow-amber), transparent 60%);
}
a{color:var(--accent); text-decoration:none;}
a:hover{text-decoration:underline;}
h1,h2,h3{font-family:var(--font-display); letter-spacing:-.01em;}
::selection{background:rgba(124,92,255,.35);}
@media (prefers-reduced-motion: reduce){
  *{transition-duration:.001ms !important; animation-duration:.001ms !important;}
}

/* ---------- Auth pages ---------- */
.auth-bg{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  position:relative; z-index:1;
  padding:20px;
}
.auth-card{
  background:rgba(25,25,38,.78);
  backdrop-filter:blur(22px); -webkit-backdrop-filter:blur(22px);
  border:1px solid var(--border-strong);
  border-radius:20px;
  box-shadow:0 30px 80px rgba(0,0,0,.55);
  padding:34px 38px;
  width:390px;
  max-width:92vw;
  color:var(--text);
}
.auth-title{
  font-family:var(--font-display);
  font-size:21px;
  font-weight:700;
  margin:0 0 18px;
  color:var(--text);
}
.muted{color:var(--text-muted); font-size:13px;}

/* ---------- Forms ---------- */
.form-group{margin-bottom:14px;}
.form-group label{
  display:block;
  font-size:13px;
  font-weight:600;
  margin-bottom:6px;
  color:var(--text);
}
input[type=text], input[type=password], input[type=email], input[type=number],
input[type=date], input[type=time], input[type=url], textarea, select{
  width:100%;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  font-size:14px;
  font-family:var(--font);
  background:var(--surface-2);
  color:var(--text);
  transition:border-color .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease);
}
input::placeholder, textarea::placeholder{color:var(--text-faint);}
input:focus, textarea:focus, select:focus{
  outline:none;
  border-color:var(--accent);
  box-shadow:0 0 0 3px rgba(124,92,255,.22);
  background:var(--surface-3);
}
textarea{resize:vertical; min-height:70px;}
select{ color-scheme:dark; }

/* ---------- Buttons ---------- */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  padding:9px 17px;
  border-radius:var(--radius-sm);
  border:1px solid transparent;
  font-size:14px;
  font-weight:600;
  cursor:pointer;
  transition:background .15s var(--ease), transform .05s, box-shadow .2s var(--ease), border-color .15s var(--ease);
}
.btn:active{transform:scale(.97);}
.btn-primary{background:var(--gradient-signature); color:#fff; box-shadow:0 4px 18px rgba(124,92,255,.38);}
.btn-primary:hover{filter:brightness(1.08); box-shadow:0 6px 24px rgba(124,92,255,.48);}
.btn-secondary{background:var(--surface-2); color:var(--text); border-color:var(--border);}
.btn-secondary:hover{background:var(--surface-3); border-color:var(--border-strong);}
.btn-danger{background:rgba(251,113,133,.12); color:var(--danger); border-color:rgba(251,113,133,.3);}
.btn-danger:hover{background:rgba(251,113,133,.2);}
.btn-sm{padding:6px 12px; font-size:13px;}

/* ---------- Alerts ---------- */
.alert{
  padding:11px 15px;
  border-radius:var(--radius-sm);
  font-size:13.5px;
  margin-bottom:14px;
  border:1px solid transparent;
}
.alert-error{background:rgba(251,113,133,.1); color:#FF96A4; border-color:rgba(251,113,133,.28);}
.alert-success{background:rgba(52,211,153,.1); color:#5EEAB0; border-color:rgba(52,211,153,.28);}
.alert-info{background:rgba(124,92,255,.1); color:#B6A6FF; border-color:rgba(124,92,255,.28);}

/* ---------- App shell ---------- */
.app-shell{display:flex; min-height:100vh; position:relative; z-index:1;}
.sidebar{
  width:240px;
  background:rgba(17,17,26,.74);
  backdrop-filter:blur(22px); -webkit-backdrop-filter:blur(22px);
  border-right:1px solid var(--border);
  display:flex;
  flex-direction:column;
  padding:18px 14px;
  color:var(--text);
  position:relative; z-index:2;
  transition:width .22s var(--ease);
  flex-shrink:0;
}
.sidebar.collapsed{width:78px;}

.sidebar-brand{
  display:flex;
  align-items:center;
  gap:10px;
  padding:6px 8px 20px;
  font-family:var(--font-display);
  font-weight:700;
  font-size:15px;
  color:var(--text);
}
.sidebar-brand img{height:28px; width:auto; border-radius:7px;}
.sidebar.collapsed .sidebar-brand{flex-direction:column; gap:12px; padding:4px 0 18px;}
.sidebar.collapsed .sidebar-brand .brand-label{display:none;}

.sidebar-collapse-btn{
  display:none; align-items:center; justify-content:center; width:26px; height:26px;
  border-radius:8px; border:1px solid var(--border); background:var(--surface-2); color:var(--text-muted);
  cursor:pointer; font-size:12px; margin-left:auto; flex-shrink:0; transition:background .15s, color .15s;
}
.sidebar-collapse-btn:hover{background:var(--surface-3); color:var(--text);}
@media(min-width:781px){ .sidebar-collapse-btn{display:flex;} }

.nav-item{
  display:flex;
  align-items:center;
  gap:12px;
  padding:10px 13px;
  border-radius:var(--radius-sm);
  color:var(--text-muted);
  font-size:14px;
  font-weight:500;
  margin-bottom:3px;
  position:relative;
  transition:background .15s var(--ease), color .15s var(--ease);
}
.nav-item .nav-icon{flex-shrink:0; font-size:15px; width:18px; text-align:center;}
.nav-item:hover{background:rgba(255,255,255,.06); color:var(--text); text-decoration:none;}
.nav-item.active{background:rgba(124,92,255,.16); color:#fff;}
.nav-item.active::before{
  content:''; position:absolute; left:0; top:7px; bottom:7px; width:3px;
  border-radius:2px; background:var(--gradient-signature);
}
.sidebar.collapsed .nav-item{justify-content:center; padding:10px;}
.sidebar.collapsed .nav-item .label{display:none;}

.sidebar-footer{margin-top:auto; font-size:12px; color:var(--text-faint); padding:10px;}
.sidebar.collapsed .sidebar-footer{display:none;}

.sidebar-toggle-btn{display:none;}
.sidebar-backdrop{display:none; position:fixed; inset:0; background:rgba(5,5,10,.6); z-index:39;}

.topbar{
  height:62px;
  background:rgba(13,13,20,.6);
  backdrop-filter:blur(18px); -webkit-backdrop-filter:blur(18px);
  border-bottom:1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 28px;
  flex-shrink:0;
  position:relative; z-index:2;
}
.topbar-title{font-family:var(--font-display); font-size:16px; font-weight:700; letter-spacing:-.01em; color:var(--text);}
.user-chip{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:13px;
  color:var(--text-muted);
  white-space:nowrap;
}
.user-chip a{color:var(--text-muted);}
.user-chip a:hover{color:var(--text);}
.main-content{flex:1; padding:30px 34px; overflow-y:auto; position:relative; z-index:1; min-width:0;}

/* ---------- Cards ---------- */
.card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:22px 24px;
  margin-bottom:20px;
}
.card-title{font-family:var(--font-display); font-size:15.5px; font-weight:700; margin:0 0 14px; color:var(--text); letter-spacing:-.01em;}
.grid-2{display:grid; grid-template-columns:1fr 1fr; gap:16px;}
.grid-3{display:grid; grid-template-columns:1fr 1fr 1fr; gap:16px;}

/* ---------- Dashboard: hero banner ---------- */
.hero-banner{
  position:relative;
  background:linear-gradient(135deg, rgba(124,92,255,.16), rgba(255,91,168,.10) 55%, rgba(255,178,62,.08));
  border:1px solid var(--border-strong);
  border-radius:20px;
  padding:30px 32px;
  margin-bottom:22px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  flex-wrap:wrap;
  gap:16px;
  box-shadow:var(--shadow);
}
.hero-banner h1{font-family:var(--font-display); font-weight:800; font-size:25px; margin:0 0 6px; color:var(--text); letter-spacing:-.02em;}
.hero-banner p{margin:0; opacity:.85; font-size:14px; color:var(--text-muted);}
.hero-banner .hero-date{
  font-size:13px; color:var(--text); background:rgba(255,255,255,.07); border:1px solid var(--border-strong);
  padding:8px 16px; border-radius:99px; white-space:nowrap; font-weight:600;
}

/* ---------- Dashboard: stat cards ---------- */
.stat-grid{display:grid; grid-template-columns:repeat(3,1fr); gap:18px; margin-bottom:22px;}
.stat-card{
  background:var(--surface);
  border-radius:var(--radius);
  padding:22px 24px;
  box-shadow:var(--shadow);
  border:1px solid var(--border);
  display:flex;
  align-items:center;
  gap:16px;
  transition:border-color .2s var(--ease), transform .15s var(--ease);
}
.stat-card:hover{border-color:var(--border-strong); transform:translateY(-2px);}
.stat-icon{
  width:52px; height:52px; border-radius:15px; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  font-size:23px; color:#fff;
}
.stat-icon.violet{background:linear-gradient(135deg,#7C5CFF,#A78BFA); box-shadow:0 8px 22px rgba(124,92,255,.4);}
.stat-icon.magenta{background:linear-gradient(135deg,#FF5BA8,#FF8FC4); box-shadow:0 8px 22px rgba(255,91,168,.35);}
.stat-icon.amber{background:linear-gradient(135deg,#FFB23E,#FFCA6E); box-shadow:0 8px 22px rgba(255,178,62,.35);}
.stat-value{font-family:var(--font-display); font-size:28px; font-weight:800; color:var(--text); line-height:1.15;}
.stat-label{font-size:12px; color:var(--text-muted); margin-top:2px; text-transform:uppercase; letter-spacing:.05em; font-weight:600;}

/* ---------- Dashboard: action tiles ---------- */
.action-grid{display:grid; grid-template-columns:1fr 1fr; gap:18px;}
.action-tile-v2{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:25px;
  display:flex;
  align-items:center;
  gap:18px;
  color:var(--text);
  transition:border-color .2s var(--ease), transform .18s var(--ease), box-shadow .2s var(--ease);
}
.action-tile-v2:hover{
  border-color:rgba(124,92,255,.4); transform:translateY(-3px);
  box-shadow:0 18px 44px rgba(124,92,255,.18); text-decoration:none;
}
.action-tile-v2 .icon-badge{
  width:55px; height:55px; border-radius:16px; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  font-size:24px; color:#fff; background:var(--gradient-signature);
  box-shadow:0 8px 24px rgba(124,92,255,.4);
}
.action-tile-v2 .title{font-family:var(--font-display); font-weight:700; font-size:16px; margin-bottom:3px; color:var(--text);}
.action-tile-v2 .desc{font-size:13px; color:var(--text-muted);}
.action-tile-v2 .arrow{margin-left:auto; font-size:20px; color:var(--text-muted); transition:transform .2s var(--ease), color .2s var(--ease); flex-shrink:0;}
.action-tile-v2:hover .arrow{transform:translateX(4px); color:var(--accent);}

/* legacy action tile (kept so nothing breaks if referenced elsewhere) */
.action-tile{
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius);
  padding:26px; text-align:center; transition:box-shadow .15s, transform .1s; cursor:pointer; color:var(--text);
}
.action-tile:hover{box-shadow:var(--shadow); transform:translateY(-2px); text-decoration:none;}
.action-tile .icon{font-size:30px; margin-bottom:10px;}

/* ---------- Tables ---------- */
.table-scroll{overflow-x:auto;}
table.data-table{width:100%; border-collapse:collapse; font-size:14px; min-width:560px;}
table.data-table th{
  text-align:left; padding:11px 12px; border-bottom:1px solid var(--border-strong);
  color:var(--text-muted); font-weight:600; font-size:12px; text-transform:uppercase;
  letter-spacing:.04em; white-space:nowrap;
}
table.data-table td{padding:12px; border-bottom:1px solid var(--border); color:var(--text);}
table.data-table tr:hover td{background:rgba(255,255,255,.025);}
.data-table .mono, .reference-code{font-family:var(--font-mono); font-size:12.5px; color:var(--text-muted); letter-spacing:.01em;}

.badge{display:inline-block; padding:4px 10px; border-radius:99px; font-size:11.5px; font-weight:600;}
.badge-draft{background:rgba(251,191,36,.14); color:#FBBF24;}
.badge-final{background:rgba(52,211,153,.14); color:#34D399;}

.logo-preview{
  width:64px; height:64px; border-radius:10px; object-fit:contain;
  border:1px solid var(--border); background:#fff; padding:5px;
}

.modal-overlay{
  display:none; position:fixed; inset:0; background:rgba(5,5,10,.65);
  backdrop-filter:blur(3px);
  align-items:center; justify-content:center; z-index:50;
}
.modal-overlay.open{display:flex;}
.modal-box{
  background:var(--surface-2); border:1px solid var(--border-strong); border-radius:18px;
  padding:26px 28px; width:480px; max-width:92vw;
  box-shadow:0 30px 80px rgba(0,0,0,.6); max-height:88vh; overflow-y:auto; color:var(--text);
}
.modal-box h3{margin-top:0; font-family:var(--font-display); color:var(--text);}
.modal-actions{display:flex; justify-content:flex-end; gap:10px; margin-top:18px;}

.checkbox-row{display:flex; align-items:center; gap:8px; font-size:14px; color:var(--text);}
.checkbox-row input{width:auto;}

/* ---------- Responsive ---------- */
@media (max-width:780px){
  .sidebar{position:fixed; left:-244px; top:0; height:100vh; width:240px; transition:left .22s var(--ease); z-index:40;}
  .sidebar.open{left:0;}
  .sidebar.open ~ .sidebar-backdrop{display:block;}
  .sidebar-collapse-btn{display:none;}
  .sidebar-toggle-btn{display:inline-flex;}
  .grid-2, .grid-3, .stat-grid, .action-grid{grid-template-columns:1fr;}
  .main-content{padding:18px 16px;}
  .topbar{padding:0 16px;}
  .hero-banner{padding:22px 20px;}
  .hero-banner .hero-date{order:-1;}
  table.data-table{min-width:480px;}
}
@media (max-width:420px){
  .auth-card{padding:26px 22px;}
  .stat-card, .action-tile-v2{padding:18px;}
}
