/* Night/Day themes + rounded tables */
:root[data-theme="night"]{
  --bg:#000; --bg2:#0a0a0a; --card:#0f0f0f; --text:#f0f0f0; --muted:#cfcfcf;
  --line:#1a1a1a; --accent:#ffffff; --tableHead:#121212; --tableStripe:#0b0b0b;
}
:root[data-theme="day"]{
  --bg:#fcf7e9; --bg2:#f6eed6; --card:#efe2c3; --text:#4a3826; --muted:#745c43;
  --line:#d8c9a8; --accent:#8b5e34; --tableHead:#e9dcb9; --tableStripe:#f5ecd4;
}
*{box-sizing:border-box} html,body{height:100%}
body{font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;margin:0;background:var(--bg);color:var(--text)}
a{color:var(--accent);text-decoration:none}
.container{max-width:1100px;margin:0 auto;padding:16px}
.grid{display:grid;grid-template-columns:2fr 1fr;gap:16px}
.card{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:16px;margin-bottom:12px;box-shadow:0 4px 18px rgba(0,0,0,.20)}
.header{display:flex;align-items:center;gap:12px;justify-content:space-between}
.theme-toggle button{padding:.5rem .75rem;border:1px solid var(--line);border-radius:999px;background:var(--bg2);color:var(--text);cursor:pointer}
.badge{display:inline-block;padding:.15rem .5rem;border-radius:999px;background:var(--bg2);border:1px solid var(--line);font-size:.8rem}
input, select, textarea, button{width:100%;padding:10px;margin-top:6px;border-radius:12px;border:1px solid var(--line);background:var(--bg2);color:var(--text)}
button{cursor:pointer}

/* Rounded tables */
.table-wrap{overflow:auto;border-radius:16px;border:1px solid var(--line);box-shadow:0 2px 10px rgba(0,0,0,.12)}
table{width:100%;border-collapse:separate;border-spacing:0}
thead th{background:var(--tableHead);text-align:left;padding:12px 14px;font-weight:600}
tbody td{padding:12px 14px;border-top:1px solid var(--line)}
tbody tr:nth-child(odd){background:var(--tableStripe)}
tbody tr:hover{filter:brightness(1.05)}
table th:first-child, table td:first-child{border-top-left-radius:16px}
table th:last-child, table td:last-child{border-top-right-radius:16px}

/* Live search dropdown */
.live-search-wrap{position:relative;max-width:420px;width:100%}
#live-results{position:absolute;top:100%;left:0;right:0;background:var(--card);border:1px solid var(--line);border-top:none;border-radius:0 0 12px 12px;max-height:320px;overflow:auto;display:none;z-index:9999}
#live-results .item{padding:10px;border-bottom:1px solid var(--line)}
#live-results .item:last-child{border-bottom:none}
#live-results .item a{display:block}

/* ENHANCED TABLES */
.table-wrap{margin-top:8px}
table thead th{position:sticky;top:0;z-index:1}
tbody tr{transition:transform .03s ease, box-shadow .12s ease}
tbody tr:hover{transform:translateY(-1px); box-shadow:0 2px 8px rgba(0,0,0,.15)}
.pagination a{display:inline-block;margin:2px 4px;padding:6px 10px;border-radius:999px;border:1px solid var(--line);background:var(--bg2);color:var(--text)}
.pagination a.active{font-weight:700}

/* DELUXE THEME */
:root{--radius:16px;--radius-lg:22px;--shadow:0 10px 30px rgba(0,0,0,.25)}
.container{max-width:1180px}
.header{padding:14px 0;border-bottom:1px solid var(--line)}
.brand{display:flex;align-items:center;gap:10px}
.brand .logo{width:36px;height:36px;border-radius:10px;background:linear-gradient(135deg,var(--accent),transparent)}

