/* ===== STYLE.CSS — Ai-ren Design Ads Admin ===== */
@import url('https://fonts.googleapis.com/css2?family=Great+Vibes&family=Inter:wght@400;500;600;700;800&display=swap');

:root{
  --bg:       #070b16;
  --panel:    #0d1526;
  --panel2:   #111d35;
  --border:   #1e2d4a;
  --gold:     #f0a83c;
  --gold-light:#f7c26b;
  --text:     #e8eaf2;
  --muted:    #8891a7;
  --green:    #22c55e;
  --blue:     #4f8ef7;
  --red:      #ef4444;
  --sidebar-w:220px;
  --topbar-h: 56px;
}

*{ box-sizing:border-box; margin:0; padding:0; }
html,body{ height:100%; font-family:'Inter',sans-serif; background:var(--bg); color:var(--text); font-size:14px; }
a{ text-decoration:none; color:inherit; }
button{ font-family:inherit; cursor:pointer; border:none; }
input,textarea,select{ font-family:inherit; color:var(--text); background:var(--panel2); border:1.5px solid var(--border); border-radius:8px; padding:9px 12px; font-size:13.5px; width:100%; outline:none; transition:border-color .15s; }
input:focus,textarea:focus,select:focus{ border-color:var(--gold); }
select option{ background:var(--panel2); }
textarea{ resize:vertical; }
table{ width:100%; border-collapse:collapse; }
thead tr{ background:var(--panel2); }
th{ text-align:left; padding:11px 14px; font-size:11.5px; font-weight:700; letter-spacing:.05em; color:var(--muted); text-transform:uppercase; }
td{ padding:12px 14px; border-bottom:1px solid var(--border); font-size:13.5px; vertical-align:middle; }
tr:last-child td{ border-bottom:none; }
tbody tr:hover{ background:rgba(255,255,255,.025); cursor:pointer; }

/* ===== Layout ===== */
.layout{ display:flex; min-height:100vh; }

