/* Shree Building Solutions — Admin */
:root{
  --bg:#F3F4F0; --paper:#FFFFFF; --soft:#F7F8F5; --line:rgba(30,36,39,.12); --line-2:rgba(30,36,39,.2);
  --ink:#1E2427; --ink-soft:#5A646A; --muted:#8A949A;
  --brand:#D7141B; --epoxy:#1F7A5A; --safety:#F5C518; --water:#2C6BD6; --danger:#C62828;
  --radius:14px; --ease:cubic-bezier(.2,.8,.2,1);
  --shadow:0 1px 2px rgba(30,36,39,.04),0 10px 30px -18px rgba(30,36,39,.25);
}
*{box-sizing:border-box;margin:0;padding:0}
html{-webkit-text-size-adjust:100%}
body{font-family:"Archivo",system-ui,-apple-system,"Segoe UI",sans-serif;background:var(--bg);color:var(--ink);font-size:15.5px;line-height:1.5;-webkit-font-smoothing:antialiased}
a{color:inherit}
button,input,textarea,select{font:inherit;color:inherit}
button{cursor:pointer;background:none;border:0}
img{display:block;max-width:100%}
:focus-visible{outline:3px solid var(--water);outline-offset:2px;border-radius:6px}
.hidden{display:none!important}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}

