*{box-sizing:border-box}
:root{--bg:#f5f7fb;--panel:#fff;--text:#172033;--muted:#6b7280;--line:#e7ebf2;--primary:#2563eb;--primary-dark:#1d4ed8;--soft:#eff6ff;--danger:#dc2626;--shadow:0 8px 28px rgba(15,23,42,.06)}
html{font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;background:var(--bg);color:var(--text)}
body{margin:0;min-height:100vh;background:var(--bg)}
button,input,textarea{font:inherit}
button{cursor:pointer}
a{text-decoration:none;color:inherit}
.app-shell{min-height:100vh}
.topbar{height:70px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 32px;position:sticky;top:0;z-index:20}
.brand{display:flex;align-items:center;gap:12px}.brand-mark{width:42px;height:42px;border-radius:12px;background:linear-gradient(135deg,#2563eb,#4f46e5);color:#fff;display:grid;place-items:center;font-size:13px;font-weight:800;letter-spacing:.5px;box-shadow:0 5px 14px rgba(37,99,235,.22)}.brand-mark.small{width:38px;height:38px;border-radius:10px}
.brand-title{font-size:15px;font-weight:750}.brand-caption{font-size:11px;color:var(--muted);margin-top:2px}.top-actions{display:flex;align-items:center;gap:8px}.admin-chip{font-size:12px;font-weight:650;background:#f0fdf4;color:#166534;border:1px solid #dcfce7;padding:7px 10px;border-radius:999px}.status-dot{display:inline-block;width:6px;height:6px;background:#22c55e;border-radius:50%;margin-right:5px}.top-link{font-size:13px;color:#475569;padding:8px 10px;border-radius:8px}.top-link:hover{background:#f8fafc;color:#111827}
.main-content{max-width:1280px;margin:0 auto;padding:30px 28px 50px}
.hero{background:linear-gradient(135deg,#172554 0%,#1e40af 55%,#2563eb 100%);border-radius:18px;padding:27px 30px;color:#fff;display:flex;align-items:center;justify-content:space-between;gap:24px;box-shadow:0 12px 30px rgba(30,64,175,.18)}.eyebrow{font-size:10px;letter-spacing:1.5px;font-weight:800;opacity:.75;margin-bottom:6px}.hero h1{margin:0;font-size:27px;line-height:1.2;letter-spacing:-.5px}.hero p{margin:7px 0 0;color:#dbeafe;font-size:13px}.hero-actions{display:flex;gap:9px;flex-shrink:0}
.btn{border:1px solid transparent;border-radius:9px;padding:10px 14px;font-size:13px;font-weight:700;display:inline-flex;align-items:center;justify-content:center;gap:6px;transition:.18s ease}.btn:hover{transform:translateY(-1px)}.btn-primary{background:var(--primary);color:#fff;box-shadow:0 4px 12px rgba(37,99,235,.2)}.btn-primary:hover{background:var(--primary-dark)}.hero .btn-primary{background:#fff;color:#1d4ed8}.hero .btn-primary:hover{background:#eff6ff}.btn-light{background:rgba(255,255,255,.1);color:#fff;border-color:rgba(255,255,255,.25)}.btn-light:hover{background:rgba(255,255,255,.17)}.btn-secondary{background:#fff;border-color:#dbe1ea;color:#334155}.btn-secondary:hover{background:#f8fafc}.btn-block{width:100%;padding:12px}
.stats-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:13px;margin:17px 0}.stat-card{background:#fff;border:1px solid var(--line);border-radius:13px;padding:16px 17px;display:flex;align-items:center;gap:12px;box-shadow:var(--shadow)}.stat-icon{width:35px;height:35px;border-radius:10px;background:var(--soft);color:#2563eb;display:grid;place-items:center;font-weight:800}.stat-card strong{display:block;font-size:19px;line-height:1.1}.stat-card span:last-child{font-size:11px;color:var(--muted);display:block;margin-top:3px}
.panel,.advanced-panel,.help-panel{background:#fff;border:1px solid var(--line);border-radius:15px;box-shadow:var(--shadow)}.panel{overflow:hidden}.panel-head{padding:19px 20px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:center;gap:18px}.panel-head h2{font-size:16px;margin:0}.panel-head p{font-size:12px;color:var(--muted);margin:4px 0 0}.panel-tools{display:flex;gap:9px;align-items:center}.search-box{height:38px;width:230px;border:1px solid #dfe4ec;border-radius:9px;display:flex;align-items:center;padding:0 10px;color:#94a3b8;background:#fff}.search-box input{border:0;outline:0;width:100%;padding:0 0 0 7px;font-size:12px;color:var(--text);background:transparent}.list-header{display:grid;grid-template-columns:minmax(0,1fr) 110px 110px;padding:9px 18px;background:#fafbfc;color:#94a3b8;font-size:10px;font-weight:750;text-transform:uppercase;letter-spacing:.7px;border-bottom:1px solid var(--line)}
.content-list{padding:8px 12px 13px}.category-row{border:1px solid #e4e8ef;border-radius:11px;margin:6px 0;background:#fff;overflow:hidden}.category-row.is-open{border-color:#cbd5e1}.category-head,.subcategory-head{min-height:60px;display:grid;grid-template-columns:30px 36px minmax(0,1fr) 48px 94px;align-items:center;padding:7px 10px;gap:7px}.category-head:hover,.subcategory-head:hover{background:#fafcff}.expand-btn{width:28px;height:28px;border:0;background:transparent;border-radius:7px;color:#64748b;display:grid;place-items:center;font-size:23px;line-height:1;transition:.18s}.is-open>.category-head .expand-btn .chevron,.is-open>.subcategory-head .expand-btn .chevron{transform:rotate(90deg)}.chevron{display:block;transition:.18s}.node-icon{width:30px;height:30px;border-radius:8px;display:grid;place-items:center;font-size:13px;font-weight:800}.category-icon{background:#eff6ff;color:#2563eb}.sub-icon{background:#f5f3ff;color:#7c3aed}.node-title{font-size:13px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.node-meta{font-size:10px;color:#94a3b8;margin-top:3px}.row-count{font-size:11px;color:#64748b;background:#f8fafc;border:1px solid #edf0f4;border-radius:7px;text-align:center;padding:5px 4px}.row-actions{display:flex;justify-content:flex-end;gap:3px}.icon-btn{width:29px;height:29px;border:0;border-radius:7px;background:transparent;color:#64748b;font-size:15px}.icon-btn:hover{background:#eef2f7;color:#1e293b}.icon-btn.danger:hover{background:#fef2f2;color:var(--danger)}
.category-body{padding:0 13px 14px 67px;border-top:1px solid #edf0f4;background:#fbfcfe}.edit-fields{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:13px 0}.edit-fields label{display:block}.edit-fields label.wide{grid-column:span 1}.edit-fields label span,.item-fields label span{display:block;font-size:10px;font-weight:700;color:#64748b;margin:0 0 5px}.edit-fields input,.item-fields input{width:100%;height:35px;border:1px solid #dfe4ec;border-radius:7px;padding:0 9px;outline:0;background:#fff;color:#172033;font-size:12px}.edit-fields input:focus,.item-fields input:focus{border-color:#93c5fd;box-shadow:0 0 0 3px rgba(59,130,246,.09)}.section-line{display:flex;justify-content:space-between;align-items:center;border-top:1px solid #edf0f4;padding:12px 0 7px;font-size:10px;font-weight:800;color:#64748b;text-transform:uppercase;letter-spacing:.6px}.mini-btn{border:1px solid #dbe3ee;background:#fff;color:#2563eb;border-radius:7px;font-size:10px;font-weight:750;padding:6px 8px}.mini-btn:hover{background:#eff6ff}.sub-list{display:flex;flex-direction:column;gap:6px}.subcategory-row{border:1px solid #e7eaf0;border-radius:9px;background:#fff;overflow:hidden}.subcategory-head{grid-template-columns:27px 32px minmax(0,1fr) 44px 90px;min-height:52px;padding:6px 9px}.subcategory-body{padding:0 12px 11px 59px;border-top:1px solid #edf0f4;background:#fdfdff}.subcategory-body .edit-fields{padding-bottom:8px}.item-list{display:flex;flex-direction:column;gap:5px}.item-row{display:grid;grid-template-columns:30px minmax(0,1fr) 30px;align-items:center;gap:8px;padding:8px;background:#f8fafc;border:1px solid #e8ecf2;border-radius:8px}.item-number{font-size:10px;font-weight:800;color:#94a3b8;text-align:center}.item-fields{display:grid;grid-template-columns:.8fr 1.2fr;gap:8px}.item-fields input{height:32px}.item-fields label span{margin-bottom:3px}.item-delete{align-self:center}.add-resource-row{width:100%;margin-top:6px;border:1px dashed #cbd5e1;background:#fff;color:#64748b;border-radius:8px;padding:8px;font-size:10px;font-weight:750}.add-resource-row:hover{border-color:#93c5fd;background:#eff6ff;color:#2563eb}.add-resource-row span{font-size:14px;margin-right:4px}.inline-empty{padding:11px;border:1px dashed #dce2ea;border-radius:8px;color:#94a3b8;font-size:11px;text-align:center}
.empty-state{padding:50px 20px;text-align:center;color:#94a3b8}.empty-icon{font-size:28px;margin-bottom:7px}.empty-state strong{display:block;color:#475569;font-size:13px}.empty-state span{font-size:11px}
.advanced-panel{margin-top:14px}.advanced-panel summary{list-style:none;cursor:pointer;padding:14px 17px;display:flex;justify-content:space-between;align-items:center;font-size:12px;font-weight:750}.advanced-panel summary::-webkit-details-marker{display:none}.advanced-panel summary small{font-size:10px;color:#94a3b8;font-weight:500}.advanced-body{border-top:1px solid var(--line);padding:13px}.advanced-body textarea{width:100%;height:270px;resize:vertical;border:1px solid #dfe4ec;border-radius:9px;padding:12px;outline:0;background:#0f172a;color:#dbeafe;font:11px/1.55 ui-monospace,SFMono-Regular,Menlo,monospace}.advanced-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:9px}
.help-panel{margin-top:14px;padding:15px 17px;display:flex;gap:11px;align-items:flex-start}.help-icon{width:25px;height:25px;border-radius:50%;background:#eff6ff;color:#2563eb;display:grid;place-items:center;font-weight:800;font-size:12px;flex:none}.help-panel strong{font-size:12px}.help-panel p{font-size:11px;color:#64748b;line-height:1.6;margin:4px 0 0}.help-panel code{background:#f1f5f9;padding:2px 4px;border-radius:4px;color:#334155}
.toast{position:fixed;right:22px;bottom:22px;background:#111827;color:#fff;border-radius:10px;padding:11px 14px;display:flex;align-items:center;gap:8px;font-size:12px;font-weight:650;box-shadow:0 10px 30px rgba(15,23,42,.2);opacity:0;transform:translateY(12px);pointer-events:none;transition:.22s;z-index:100}.toast.show{opacity:1;transform:translateY(0)}.toast-icon{width:20px;height:20px;border-radius:50%;display:grid;place-items:center;background:#22c55e;color:#052e16;font-size:11px}
.login-page{min-height:100vh;display:grid;place-items:center;padding:25px;background:radial-gradient(circle at top,#dbeafe 0,#f5f7fb 42%,#eef2ff 100%)}.login-card{width:min(410px,100%);background:#fff;border:1px solid #e4e8ef;border-radius:18px;padding:34px;box-shadow:0 18px 50px rgba(30,41,59,.1)}.login-card .brand-mark{margin:0 auto 16px}.login-card .eyebrow{text-align:center;color:#64748b}.login-card h1{text-align:center;font-size:23px;margin:4px 0}.login-subtitle{text-align:center;color:#64748b;font-size:12px;line-height:1.6;margin:8px 0 22px}.field-label{display:block;font-size:11px;font-weight:750;color:#475569;margin:12px 0 6px}.login-card input{width:100%;height:42px;border:1px solid #dbe2eb;border-radius:8px;padding:0 11px;outline:0}.login-card input:focus{border-color:#93c5fd;box-shadow:0 0 0 3px rgba(59,130,246,.1)}.login-card .btn{margin-top:17px}.login-error{background:#fef2f2;color:#b91c1c;border:1px solid #fecaca;padding:9px 10px;border-radius:8px;font-size:11px;margin-bottom:13px}.login-footer{text-align:center;color:#94a3b8;font-size:10px;margin-top:17px}
@media(max-width:900px){.hero{align-items:flex-start;flex-direction:column}.hero-actions{width:100%}.hero-actions .btn{flex:1}.stats-grid{grid-template-columns:repeat(2,1fr)}.panel-head{align-items:stretch;flex-direction:column}.panel-tools{width:100%}.search-box{flex:1}.category-body{padding-left:25px}.subcategory-body{padding-left:25px}}
@media(max-width:640px){.topbar{padding:0 15px}.top-link{display:none}.main-content{padding:18px 12px 35px}.brand-caption{display:none}.hero{padding:21px;border-radius:14px}.hero h1{font-size:22px}.hero-actions{flex-direction:column}.stats-grid{gap:8px}.stat-card{padding:12px}.list-header{display:none}.content-list{padding:6px}.category-head,.subcategory-head{grid-template-columns:27px 31px minmax(0,1fr) 31px;gap:5px}.category-head .row-actions,.subcategory-head .row-actions{display:none}.category-head .row-count,.subcategory-head .row-count{grid-column:4}.category-body,.subcategory-body{padding-left:12px;padding-right:12px}.edit-fields,.item-fields{grid-template-columns:1fr}.edit-fields label.wide{grid-column:auto}.item-row{grid-template-columns:25px minmax(0,1fr) 30px}.panel-tools{flex-direction:column}.search-box{width:100%;height:36px}.panel-tools .btn{width:100%}.top-actions .admin-chip{display:none}}