/* ===== Sidebar ===== */
.sidebar{
  width:var(--sidebar-w); flex-shrink:0; background:#06091a;
  border-right:1px solid var(--border); display:flex; flex-direction:column;
  position:fixed; top:0; left:0; bottom:0; overflow-y:auto; z-index:40;
  padding-bottom:24px;
}
.sidebar-logo{ padding:22px 18px 14px; border-bottom:1px solid var(--border); }
.logo-crown{ color:var(--gold); font-size:18px; margin-bottom:2px; }
.logo-text{ font-family:'Great Vibes',cursive; font-size:36px; color:var(--gold); line-height:1; }
.logo-sub{ font-size:11px; font-weight:800; letter-spacing:.12em; color:var(--text); margin-top:2px; }
.logo-tagline{ font-size:10px; color:var(--muted); letter-spacing:.06em; margin-top:3px; }
.sidebar-nav{ flex:1; padding:10px 0; }
.nav-item{ display:flex; align-items:center; gap:10px; padding:10px 18px; font-size:13.5px; font-weight:500; color:var(--muted); transition:.15s; }
.nav-badge{ margin-left:auto; background:#ef4444; color:#fff; font-size:11px; font-weight:800; border-radius:10px; padding:1px 7px; min-width:18px; text-align:center; }
.nav-chevron{ margin-left:auto; font-size:11px; opacity:.6; }
.nav-item:hover{ color:var(--text); background:rgba(255,255,255,.04); }
.nav-item.active{ color:var(--gold); background:rgba(240,168,60,.1); border-left:3px solid var(--gold); }
.nav-ic{ width:18px; text-align:center; font-size:15px; }
.sidebar-footer{ padding:18px 18px 0; border-top:1px solid var(--border); font-size:12px; }
.sf-brand{ font-family:'Great Vibes',cursive; font-size:22px; color:var(--gold); margin-bottom:4px; }
.sf-logo-wrap{ position:relative; display:inline-block; overflow:hidden; border-radius:8px; margin-bottom:6px; }
.sf-logo-shine{ display:block; width:130px; height:auto; animation: sfLogoGlow 2.6s ease-in-out infinite; }
.sf-logo-wrap::after{
  content:''; position:absolute; top:0; left:-160%; width:55%; height:100%;
  background:linear-gradient(115deg, transparent 0%, rgba(255,255,255,.85) 50%, transparent 100%);
  transform:skewX(-20deg); animation: sfShineSweep 3.2s ease-in-out infinite; mix-blend-mode:screen; pointer-events:none;
}
@keyframes sfShineSweep{ 0%{left:-160%;} 45%{left:160%;} 100%{left:160%;} }
@keyframes sfLogoGlow{ 0%,100%{filter:drop-shadow(0 0 5px rgba(240,168,60,.2));} 50%{filter:drop-shadow(0 0 14px rgba(240,168,60,.55));} }
.sf-tagline{ color:var(--muted); font-size:11.5px; line-height:1.5; margin-bottom:8px; }
.sf-info{ color:var(--muted); font-size:11.5px; margin-bottom:3px; display:flex; gap:6px; }
.sf-social{ display:flex; gap:8px; margin:10px 0; }
.sf-social a{ width:28px; height:28px; border-radius:50%; background:rgba(255,255,255,.07); border:1px solid var(--border); display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:700; }
.sf-social a:hover{ background:var(--gold); color:#0a0e1a; }
.sf-signed{ color:var(--muted); font-size:11px; margin-top:8px; }

/* ===== Video Ads (YouTube Shorts banners) ===== */
.sidebar-video-slot{ padding:12px 16px; border-top:1px solid var(--border); }
.ad-video-item{ margin-bottom:12px; }
.ad-video-item:last-child{ margin-bottom:0; }
.ad-video-item iframe{ width:100%; aspect-ratio:9/16; border-radius:8px; border:1px solid var(--border); display:block; background:#000; }
.right-ad-column{
  position:fixed; top:0; right:0; bottom:0; width:220px; overflow-y:auto;
  padding:70px 14px 24px; background:var(--bg); border-left:1px solid var(--border);
  z-index:35; display:none;
}
.right-ad-column .ad-video-item iframe{ border-radius:10px; }
@media(min-width:1500px){
  body.has-right-ads .right-ad-column{ display:block; }
  body.has-right-ads .main{ margin-right:220px; }
}

/* ===== Contact Banner (guest-facing pages) ===== */
.contact-banner{
  position:relative; overflow:hidden;
  display:flex; align-items:center; justify-content:space-between; gap:20px;
  padding:14px 28px; background:linear-gradient(90deg,#05070d,#0d1526);
  border-bottom:1px solid var(--border); flex-wrap:wrap;
}
.contact-banner .cb-bg{ position:absolute; inset:0; z-index:0; overflow:hidden; }
.contact-banner .cb-bg iframe{
  position:absolute; top:50%; left:50%; width:100%; height:100%;
  min-width:100%; min-height:100%;
  transform:translate(-50%,-50%) scale(4.5);
  pointer-events:none; border:none;
}
.contact-banner .cb-bg-overlay{ position:absolute; inset:0; background:rgba(5,7,13,.72); }
.contact-banner .cb-logo, .contact-banner .cb-info, .contact-banner .cb-social{ position:relative; z-index:1; }
.contact-banner .cb-logo img{ height:58px; display:block; }
.contact-banner .cb-info{ text-align:center; flex:1; min-width:200px; }
.contact-banner .cb-phone{ font-size:36px; font-weight:800; color:#fff; line-height:1.3; }
.contact-banner .cb-address{ font-size:12.5px; font-weight:700; letter-spacing:.03em; color:var(--muted); margin-top:4px; text-transform:uppercase; }
.contact-banner .cb-social{ display:flex; gap:10px; align-items:center; flex-shrink:0; }
.contact-banner .cb-social a{ display:flex; }
.contact-banner .cb-social img{ height:34px; display:block; border-radius:6px; }
@media(max-width:800px){
  .contact-banner{ flex-direction:column; text-align:center; padding:14px 10px; gap:10px; }
  .contact-banner .cb-logo{ order:1; }
  .contact-banner .cb-logo img{ height:42px; }
  .contact-banner .cb-info{ order:2; min-width:0; width:100%; }
  .contact-banner .cb-phone{ font-size:20px; word-break:break-word; }
  .contact-banner .cb-address{ font-size:10.5px; }
  .contact-banner .cb-social{ order:3; }
  .contact-banner .cb-social img{ height:26px; }
  .contact-banner .cb-bg iframe{ transform:translate(-50%,-50%) scale(6); }
}

/* ===== Main ===== */
.main{ flex:1; margin-left:var(--sidebar-w); min-height:100vh; display:flex; flex-direction:column; }

/* ===== Topbar ===== */
.topbar{ height:var(--topbar-h); background:var(--panel); border-bottom:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; padding:0 24px; position:sticky; top:0; z-index:30; }
.topbar-menu{ background:none; border:none; color:var(--muted); font-size:20px; cursor:pointer; padding:6px; border-radius:6px; }
.topbar-menu:hover{ color:var(--text); background:rgba(255,255,255,.06); }
.topbar-right{ display:flex; align-items:center; gap:12px; }
.topbar-right a:hover{ opacity:.85; }
.topbar-avatar{ width:34px; height:34px; border-radius:50%; background:var(--gold); color:#0a0e1a; display:flex; align-items:center; justify-content:center; font-weight:800; font-size:14px; }

/* ===== Page content ===== */
.page-head{ padding:24px 24px 12px; display:flex; justify-content:space-between; align-items:flex-start; flex-wrap:wrap; gap:12px; }
.page-head h1{ font-size:22px; font-weight:800; }
.page-head p{ color:var(--muted); font-size:13px; margin-top:4px; }

/* ===== Stats grid ===== */
.stats{ display:grid; grid-template-columns:repeat(4,1fr); gap:16px; padding:0 24px 16px; }
.stat-card{ background:var(--panel); border:1px solid var(--border); border-radius:12px; padding:18px; }
.stat-top{ display:flex; justify-content:flex-end; }
.stat-icon{ width:36px; height:36px; border-radius:10px; background:rgba(240,168,60,.12); display:flex; align-items:center; justify-content:center; font-size:16px; }
.stat-label{ font-size:10.5px; font-weight:700; letter-spacing:.06em; color:var(--muted); text-transform:uppercase; margin-top:6px; }
.stat-value{ font-size:26px; font-weight:800; margin-top:2px; }
.stat-sub{ font-size:11.5px; color:var(--muted); margin-top:2px; }

/* ===== Panel ===== */
.panel{ background:var(--panel); border:1px solid var(--border); border-radius:12px; padding:18px; margin:0 24px 20px; }
.panel-head{ display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:16px; flex-wrap:wrap; gap:8px; }
.panel-head h2{ font-size:16px; font-weight:700; }
.ph-sub{ font-size:12px; color:var(--muted); margin-top:2px; }

/* ===== Row layouts ===== */
.row{ display:grid; gap:16px; margin:0 24px 20px; }
.row.two{ grid-template-columns:1fr 1fr; }
.row.half{ grid-template-columns:1fr 1fr; }
.row.half .panel,.row.two .panel{ margin:0; }

/* ===== Buttons ===== */
.primary-btn{ padding:9px 18px; border-radius:8px; font-size:13px; font-weight:700; transition:.15s; }
.primary-btn.solid{ background:var(--gold); color:#0a0e1a; }
.primary-btn.solid:hover{ background:var(--gold-light); }
.btn-cancel{ background:rgba(255,255,255,.07); color:var(--text); padding:9px 18px; border-radius:8px; font-size:13px; font-weight:600; border:1px solid var(--border); }
.btn-cancel:hover{ background:rgba(255,255,255,.12); }
.btn-delete{ background:rgba(239,68,68,.12); color:#ef4444; padding:9px 18px; border-radius:8px; font-size:13px; font-weight:600; border:1px solid rgba(239,68,68,.3); }
.btn-delete:hover{ background:rgba(239,68,68,.22); }
.date-btn{ background:rgba(255,255,255,.07); color:var(--text); padding:8px 16px; border-radius:8px; font-size:13px; font-weight:600; border:1px solid var(--border); }
.date-btn:hover{ background:rgba(255,255,255,.12); }
.link-btn{ font-size:12.5px; color:var(--gold); font-weight:600; }
.link-btn:hover{ text-decoration:underline; }
.mini-btn{ padding:5px 12px; border-radius:6px; font-size:12px; font-weight:700; border:1px solid; }
.mini-btn.approve{ background:rgba(34,197,94,.1); color:#22c55e; border-color:rgba(34,197,94,.3); }
.mini-btn.approve:hover{ background:rgba(34,197,94,.2); }
.mini-btn.reject{ background:rgba(239,68,68,.1); color:#ef4444; border-color:rgba(239,68,68,.3); margin-left:6px; }
.mini-btn.reject:hover{ background:rgba(239,68,68,.2); }

/* ===== Search ===== */
.search-input{ background:var(--panel2); border:1.5px solid var(--border); border-radius:8px; padding:9px 14px; font-size:13px; color:var(--text); transition:border-color .15s; }
.search-input:focus{ border-color:var(--gold); outline:none; }

/* ===== Table wrap ===== */
.table-wrap{ overflow-x:auto; border-radius:8px; }
.cell-title{ font-weight:600; font-size:13.5px; }
.status{ display:inline-flex; align-items:center; padding:4px 10px; border-radius:20px; font-size:11.5px; font-weight:700; }
.status.completed,.status.approved{ background:rgba(34,197,94,.15); color:#22c55e; }
.status.processing{ background:rgba(79,142,247,.15); color:#4f8ef7; }
.status.pending{ background:rgba(240,168,60,.15); color:var(--gold); }
.status.cancelled,.status.failed,.status.rejected{ background:rgba(239,68,68,.15); color:#ef4444; }

/* ===== Empty state ===== */
.empty-state{ text-align:center; padding:40px 20px; }
.es-ic{ font-size:38px; margin-bottom:10px; }
.empty-state h4{ font-size:15px; margin-bottom:6px; }
.empty-state p{ color:var(--muted); font-size:13px; }

/* ===== List items ===== */
.list-item{ display:flex; justify-content:space-between; align-items:center; padding:12px 0; border-bottom:1px solid var(--border); cursor:pointer; }
.list-item:last-child{ border-bottom:none; }
.list-item:hover{ opacity:.82; }
.li-title{ font-weight:600; font-size:13.5px; }
.li-sub{ font-size:12px; color:var(--muted); margin-top:2px; }
.li-right{ text-align:right; }
.li-price{ font-weight:700; font-size:14px; color:var(--gold); }

/* ===== Chat list ===== */
.chat-item{ display:flex; align-items:center; gap:12px; padding:11px 8px; border-radius:10px; cursor:pointer; }
.chat-item:hover{ background:rgba(255,255,255,.04); }
.chat-avatar{ width:40px; height:40px; border-radius:50%; background:rgba(240,168,60,.2); border:1.5px solid var(--gold); display:flex; align-items:center; justify-content:center; font-weight:700; font-size:14px; flex-shrink:0; }
.chat-meta{ flex:1; min-width:0; }
.chat-name{ font-weight:600; font-size:13.5px; }
.chat-preview{ font-size:12px; color:var(--muted); margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.chat-time{ font-size:11.5px; color:var(--muted); }
.unread-dot{ width:8px; height:8px; border-radius:50%; background:var(--gold); margin-left:auto; }

/* ===== Modal ===== */
.modal-overlay{ position:fixed; inset:0; background:rgba(0,0,0,.6); z-index:100; display:none; align-items:center; justify-content:center; padding:20px; }
.modal-overlay.open{ display:flex; }
.modal{ background:var(--panel); border:1px solid var(--border); border-radius:16px; width:100%; max-width:520px; max-height:90vh; overflow-y:auto; padding:24px; position:relative; }
.modal-head{ display:flex; justify-content:space-between; align-items:center; margin-bottom:20px; }
.modal-head h2{ font-size:17px; font-weight:700; }
.modal-close{ background:rgba(255,255,255,.07); border:1px solid var(--border); color:var(--text); width:30px; height:30px; border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:14px; }
.modal-close:hover{ background:rgba(255,255,255,.12); }
.modal-actions{ display:flex; justify-content:flex-end; gap:10px; margin-top:20px; flex-wrap:wrap; }

/* ===== Form ===== */
.form-grid{ display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.field{ display:flex; flex-direction:column; gap:6px; }
.field.full{ grid-column:1/-1; }
.field label{ font-size:12.5px; font-weight:600; color:var(--muted); }

/* ===== Pie / Legend ===== */
.pie-wrap{ display:flex; justify-content:center; padding:20px 0 14px; }
.pie{ width:120px; height:120px; border-radius:50%; }
.legend{ display:flex; flex-direction:column; gap:8px; padding:0 8px 8px; font-size:13px; }
.legend div{ display:flex; align-items:center; gap:8px; }
.dot{ width:10px; height:10px; border-radius:50%; display:inline-block; }

/* ===== Toggle / Switch ===== */
.switch{ width:42px; height:24px; border-radius:30px; background:rgba(255,255,255,.12); border:1px solid var(--border); position:relative; cursor:pointer; flex-shrink:0; transition:.2s; }
.switch::after{ content:''; position:absolute; top:3px; left:3px; width:16px; height:16px; border-radius:50%; background:#fff; transition:.2s; }
.switch.on{ background:var(--gold); border-color:var(--gold); }
.switch.on::after{ transform:translateX(18px); }
.toggle-row{ display:flex; justify-content:space-between; align-items:center; padding:14px 0; border-bottom:1px solid var(--border); }
.toggle-row:last-child{ border-bottom:none; }
.tr-title{ font-size:13.5px; font-weight:600; }
.tr-sub{ font-size:12px; color:var(--muted); margin-top:2px; }

/* ===== Responsive ===== */
@media(max-width:900px){
  .stats{ grid-template-columns:1fr 1fr; }
  .row.two,.row.half{ grid-template-columns:1fr; }
}
@media(max-width:700px){
  .sidebar{ transform:translateX(-100%); transition:.25s; }
  .sidebar.open{ transform:translateX(0); }
  .main{ margin-left:0; }
  .stats{ grid-template-columns:1fr; }
  .form-grid{ grid-template-columns:1fr; }
}
