/* ==========================================================
   پنل مدیریت هتل منتظران
   ========================================================== */

@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-var.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --primary: #0e5a55; --primary-deep: #083f3c; --primary-soft: #e6f2f0;
  --accent: #c8a24a; --accent-deep: #a8842f;
  --ink: #1d1a16; --ink-soft: #4a4640; --muted: #8b8579;
  --paper: #f7f5f0; --card: #ffffff; --line: #e7e2d5;
  --danger: #b03a2e; --ok: #1e7e4d; --warn: #b07a1e;
  --shadow: 0 10px 30px -12px rgba(29, 26, 22, .16);
  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  background: var(--paper); color: var(--ink); line-height: 1.8; min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
img { max-width: 100%; }

/* ---------- ورود ---------- */
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 1rem;
  background: radial-gradient(1200px 600px at 80% -10%, #135f58 0%, #083f3c 45%, #052e2c 100%); position: relative; overflow: hidden; }
.login-screen::after { content: ''; position: absolute; inset: 0; opacity: .5;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='84' height='84' viewBox='0 0 84 84'%3E%3Cg fill='none' stroke='%23c8a24a' stroke-opacity='.14'%3E%3Cpath d='M42 0 52 16 42 32 32 16Z M42 84 52 68 42 52 32 68Z M0 42 16 32 32 42 16 52Z M84 42 68 32 52 42 68 52Z'/%3E%3Ccircle cx='42' cy='42' r='6'/%3E%3C/g%3E%3C/svg%3E"); }
.login-card { position: relative; z-index: 2; background: #fff; border-radius: 22px; box-shadow: 0 30px 70px -20px rgba(0,0,0,.5);
  width: min(400px, 100%); padding: 2.6rem 2.2rem; text-align: center; }
.login-card .logo-mark { width: 64px; height: 64px; margin: 0 auto 1rem; }
.login-card h1 { font-size: 1.25rem; font-weight: 800; color: var(--primary-deep); }
.login-card p { font-size: .85rem; color: var(--muted); margin: .4rem 0 1.6rem; }
.login-card input { width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: .8rem 1rem; margin-bottom: .9rem; text-align: center; }
.login-card input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px var(--primary-soft); }
.login-hint { margin-top: 1rem; font-size: .75rem; color: var(--muted); background: var(--paper); border-radius: 10px; padding: .6rem; }

/* ---------- چیدمان ---------- */
.admin-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { background: #102a27; color: #cfe3df; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side-brand { display: flex; align-items: center; gap: .7rem; padding: 1.2rem 1.2rem 1rem; border-bottom: 1px solid #1c3c38; }
.side-brand .logo-mark { width: 42px; height: 42px; }
.side-brand b { color: #f0dcae; font-size: .95rem; display: block; line-height: 1.5; }
.side-brand small { font-size: .68rem; color: #8fb5af; }
.side-nav { flex: 1; padding: 1rem .7rem; display: grid; gap: .25rem; align-content: start; overflow-y: auto; }
.side-nav button {
  display: flex; align-items: center; gap: .7rem; border: 0; background: none; color: #b8d4cf; text-align: right;
  padding: .7rem .9rem; border-radius: 12px; cursor: pointer; font-weight: 600; font-size: .92rem; transition: .2s; width: 100%;
}
.side-nav button svg { width: 19px; height: 19px; flex: none; }
.side-nav button:hover { background: #17342f; color: #fff; }
.side-nav button.active { background: var(--accent); color: #2b2110; }
.side-foot { padding: 1rem; border-top: 1px solid #1c3c38; display: grid; gap: .4rem; }
.side-foot a { font-size: .82rem; color: #8fb5af; display: flex; gap: .5rem; align-items: center; }
.side-foot a:hover { color: #f0dcae; }

main { padding: 1.6rem clamp(1rem, 3vw, 2.4rem) 3rem; min-width: 0; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.6rem; flex-wrap: wrap; }
.admin-topbar h2 { font-size: 1.4rem; font-weight: 800; color: var(--primary-deep); }
.admin-topbar .tb-actions { display: flex; gap: .6rem; }

/* ---------- دکمه‌ها ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .6rem 1.3rem; border-radius: 11px;
  border: 0; cursor: pointer; font-weight: 700; font-size: .87rem; line-height: 1.4; transition: .2s; }
.btn-primary { background: var(--primary); color: #fff; } .btn-primary:hover { background: var(--primary-deep); }
.btn-gold { background: var(--accent); color: #2b2110; } .btn-gold:hover { background: var(--accent-deep); color: #fff; }
.btn-ghost { background: transparent; color: var(--primary); box-shadow: inset 0 0 0 1.5px var(--primary); }
.btn-ghost:hover { background: var(--primary); color: #fff; }
.btn-danger { background: #fdecea; color: var(--danger); } .btn-danger:hover { background: var(--danger); color: #fff; }
.btn-ok { background: #e7f6ec; color: var(--ok); } .btn-ok:hover { background: var(--ok); color: #fff; }
.btn-sm { padding: .35rem .8rem; font-size: .78rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- کارت‌ها و آمار ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.6rem; }
.stat-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.3rem; box-shadow: var(--shadow); }
.stat-card .s-ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; margin-bottom: .8rem; }
.stat-card .s-ic svg { width: 22px; height: 22px; }
.stat-card b { font-size: 1.5rem; font-weight: 800; display: block; line-height: 1.4; }
.stat-card span { font-size: .78rem; color: var(--muted); }
.ic-teal { background: var(--primary-soft); color: var(--primary); }
.ic-gold { background: #f9f1dd; color: var(--accent-deep); }
.ic-green { background: #e7f6ec; color: var(--ok); }
.ic-red { background: #fdecea; color: var(--danger); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.4rem; margin-bottom: 1.4rem; }
.card > h3 { font-size: 1.02rem; font-weight: 800; margin-bottom: .3rem; color: var(--primary-deep); }
.card .card-sub { font-size: .8rem; color: var(--muted); margin-bottom: 1.1rem; }

/* نمودار میله‌ای */
.chart { display: flex; align-items: flex-end; gap: .7rem; height: 180px; padding-top: 1rem; }
.chart .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .5rem; min-width: 0; }
.chart .bar .col { width: 70%; max-width: 46px; background: linear-gradient(to top, var(--primary), #2b8a80); border-radius: 8px 8px 4px 4px; min-height: 4px; transition: height .5s; position: relative; }
.chart .bar .col:hover { background: linear-gradient(to top, var(--accent-deep), var(--accent)); }
.chart .bar .val { position: absolute; top: -1.5rem; inset-inline: 0; text-align: center; font-size: .72rem; font-weight: 800; color: var(--ink-soft); }
.chart .bar small { font-size: .7rem; color: var(--muted); white-space: nowrap; }

/* ---------- جداول ---------- */
.table-wrap { overflow-x: auto; margin: 0 -0.4rem; padding: 0 .4rem; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .86rem; min-width: 720px; }
.tbl th { text-align: right; font-size: .75rem; color: var(--muted); font-weight: 700; padding: .55rem .7rem; border-bottom: 1.5px solid var(--line); white-space: nowrap; }
.tbl td { padding: .7rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr:hover { background: #faf8f2; }

.badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 800; border-radius: 999px; padding: .2rem .75rem; white-space: nowrap; }
.badge.pending { background: #fdf3e3; color: var(--warn); }
.badge.confirmed { background: #e7f6ec; color: var(--ok); }
.badge.cancelled { background: #fdecea; color: var(--danger); }

.filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.filters input[type="search"], .filters select { border: 1.5px solid var(--line); border-radius: 10px; padding: .5rem .9rem; background: #fff; font-size: .85rem; }
.filters input[type="search"] { min-width: 220px; }

.row-actions { display: flex; gap: .35rem; flex-wrap: wrap; }

/* جزئیات رزرو */
.res-detail { background: #faf8f2; border-radius: 12px; padding: 1rem 1.2rem; font-size: .84rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .4rem 1.4rem; }
.res-detail b { color: var(--primary-deep); }

/* ---------- فرم‌ها ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; }
.fld { display: grid; gap: .35rem; align-content: start; }
.fld.full { grid-column: 1 / -1; }
.fld label { font-size: .8rem; font-weight: 700; color: var(--ink-soft); }
.fld input, .fld select, .fld textarea { border: 1.5px solid var(--line); border-radius: 11px; padding: .6rem .9rem; background: #fff; width: 100%; transition: .2s; }
.fld input:focus, .fld select:focus, .fld textarea:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px var(--primary-soft); }
.fld small { font-size: .7rem; color: var(--muted); }
.fld input[type="color"] { padding: .15rem; height: 44px; cursor: pointer; }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: .7rem 1rem; }
.switch b { font-size: .87rem; font-weight: 600; }
.switch small { display: block; color: var(--muted); font-weight: 400; font-size: .72rem; }
.sw { position: relative; width: 46px; height: 26px; flex: none; }
.sw input { opacity: 0; width: 100%; height: 100%; position: absolute; cursor: pointer; z-index: 2; margin: 0; }
.sw i { position: absolute; inset: 0; background: #d6d0c0; border-radius: 999px; transition: .25s; }
.sw i::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; background: #fff; border-radius: 50%; transition: .25s; box-shadow: 0 2px 5px rgba(0,0,0,.2); }
.sw input:checked + i { background: var(--ok); }
.sw input:checked + i::after { transform: translateX(-20px); }

/* اتاق‌ها در ادمین */
.room-edit { display: grid; grid-template-columns: 130px 1fr; gap: 1.2rem; border: 1.5px solid var(--line); border-radius: var(--radius); padding: 1.1rem; background: #fff; margin-bottom: 1rem; }
.room-edit img { width: 130px; height: 110px; object-fit: cover; border-radius: 12px; }
.room-edit .re-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .8rem; }
@media (max-width: 640px) { .room-edit { grid-template-columns: 1fr; } .room-edit img { width: 100%; height: 140px; } }

/* منو در ادمین */
.menu-admin-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: .7rem; align-items: center; padding: .55rem .3rem; border-bottom: 1px dashed var(--line); font-size: .88rem; }
.menu-admin-row .ma-price { font-weight: 800; color: var(--accent-deep); white-space: nowrap; }

/* تب‌های درون تنظیمات */
.mini-tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.mini-tabs button { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: .35rem 1.1rem; font-size: .82rem; font-weight: 700; color: var(--ink-soft); cursor: pointer; }
.mini-tabs button.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.code-note { direction: ltr; text-align: left; background: #102a27; color: #9fd8cd; border-radius: 12px; padding: 1rem 1.2rem; font-size: .78rem; font-family: monospace; overflow-x: auto; white-space: pre; line-height: 1.7; }

.toast { position: fixed; bottom: 1.4rem; inset-inline-end: 1.4rem; background: var(--ink); color: #fff; padding: .8rem 1.3rem; border-radius: 12px; font-size: .85rem; z-index: 300; transform: translateY(140%); transition: transform .35s; box-shadow: var(--shadow); }
.toast.show { transform: none; }
.toast.ok { background: var(--ok); } .toast.err { background: var(--danger); }

/* موبایل */
.menu-fab { display: none; }
@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 30% 0 0; z-index: 90; transform: translateX(100%); transition: transform .3s; height: 100vh; }
  .sidebar.open { transform: none; }
  .menu-fab { display: inline-flex; position: fixed; bottom: 1.1rem; inset-inline-start: 1.1rem; z-index: 95; width: 52px; height: 52px; border-radius: 16px; background: var(--primary); color: #f0dcae; border: 0; font-size: 1.3rem; box-shadow: var(--shadow); cursor: pointer; align-items: center; justify-content: center; }
  main { padding-bottom: 5rem; }
}