/* buttons */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:42px;padding:0 16px;border-radius:11px;font-weight:650;font-size:14.5px;text-decoration:none;white-space:nowrap;transition:background .2s,box-shadow .2s,transform .15s,opacity .2s;border:1px solid transparent}
.btn:active{transform:translateY(1px)}
.btn svg{width:18px;height:18px;flex:none}
.btn-primary{background:var(--ink);color:#fff}
.btn-primary:hover{background:#000}
.btn-accent{background:var(--epoxy);color:#fff}
.btn-accent:hover{background:#17654a}
.btn-ghost{background:var(--paper);border-color:var(--line-2)}
.btn-ghost:hover{border-color:var(--ink)}
.btn-danger{color:var(--danger);background:transparent;border-color:rgba(198,40,40,.3)}
.btn-danger:hover{background:rgba(198,40,40,.06)}
.btn-sm{height:34px;padding:0 12px;font-size:13.5px;border-radius:9px}
.btn[disabled]{opacity:.55;pointer-events:none}
.btn .spin{width:16px;height:16px;border-radius:50%;border:2px solid currentColor;border-right-color:transparent;animation:spin .7s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.icon-btn{width:36px;height:36px;border-radius:9px;display:grid;place-items:center;color:var(--ink-soft);transition:background .2s,color .2s}
.icon-btn:hover{background:var(--soft);color:var(--ink)}
.icon-btn svg{width:18px;height:18px}

/* top bar */
.topbar{position:sticky;top:0;z-index:20;background:rgba(255,255,255,.88);backdrop-filter:blur(12px);border-bottom:1px solid var(--line)}
.topbar .in{max-width:1240px;margin:0 auto;padding:0 24px;height:64px;display:flex;align-items:center;gap:14px}
.brand{display:flex;align-items:center;gap:10px;text-decoration:none;margin-right:auto;min-width:0}
.brand img{height:36px;width:auto}
.brand b{color:#0B2E5E}
.brand b{font-weight:800;font-size:16px;letter-spacing:-.01em;white-space:nowrap}
.brand span{font-size:12px;color:var(--ink-soft);display:block;line-height:1.1}
.who{display:flex;align-items:center;gap:8px;font-size:13.5px;color:var(--ink-soft)}
.avatar{width:32px;height:32px;border-radius:50%;background:var(--ink);color:#fff;display:grid;place-items:center;font-weight:700;font-size:13px;text-transform:uppercase}

.page{max-width:1240px;margin:0 auto;padding:28px 24px 80px}
.page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:22px}
.page-head h1{font-size:clamp(26px,3vw,34px);font-weight:850;letter-spacing:-.02em;line-height:1.05}
.page-head p{color:var(--ink-soft);margin-top:4px}

/* stats */
.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-bottom:20px}
.stat{background:var(--paper);border:1px solid var(--line);border-radius:var(--radius);padding:16px 18px;display:flex;align-items:center;gap:14px}
.stat i{width:40px;height:40px;border-radius:11px;display:grid;place-items:center;font-style:normal}
.stat i svg{width:20px;height:20px}
.stat b{display:block;font-size:24px;font-weight:850;line-height:1}
.stat span{font-size:13px;color:var(--ink-soft)}

/* toolbar */
.toolbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:14px}
.search{flex:1 1 240px;position:relative}
.search input{width:100%;height:42px;border:1px solid var(--line-2);border-radius:11px;background:var(--paper);padding:0 14px 0 40px}
.search svg{position:absolute;left:13px;top:12px;width:18px;height:18px;color:var(--muted)}
.seg{display:inline-flex;background:var(--paper);border:1px solid var(--line-2);border-radius:11px;padding:3px;gap:2px}
.seg button{height:34px;padding:0 13px;border-radius:8px;font-size:13.5px;font-weight:650;color:var(--ink-soft)}
.seg button[aria-pressed="true"]{background:var(--ink);color:#fff}

/* post list */
.list{display:grid;gap:10px}
.row{display:grid;grid-template-columns:120px 1fr auto;gap:18px;align-items:center;background:var(--paper);border:1px solid var(--line);border-radius:var(--radius);padding:12px;transition:box-shadow .25s,border-color .25s}
.row:hover{box-shadow:var(--shadow);border-color:var(--line-2)}
.thumb{width:120px;aspect-ratio:16/10;border-radius:10px;background:var(--soft) center/cover no-repeat;border:1px solid var(--line);display:grid;place-items:center;color:var(--muted)}
.thumb svg{width:22px;height:22px}
.row h3{font-size:16.5px;font-weight:750;line-height:1.25;margin-bottom:3px}
.row h3 a{text-decoration:none}
.row h3 a:hover{text-decoration:underline}
.row p{color:var(--ink-soft);font-size:14px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.meta{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-top:7px;font-size:12.5px;color:var(--muted)}
.pill{display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:700;padding:3px 9px;border-radius:999px}
.pill::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor}
.pill.published{background:rgba(31,122,90,.1);color:var(--epoxy)}
.pill.draft{background:rgba(245,197,24,.18);color:#8a6a00}
.actions{display:flex;gap:4px;align-items:center}

.empty{text-align:center;background:var(--paper);border:1px dashed var(--line-2);border-radius:18px;padding:56px 20px}
.empty svg{width:56px;height:56px;margin:0 auto 14px;color:var(--epoxy)}
.empty h3{font-size:20px;font-weight:800;margin-bottom:6px}
.empty p{color:var(--ink-soft);margin-bottom:18px}
.skel{height:96px;border-radius:var(--radius);background:linear-gradient(90deg,#eceee9 25%,#f6f7f3 50%,#eceee9 75%);background-size:200% 100%;animation:sk 1.2s infinite}
@keyframes sk{to{background-position:-200% 0}}

/* editor */
.editor-bar .in{gap:10px}
.back{display:inline-flex;align-items:center;gap:6px;font-weight:650;font-size:14px;text-decoration:none;color:var(--ink-soft);margin-right:auto}
.back:hover{color:var(--ink)}
.save-state{font-size:12.5px;color:var(--muted);white-space:nowrap}
.grid{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:22px;align-items:start}
.card{background:var(--paper);border:1px solid var(--line);border-radius:18px;padding:20px}
.card + .card{margin-top:16px}
.card h4{font-size:13px;font-weight:750;letter-spacing:.06em;text-transform:uppercase;color:var(--ink-soft);margin-bottom:12px}
.field{margin-bottom:18px}
.field:last-child{margin-bottom:0}
.label{display:flex;justify-content:space-between;align-items:baseline;font-size:13.5px;font-weight:650;margin-bottom:7px}
.label small{font-weight:500;color:var(--muted)}
.input,.textarea{width:100%;border:1px solid var(--line-2);border-radius:11px;background:var(--paper);padding:11px 13px;transition:border-color .2s,box-shadow .2s}
.input:focus,.textarea:focus{outline:0;border-color:var(--ink);box-shadow:0 0 0 3px rgba(30,36,39,.08)}
.title-input{resize:none;overflow:hidden;line-height:1.15;display:block;font-size:clamp(22px,2.6vw,30px);font-weight:820;letter-spacing:-.015em;border:0;padding:4px 0;border-bottom:2px solid var(--line);border-radius:0}
.title-input:focus{box-shadow:none;border-color:var(--ink)}
.slug{display:flex;align-items:center;gap:4px;font-size:13px;color:var(--muted);margin-top:8px;flex-wrap:wrap}
.slug input{border:0;border-bottom:1px dashed var(--line-2);background:transparent;padding:2px 0;color:var(--ink);font-size:13px;min-width:120px;flex:1}
.slug input:focus{outline:0;border-bottom-color:var(--ink)}
.textarea{resize:vertical;min-height:84px;line-height:1.55}
.err{color:var(--danger);font-size:13px;margin-top:6px}
.has-err .input,.has-err .textarea,.has-err .drop{border-color:var(--danger)!important}

.md-tools{display:flex;gap:2px;flex-wrap:wrap;align-items:center;border:1px solid var(--line-2);border-bottom:0;border-radius:11px 11px 0 0;padding:5px;background:var(--soft)}
.md-tools button{height:32px;min-width:34px;padding:0 8px;border-radius:7px;font-weight:700;font-size:13.5px;color:var(--ink-soft);display:inline-flex;align-items:center;justify-content:center;gap:5px}
.md-tools button:hover{background:#fff;color:var(--ink)}
.md-tools svg{width:17px;height:17px}
.md-tools .sep{width:1px;height:20px;background:var(--line-2);margin:0 4px}
.md-tools .tabs{margin-left:auto;display:inline-flex;background:#fff;border:1px solid var(--line);border-radius:8px;padding:2px}
.md-tools .tabs button{height:28px}
.md-tools .tabs button[aria-pressed="true"]{background:var(--ink);color:#fff}
.body-area{border-radius:0 0 11px 11px;min-height:420px;font-family:ui-monospace,"SF Mono",Menlo,Consolas,monospace;font-size:14.5px;line-height:1.7;resize:vertical}
.preview{border:1px solid var(--line-2);border-radius:0 0 11px 11px;min-height:420px;padding:22px 24px;background:#fff}
.hint{font-size:12.5px;color:var(--muted);margin-top:8px}
.hint code{background:var(--soft);padding:1px 5px;border-radius:5px}

/* prose (preview) */
.prose{font-size:16.5px;line-height:1.75;color:#2a3135}
.prose > * + *{margin-top:1em}
.prose h2{font-size:1.6em;line-height:1.2;font-weight:820;letter-spacing:-.015em;margin-top:1.4em}
.prose h3{font-size:1.25em;font-weight:780;margin-top:1.3em}
.prose h4{font-size:1.05em;font-weight:750}
.prose a{color:var(--water)}
.prose ul,.prose ol{padding-left:1.3em}
.prose li + li{margin-top:.35em}
.prose blockquote{border-left:4px solid var(--safety);padding:.3em 0 .3em 1em;color:var(--ink-soft);font-size:1.08em}
.prose code{background:var(--soft);padding:.1em .35em;border-radius:5px;font-size:.9em}
.prose figure img{border-radius:12px;width:100%}
.prose figcaption{font-size:.85em;color:var(--muted);margin-top:.4em;text-align:center}
.prose hr{border:0;border-top:1px solid var(--line);margin:2em 0}

/* cover drop */
.drop{position:relative;border:2px dashed var(--line-2);border-radius:14px;background:var(--soft);aspect-ratio:16/10;display:grid;place-items:center;text-align:center;padding:16px;cursor:pointer;transition:border-color .2s,background .2s;overflow:hidden}
.drop:hover,.drop.over{border-color:var(--epoxy);background:rgba(31,122,90,.05)}
.drop svg{width:34px;height:34px;color:var(--epoxy);margin:0 auto 8px}
.drop b{display:block;font-size:14.5px}
.drop span{font-size:12.5px;color:var(--muted)}
.drop img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.drop .prog{position:absolute;left:0;bottom:0;height:4px;background:var(--epoxy);width:0;transition:width .2s}
.drop.has-img{border-style:solid;border-color:var(--line)}
.cover-actions{display:flex;gap:8px;margin-top:10px}
.info{display:grid;gap:8px;font-size:13.5px}
.info div{display:flex;justify-content:space-between;gap:10px}
.info span{color:var(--muted)}
.status-switch{display:grid;grid-template-columns:1fr 1fr;background:var(--soft);border:1px solid var(--line);border-radius:11px;padding:3px;gap:3px}
.status-switch button{height:36px;border-radius:8px;font-weight:650;font-size:13.5px;color:var(--ink-soft)}
.status-switch button[aria-pressed="true"]{background:#fff;color:var(--ink);box-shadow:0 1px 3px rgba(0,0,0,.08)}

/* toast + dialog */
.toasts{position:fixed;left:50%;bottom:22px;transform:translateX(-50%);z-index:100;display:grid;gap:8px;width:min(92vw,420px)}
.toast{background:var(--ink);color:#fff;border-radius:12px;padding:12px 16px;font-size:14px;box-shadow:0 12px 30px rgba(0,0,0,.25);display:flex;gap:10px;align-items:center;animation:tin .3s var(--ease)}
.toast.err{background:var(--danger)}
.toast.ok::before{content:"✓";font-weight:800;color:#6BE3A4}
@keyframes tin{from{opacity:0;transform:translateY(10px)}}
dialog{border:0;border-radius:18px;padding:24px;width:min(92vw,420px);box-shadow:0 30px 80px rgba(0,0,0,.3)}
dialog::backdrop{background:rgba(20,24,27,.45);backdrop-filter:blur(2px)}
dialog h3{font-size:19px;font-weight:800;margin-bottom:6px}
dialog p{color:var(--ink-soft);margin-bottom:20px}
dialog .row-btns{display:flex;justify-content:flex-end;gap:8px}

/* login */
.login-wrap{min-height:100svh;display:grid;grid-template-columns:1.1fr .9fr}
.login-art{background:#1E2427;color:#fff;position:relative;overflow:hidden;display:flex;flex-direction:column;justify-content:space-between;padding:40px}
.login-art h2{font-size:clamp(28px,3.4vw,46px);font-weight:850;letter-spacing:-.02em;line-height:1.02;max-width:14ch}
.login-art p{color:#AEB8BD;max-width:40ch;margin-top:12px}
.login-art .stripes{position:absolute;right:-60px;bottom:-60px;width:380px;height:380px;opacity:.9}
.login-art .logo-chip{background:#fff;border-radius:12px;padding:8px 10px;display:inline-flex;align-self:flex-start}
.login-art .logo-chip img{height:40px}
.login-form{display:grid;place-items:center;padding:40px 24px;background:var(--bg)}
.login-card{width:min(100%,380px)}
.login-card h1{font-size:28px;font-weight:850;letter-spacing:-.02em;margin-bottom:4px}
.login-card > p{color:var(--ink-soft);margin-bottom:26px}
.login-card .btn{width:100%;height:48px;font-size:15.5px}
.pw{position:relative}
.pw .icon-btn{position:absolute;right:4px;top:4px}
.alert{background:rgba(198,40,40,.08);color:var(--danger);border:1px solid rgba(198,40,40,.25);border-radius:11px;padding:10px 12px;font-size:14px;margin-bottom:16px}

@media (max-width:980px){
  .grid{grid-template-columns:1fr}
  .side{order:-1}
}
@media (max-width:760px){
  .login-wrap{grid-template-columns:1fr}
  .login-art{display:none}
  .topbar .in{padding:0 14px;gap:8px}
  .brand span,.who .name{display:none}
  .page{padding:20px 14px 70px}
  .stats{grid-template-columns:repeat(3,1fr);gap:8px}
  .stat{padding:12px;gap:10px}
  .stat i{display:none}
  .row{grid-template-columns:84px 1fr;gap:12px}
  .thumb{width:84px}
  .actions{grid-column:1/-1;justify-content:flex-end;border-top:1px solid var(--line);padding-top:8px}
  .hide-sm{display:none}
  .body-area,.preview{min-height:320px}
}
