:root{
  --admin-bg:#0f0a05;
  --admin-panel:rgba(20,12,8,.92);
  --admin-panel-2:rgba(34,19,11,.92);
  --admin-border:rgba(217,164,76,.45);
  --admin-border-2:rgba(255,215,120,.22);
  --admin-text:#f5e8c9;
  --admin-muted:#c8b68e;
  --admin-accent:#d9a44c;
  --admin-accent-2:#ffdd8a;
  --admin-shadow:0 18px 45px rgba(0,0,0,.38);
}
.link-reset{color:inherit;text-decoration:none}
.admin-shell{display:grid;grid-template-columns:280px minmax(0,1fr);gap:22px;align-items:start}
.admin-sidebar{position:sticky;top:90px;background:linear-gradient(180deg,var(--admin-panel),var(--admin-panel-2));border:1px solid var(--admin-border);border-radius:22px;box-shadow:var(--admin-shadow);padding:18px;overflow:hidden}
.admin-sidebar:before{content:"";position:absolute;inset:0;background:radial-gradient(circle at top right, rgba(255,221,138,.12), transparent 35%);pointer-events:none}
.admin-sidebar>*{position:relative}
.admin-brand{display:flex;gap:12px;align-items:center;margin-bottom:14px;padding-bottom:12px;border-bottom:1px solid var(--admin-border-2)}
.admin-brand-icon{width:52px;height:52px;display:grid;place-items:center;border-radius:16px;background:linear-gradient(135deg, rgba(217,164,76,.28), rgba(255,215,120,.12));border:1px solid var(--admin-border);font-size:1.35rem;box-shadow:inset 0 0 20px rgba(255,215,120,.05)}
.admin-brand h2{font-size:1.02rem;line-height:1.15;margin:0;color:var(--admin-text)}
.admin-brand small{display:block;color:var(--admin-muted);margin-top:4px}
.admin-search{margin:12px 0 16px}
.admin-search input{width:100%;padding:12px 14px;border-radius:14px;border:1px solid var(--admin-border);background:rgba(0,0,0,.28);color:var(--admin-text)}
.admin-sidebar-section{margin:16px 0}
.admin-sidebar-heading{font-size:.8rem;text-transform:uppercase;letter-spacing:.12em;color:var(--admin-muted);margin:0 0 8px}
.admin-sidebar-links{display:grid;gap:8px}
.admin-sidebar-link{display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:14px;color:var(--admin-text);text-decoration:none;border:1px solid transparent;transition:all .18s ease;background:rgba(255,255,255,.02)}
.admin-sidebar-link:hover,.admin-sidebar-link.is-active{border-color:var(--admin-border);background:rgba(217,164,76,.12);transform:translateX(2px)}
.admin-sidebar-link .ico{width:28px;height:28px;display:grid;place-items:center;border-radius:10px;background:rgba(255,221,138,.09);font-size:.95rem}
.admin-main{min-width:0}
.admin-v2-topbar{display:flex;gap:14px;align-items:center;justify-content:space-between;margin-bottom:18px;background:linear-gradient(180deg, rgba(26,15,9,.9), rgba(15,10,5,.9));border:1px solid var(--admin-border);padding:16px 18px;border-radius:20px;box-shadow:var(--admin-shadow)}
.admin-v2-topbar h1{font-size:1.35rem;margin:0;color:var(--admin-text)}
.admin-v2-topbar p{margin:4px 0 0;color:var(--admin-muted)}
.admin-chip-row{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.admin-chip{display:inline-flex;align-items:center;gap:8px;padding:8px 12px;border-radius:999px;background:rgba(217,164,76,.11);border:1px solid var(--admin-border);color:var(--admin-text);font-size:.92rem}
.admin-return{display:inline-flex;align-items:center;gap:8px;padding:11px 16px;border-radius:14px;background:linear-gradient(180deg, rgba(217,164,76,.95), rgba(182,129,45,.95));color:#251208!important;font-weight:700;text-decoration:none!important;border:1px solid rgba(255,221,138,.5);box-shadow:0 10px 24px rgba(0,0,0,.22)}
.admin-return:hover{filter:brightness(1.06);transform:translateY(-1px)}
.admin-hero-grid{display:grid;grid-template-columns:1.3fr .9fr;gap:18px}
.admin-stat-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-top:14px}
.admin-stat-card,.admin-card-panel{background:linear-gradient(180deg, rgba(29,16,10,.9), rgba(17,10,6,.92));border:1px solid var(--admin-border);border-radius:18px;padding:16px;box-shadow:var(--admin-shadow)}
.admin-stat-card h3,.admin-card-panel h3{margin:0 0 6px;color:var(--admin-text)}
.admin-stat-value{font-size:1.8rem;font-weight:800;color:var(--admin-accent-2);line-height:1.1}
.admin-stat-meta{color:var(--admin-muted);font-size:.95rem}
.admin-grid-v2{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
.admin-card-link{display:flex;flex-direction:column;justify-content:space-between;gap:10px;min-height:130px;padding:16px;border-radius:18px;background:linear-gradient(180deg, rgba(35,20,12,.92), rgba(20,12,8,.96));border:1px solid var(--admin-border);text-decoration:none;color:var(--admin-text)!important;box-shadow:var(--admin-shadow);transition:transform .18s ease, border-color .18s ease, box-shadow .18s ease}
.admin-card-link:hover{transform:translateY(-3px);border-color:rgba(255,221,138,.62);box-shadow:0 20px 32px rgba(0,0,0,.42)}
.admin-card-link .card-emoji{font-size:1.45rem}
.admin-card-link .card-title{font-weight:800;font-size:1rem}
.admin-card-link .card-desc{color:var(--admin-muted);font-size:.92rem;line-height:1.45}
.admin-card-link .card-foot{font-size:.85rem;color:var(--admin-accent-2)}
.page-builder-grid{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(340px,.8fr);gap:18px;align-items:start}
.page-builder-help{display:grid;gap:18px}
.page-snippet-bar{display:flex;gap:8px;flex-wrap:wrap;padding:12px;border:1px dashed var(--admin-border);border-radius:14px;background:rgba(255,255,255,.02);margin-top:12px}
.page-snippet-title{font-weight:700;color:var(--admin-accent-2);margin-right:4px}
.page-snippet-btn{padding:8px 10px!important;font-size:.86rem}
.page-wireframe{border-radius:18px;border:1px solid var(--admin-border);overflow:hidden;background:rgba(0,0,0,.18)}
.page-wireframe-label{padding:10px 14px;background:rgba(217,164,76,.12);font-size:.85rem;color:var(--admin-muted);text-transform:uppercase;letter-spacing:.08em}
.page-wireframe-hero{min-height:160px;display:grid;place-items:center;background:rgba(255,255,255,.03);border-bottom:1px solid var(--admin-border-2)}
.page-wireframe-body{padding:16px}
.page-wireframe-chip{display:inline-flex;padding:6px 10px;border-radius:999px;background:rgba(217,164,76,.12);border:1px solid var(--admin-border);margin-bottom:12px}
.page-wireframe-content{padding:14px;border-radius:14px;background:rgba(255,255,255,.03);border:1px dashed var(--admin-border);margin-top:12px;min-height:120px;color:var(--admin-muted)}
.page-wireframe-empty{color:var(--admin-muted)}
.page-block-note{margin-top:8px;color:var(--admin-muted);font-size:.92rem}
.page-action-row{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px}
.upload-box{margin-top:8px;margin-bottom:14px;padding:14px;border:1px solid var(--admin-border);border-radius:14px;background:rgba(0,0,0,.2)}
.upload-box input[type=file]{display:block;width:100%;color:var(--admin-text);background:transparent;border:none;padding:0}
.upload-box input[type=file]::file-selector-button{background:linear-gradient(180deg, rgba(217,164,76,.95), rgba(182,129,45,.95));color:#251208;border:none;border-radius:10px;padding:10px 16px;margin-right:12px;font-weight:700;cursor:pointer}
.upload-help{display:block;margin-top:10px;color:var(--admin-muted)}
.users-list{display:grid;gap:12px}
.user-row-card{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;padding:14px;border-radius:16px;border:1px solid var(--admin-border);background:rgba(255,255,255,.03)}
.user-row-meta{color:var(--admin-muted);font-size:.93rem;margin-top:4px}
.user-row-actions{display:flex;gap:8px;align-items:start;flex-wrap:wrap}
.perm-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.perm-item{display:flex;gap:10px;align-items:flex-start;padding:10px 12px;border-radius:12px;border:1px solid var(--admin-border-2);background:rgba(255,255,255,.02)}
.perm-item input{margin-top:3px}
.admin-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.admin-note{padding:12px 14px;border-radius:14px;background:rgba(255,221,138,.08);border:1px solid var(--admin-border);color:var(--admin-muted)}
.nav-manager-list{display:grid;gap:10px}
.nav-link-row{display:grid;grid-template-columns:1.4fr 1.8fr auto auto;gap:10px;align-items:center;padding:12px;border:1px solid var(--admin-border);border-radius:14px;background:rgba(255,255,255,.03)}
.admin-table{width:100%;border-collapse:separate;border-spacing:0 10px}
.admin-table th{font-size:.85rem;color:var(--admin-muted);text-transform:uppercase;letter-spacing:.08em;padding:0 10px 4px;text-align:left}
.admin-table td{padding:12px 10px;background:rgba(255,255,255,.03);border-top:1px solid var(--admin-border-2);border-bottom:1px solid var(--admin-border-2)}
.admin-table td:first-child{border-left:1px solid var(--admin-border-2);border-radius:12px 0 0 12px}
.admin-table td:last-child{border-right:1px solid var(--admin-border-2);border-radius:0 12px 12px 0}
@media (max-width:1200px){.admin-grid-v2{grid-template-columns:repeat(3,minmax(0,1fr))}.admin-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.perm-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:980px){.admin-shell{grid-template-columns:1fr}.admin-sidebar{position:static}.page-builder-grid,.admin-hero-grid,.admin-form-grid{grid-template-columns:1fr}.admin-grid-v2{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:640px){.admin-grid-v2,.admin-stat-grid,.perm-grid{grid-template-columns:1fr}.user-row-card{grid-template-columns:1fr}.nav-link-row{grid-template-columns:1fr}.admin-v2-topbar{flex-direction:column;align-items:flex-start}.admin-chip-row{justify-content:flex-start}}


/* Admin V2 readability + footer fixes */
body.page-admin{background:#120a06;color:var(--admin-text);} 
body.page-admin .content-area{padding-bottom:calc(var(--footer-h) + 40px);} 
body.page-admin .content-wrapper{max-width:1280px;overflow:visible;} 
body.page-admin .admin-main{min-width:0;color:var(--admin-text);} 
body.page-admin .admin-main, 
body.page-admin .admin-main p,
body.page-admin .admin-main li,
body.page-admin .admin-main label,
body.page-admin .admin-main strong,
body.page-admin .admin-main span,
body.page-admin .admin-main td,
body.page-admin .admin-main th,
body.page-admin .admin-main code,
body.page-admin .admin-main small,
body.page-admin .admin-main h1,
body.page-admin .admin-main h2,
body.page-admin .admin-main h3,
body.page-admin .admin-main h4,
body.page-admin .admin-main h5,
body.page-admin .admin-main h6{color:var(--admin-text);} 
body.page-admin .admin-main .admin-stat-meta,
body.page-admin .admin-main .card-desc,
body.page-admin .admin-main .page-block-note,
body.page-admin .admin-main .upload-help,
body.page-admin .admin-main .user-row-meta,
body.page-admin .admin-main .admin-note,
body.page-admin .admin-main .page-wireframe-empty,
body.page-admin .admin-main .page-wireframe-label,
body.page-admin .admin-main .content-muted{color:var(--admin-muted)!important;} 
body.page-admin .admin-main .content-card,
body.page-admin .admin-main .admin-card,
body.page-admin .admin-main .schedule-box,
body.page-admin .admin-main .clock-box{color:var(--admin-text);} 
body.page-admin .admin-main a:not(.admin-btn):not(.admin-return):not(.admin-card-link):not(.btn):not(.admin-sidebar-link){color:var(--admin-accent-2);} 
body.page-admin .admin-main input,
body.page-admin .admin-main textarea,
body.page-admin .admin-main select{color:var(--admin-text);} 
body.page-admin .admin-main input::placeholder,
body.page-admin .admin-main textarea::placeholder{color:rgba(245,232,201,.6);} 
body.page-admin .admin-table td{color:var(--admin-text);} 
body.page-admin .site-footer{display:block!important;visibility:visible!important;opacity:1!important;position:fixed;left:0;bottom:0;z-index:9997;width:100%;margin-left:0;} 
@media (max-width:980px){body.page-admin .site-footer{margin-left:0;}}


.builder-toolbar{display:flex;gap:8px;flex-wrap:wrap}
.builder-blocks{display:grid;gap:14px;margin-top:16px}
.builder-block{padding:14px;border:1px solid var(--admin-border);border-radius:16px;background:rgba(255,255,255,.03)}
.builder-block-head{display:flex;justify-content:space-between;gap:10px;align-items:center;margin-bottom:10px}
.builder-block-actions{display:flex;gap:6px;flex-wrap:wrap}
.preview-block-card{padding:12px;border-radius:14px;background:rgba(255,255,255,.04);border:1px solid var(--admin-border-2);margin-bottom:10px}
.preview-block-card h4{margin:8px 0 6px}
.preview-badge{display:inline-flex;padding:4px 8px;border-radius:999px;background:rgba(217,164,76,.14);border:1px solid var(--admin-border);font-size:.8rem;text-transform:capitalize}
.preview-thumb{margin-top:8px;padding:8px 10px;border-radius:10px;background:rgba(255,255,255,.03);color:var(--admin-muted);font-size:.9rem}
.builder-hero .builder-copy,.builder-copy{line-height:1.7}
.builder-media{width:100%;height:auto;border-radius:14px;display:block}
.quote-source{opacity:.8;margin-top:8px}


/* Users page layout fix */
.admin-users-layout{
  display:grid;
  grid-template-columns:minmax(360px, 430px) minmax(0, 1fr);
  gap:18px;
  align-items:start;
}
.admin-users-layout > .content-card{min-width:0;}
.admin-users-layout .perm-grid{
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px;
}
.admin-users-layout .perm-item{
  min-width:0;
  align-items:center;
}
.admin-users-layout .perm-item span{
  display:block;
  line-height:1.35;
  word-break:break-word;
}
@media (max-width: 980px){
  .admin-users-layout{grid-template-columns:1fr;}
  .admin-users-layout .perm-grid{grid-template-columns:1fr;}
}


/* Keep admin content behaving like the front site shell */
body.page-admin .footer-inner{padding-left:24px;padding-right:24px;}
body.page-admin .content-area{min-height:100vh;}
