/* =====================================================================
   Admin control panel styles
   ===================================================================== */
:root {
  --a-bg: #f6f1ef;
  --a-side: #4d0712;
  --a-side-2: #6b0a16;
  --a-card: #ffffff;
  --a-line: #ecd9d6;
  --a-ink: #2a1416;
  --a-mut: #7a565a;
  --a-ruby: #c2153a;
  --a-gold: #c9a36a;
  --a-shadow: 0 14px 40px rgba(107,10,22,.10);
}
* { box-sizing: border-box; }
body.admin {
  margin: 0; font-family: "Jost", system-ui, sans-serif; color: var(--a-ink);
  background: var(--a-bg); display: grid; grid-template-columns: 264px 1fr; min-height: 100vh;
}

/* Sidebar */
.a-side { background: linear-gradient(180deg, var(--a-side-2), var(--a-side)); color: #fff; padding: 1.6rem 1.1rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.a-brand { display: flex; align-items: center; gap: .7rem; padding: .3rem .4rem 1.4rem; border-bottom: 1px solid rgba(255,255,255,.12); margin-bottom: 1rem; }
.a-brand .mk { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--a-ruby), #ff5a76); display: grid; place-items: center; font-family: "Fraunces", serif; }
.a-brand b { font-family: "Fraunces", serif; font-weight: 500; font-size: 1.05rem; line-height: 1.1; }
.a-nav { display: grid; gap: .25rem; }
.a-nav a { display: flex; align-items: center; gap: .8rem; padding: .8rem .9rem; border-radius: 12px; color: rgba(255,255,255,.82); font-size: .92rem; text-decoration: none; transition: background .2s, color .2s; }
.a-nav a .ic { width: 20px; text-align: center; }
.a-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.a-nav a.active { background: rgba(255,255,255,.16); color: #fff; }
.a-nav .sep { margin: .8rem .4rem .4rem; font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; color: rgba(255,255,255,.45); }
.a-side .logout { margin-top: 1rem; }
.a-side .logout a { color: var(--a-gold); }

/* Main */
.a-main { padding: 2rem clamp(1.2rem, 3vw, 2.6rem); }
.a-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.8rem; gap: 1rem; flex-wrap: wrap; }
.a-top h1 { font-family: "Fraunces", serif; font-weight: 400; color: var(--a-side); font-size: 2rem; margin: 0; }
.a-top .who { color: var(--a-mut); font-size: .9rem; }

/* Cards / stats */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1.1rem; margin-bottom: 2rem; }
.stat { background: var(--a-card); border: 1px solid var(--a-line); border-radius: 16px; padding: 1.4rem 1.5rem; box-shadow: var(--a-shadow); }
.stat .n { font-family: "Fraunces", serif; font-size: 2.2rem; color: var(--a-ruby); line-height: 1; }
.stat .l { color: var(--a-mut); font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; margin-top: .5rem; }

.card { background: var(--a-card); border: 1px solid var(--a-line); border-radius: 16px; box-shadow: var(--a-shadow); padding: 1.6rem; margin-bottom: 1.6rem; }
.card h2 { font-family: "Fraunces", serif; font-weight: 400; color: var(--a-side); font-size: 1.35rem; margin: 0 0 1.1rem; }
.card .card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.1rem; gap: 1rem; flex-wrap: wrap; }
.card .card-head h2 { margin: 0; }

/* Tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th, table.data td { padding: .8rem .9rem; text-align: left; border-bottom: 1px solid var(--a-line); vertical-align: middle; }
table.data th { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--a-mut); font-weight: 600; }
table.data tr:hover td { background: #fbf6f4; }
.badge { display: inline-block; padding: .25rem .7rem; border-radius: 999px; font-size: .74rem; font-weight: 600; letter-spacing: .03em; }
.badge.pending   { background: #fff4e5; color: #b45309; }
.badge.confirmed { background: #ecfdf3; color: #067647; }
.badge.rejected  { background: #fef3f2; color: #b42318; }
.badge.cancelled { background: #f3f0f0; color: #6f6f6f; }

/* Buttons (admin) */
.btn { display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; font-family: inherit; font-size: .88rem; font-weight: 500; padding: .6rem 1.1rem; border-radius: 10px; border: 1.5px solid transparent; text-decoration: none; transition: transform .2s, box-shadow .2s, background .2s; }
.btn-sm { padding: .42rem .8rem; font-size: .8rem; }
.btn-primary { background: linear-gradient(135deg, var(--a-side-2), var(--a-ruby)); color: #fff; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(194,21,58,.3); }
.btn-ok { background: #16a34a; color: #fff; } .btn-ok:hover { background: #11823b; }
.btn-danger { background: #fff; color: #b42318; border-color: #fda29b; } .btn-danger:hover { background: #b42318; color: #fff; }
.btn-light { background: #fff; color: var(--a-side); border-color: var(--a-line); } .btn-light:hover { background: #fbf2f3; }
.btn-gold { background: linear-gradient(135deg, var(--a-gold), #b58a4e); color: #3a2410; }
.actions-inline { display: flex; gap: .4rem; flex-wrap: wrap; }

/* Forms */
.form-row { display: grid; gap: 1.1rem; grid-template-columns: repeat(2, 1fr); }
.form-row.one { grid-template-columns: 1fr; }
.fld { margin-bottom: 1.1rem; }
.fld label { display: block; font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; color: var(--a-mut); margin-bottom: .45rem; font-weight: 600; }
.fld input, .fld textarea, .fld select { width: 100%; font-family: inherit; font-size: .95rem; padding: .7rem .9rem; border: 1.5px solid var(--a-line); border-radius: 10px; background: #fdf9f8; color: var(--a-ink); }
.fld input:focus, .fld textarea:focus, .fld select:focus { outline: none; border-color: var(--a-ruby); box-shadow: 0 0 0 4px rgba(194,21,58,.1); }
.fld .hint { font-size: .78rem; color: var(--a-mut); margin-top: .35rem; }
.switch { display: inline-flex; align-items: center; gap: .7rem; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch .track { width: 46px; height: 26px; border-radius: 999px; background: #d8c9c6; position: relative; transition: background .25s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .25s; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.switch input:checked + .track { background: #16a34a; }
.switch input:checked + .track::after { transform: translateX(20px); }

/* Image management */
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .9rem; }
.img-tile { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 1; border: 1px solid var(--a-line); background: #faf3f1; }
.img-tile img { width: 100%; height: 100%; object-fit: cover; }
.img-tile .del { position: absolute; top: .4rem; right: .4rem; background: rgba(180,35,24,.92); color: #fff; border: 0; border-radius: 8px; width: 28px; height: 28px; cursor: pointer; }
.post-row { display: flex; gap: 1rem; align-items: center; }
.post-thumb { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; border: 1px solid var(--a-line); flex: none; }

/* Login page */
body.login { display: grid; place-items: center; min-height: 100vh; background:
  radial-gradient(50rem 40rem at 80% 0%, rgba(255,90,118,.4), transparent 60%),
  linear-gradient(150deg, var(--a-side), var(--a-ruby)); }
.login-card { width: min(92vw, 400px); background: #fff; border-radius: 22px; padding: 2.4rem; box-shadow: 0 40px 90px rgba(0,0,0,.35); text-align: center; }
.login-card .mk { width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 1rem; background: linear-gradient(135deg, var(--a-side-2), var(--a-ruby)); display: grid; place-items: center; color: #fff; font-family: "Fraunces", serif; font-size: 1.3rem; }
.login-card h1 { font-family: "Fraunces", serif; font-weight: 400; color: var(--a-side); font-size: 1.6rem; margin: 0 0 .3rem; }
.login-card p.sub { color: var(--a-mut); font-size: .9rem; margin: 0 0 1.6rem; }
.login-card .fld { text-align: left; }

.flash { padding: .8rem 1rem; border-radius: 10px; font-size: .9rem; margin-bottom: 1rem; border: 1px solid; }
.flash-success { background: #ecfdf3; border-color: #abefc6; color: #067647; }
.flash-error { background: #fef3f2; border-color: #fda29b; color: #b42318; }
.flash-info { background: #fbeef0; border-color: #f3c9cf; color: #6b0a16; }

.empty { text-align: center; color: var(--a-mut); padding: 2.5rem 0; }
.help-text { color: var(--a-mut); font-size: .88rem; margin: -.4rem 0 1rem; }

/* Mobile */
.a-burger { display: none; }
@media (max-width: 860px) {
  body.admin { grid-template-columns: 1fr; }
  .a-side { position: fixed; z-index: 50; width: 264px; transform: translateX(-100%); transition: transform .3s var(--ease, ease); }
  body.admin.nav-open .a-side { transform: none; }
  .a-burger { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; border: 1.5px solid var(--a-line); background: #fff; cursor: pointer; font-size: 1.2rem; }
  .form-row { grid-template-columns: 1fr; }
}

/* Visitor mini bar chart */
.bars { display: flex; align-items: flex-end; gap: .5rem; height: 150px; padding-top: .5rem; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .4rem; justify-content: flex-end; height: 100%; }
.bars .bar .col { width: 100%; max-width: 34px; border-radius: 8px 8px 0 0; background: linear-gradient(180deg, var(--a-ruby), var(--a-side-2)); min-height: 3px; transition: height .4s var(--ease, ease); }
.bars .bar .v { font-size: .72rem; color: var(--a-mut); font-weight: 600; }
.bars .bar .d { font-size: .64rem; color: var(--a-mut); letter-spacing: .02em; }
.barlist { display: grid; gap: .7rem; }
.barlist .row { display: grid; grid-template-columns: 130px 1fr 48px; align-items: center; gap: .8rem; font-size: .88rem; }
.barlist .meter { height: 12px; border-radius: 999px; background: #f0e6e4; overflow: hidden; }
.barlist .meter span { display: block; height: 100%; background: linear-gradient(90deg, var(--a-side-2), var(--a-ruby)); }
.barlist .row .num { text-align: right; color: var(--a-mut); font-weight: 600; }
code { background: #f4ebe9; padding: .12rem .4rem; border-radius: 6px; font-size: .86em; }