.btn{display:inline-flex;align-items:center;gap:8px;padding:.6rem .9rem;border-radius:999px;border:1px solid var(--line);background:var(--bg2);color:var(--text)}
.btn.primary{background:var(--accent);color:#000;border-color:var(--accent)}
.btn.ghost{background:transparent}

.card{border-radius:var(--radius-lg);box-shadow:var(--shadow)}
.card h2{margin:.2rem 0 0}
.meta{opacity:.8;font-size:.9rem}

.sidebar .card{position:sticky;top:18px}

.hero{border-radius:var(--radius-lg);padding:24px;background:linear-gradient(180deg,var(--bg2),transparent);border:1px solid var(--line);margin-bottom:16px}

input,select,textarea{border-radius:12px;border:1px solid var(--line);background:var(--bg2);padding:.75rem}
label{display:block;margin:.5rem 0 .2rem}

/* Tables */
.table-wrap{border-radius:18px;box-shadow:var(--shadow)}
thead th{position:sticky;top:0;z-index:2}
tbody tr{transition:transform .05s ease, box-shadow .18s ease, background .2s ease}
tbody tr:hover{transform:translateY(-1px);box-shadow:0 4px 14px rgba(0,0,0,.18)}
.pagination{margin-top:12px}
.pagination a{padding:8px 12px;border-radius:999px;border:1px solid var(--line)}

/* Admin layout helpers */
.admin-actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin:10px 0}
.badge{background:var(--bg2);border-color:var(--line)}
.alert{padding:.75rem 1rem;border:1px solid var(--line);border-radius:12px;margin:.5rem 0;background:var(--bg2)}
.alert.ok{border-color:rgba(0,200,0,.4)}
.alert.error{border-color:rgba(255,0,0,.4)}

/* Content blocks */
#blocks .block{border:1px dashed var(--line);border-radius:14px;padding:10px;margin:10px 0;background:var(--bg2);position:relative}
#blocks .handle{position:absolute;right:10px;top:10px;cursor:grab;font-size:18px;opacity:.8}
#blocks .block:focus-within{outline:2px solid var(--accent)}

/* ULTRA THEME (closer to guides-muonline.ru vibe) */
:root{--radius:14px;--radius-lg:18px;--shadow:0 12px 28px rgba(0,0,0,.22)}
body{font-family:"Inter",system-ui,Arial,sans-serif;line-height:1.45}
h1,h2,h3{font-family:"Montserrat",system-ui,Arial,sans-serif;letter-spacing:.2px}
h1{font-weight:800}
h2{font-weight:700}
h3{font-weight:700}

.container{max-width:1200px}
.header{border-bottom:none;padding:0}
.site-hero{
  background-image:url('./assets/header-bg.png');
  background-size:cover;background-position:center;
  padding:36px 0 26px;border-bottom:1px solid var(--line);
}
.site-hero .inner{display:flex;align-items:flex-end;justify-content:space-between;gap:16px}
.site-title{margin:0;font-size:2rem}
.site-sub{opacity:.85;margin:.25rem 0 0}

.grid{grid-template-columns:3fr 1.2fr}

.card{padding:14px 14px;border-radius:16px;margin-bottom:10px}
.card h2{font-size:1.05rem;margin:.1rem 0 .15rem}
.meta{opacity:.8;font-size:.85rem;margin:.15rem 0 .35rem}
.tight p{margin:.25rem 0}

.list-tight article.card{padding:12px 12px}
.list-tight .meta{font-size:.8rem}
.list-tight .card p{font-size:.95rem}

.chips{display:flex;flex-wrap:wrap;gap:6px;margin:.4rem 0}
.chip{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:999px;border:1px solid var(--line);background:var(--bg2);font-size:.8rem;white-space:nowrap}
.chip a{color:inherit}
.chip .dot{width:8px;height:8px;border-radius:50%;background:var(--accent);opacity:.8}

.sidebar h3{margin-top:.5rem}
.sidebar .table-wrap{border-radius:14px}

.pagination a{padding:6px 10px;font-size:.9rem}
a.more{font-weight:600}
