/* پرداخت ظاهر: عمق، جزئیات و حرکت‌های کم‌حجم. بعد از mobile.css بارگذاری می‌شود.
   فقط ظاهر را عوض می‌کند، نه چیدمان را. */
:root {
  --gem: #2fd6a0;
  --ink: #0f1b3d;
  --shadow-1: 0 1px 2px rgba(17, 42, 107, .06), 0 10px 24px -14px rgba(17, 42, 107, .22);
  --shadow-2: 0 2px 4px rgba(17, 42, 107, .08), 0 22px 40px -20px rgba(17, 42, 107, .35);
  --ring: 0 0 0 4px rgba(31, 79, 191, .16);
}
* { scrollbar-width: thin; scrollbar-color: #bcc7df transparent; }
::selection { background: rgba(47, 214, 160, .28); }

body {
  background:
    radial-gradient(900px 360px at 88% -140px, rgba(31, 79, 191, .11), transparent 72%),
    radial-gradient(700px 320px at 4% 0, rgba(15, 157, 107, .07), transparent 70%),
    var(--bg);
  background-repeat: no-repeat;
}

/* ===== منوی کناری: ظاهر «گوهر» با سطوح تراش‌خورده ===== */
.sidebar {
  background:
    radial-gradient(420px 260px at 100% 0, rgba(47, 214, 160, .16), transparent 70%),
    linear-gradient(135deg, rgba(255, 255, 255, .045) 0 25%, transparent 25% 50%, rgba(255, 255, 255, .03) 50% 75%, transparent 75%) 0 0 / 52px 52px,
    linear-gradient(180deg, #15337f 0%, #0f2566 48%, #0a1a4a 100%);
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, .07), -10px 0 34px -16px rgba(10, 26, 74, .6);
}
.brand { padding-bottom: 14px; margin-bottom: 4px; border-bottom: 1px solid rgba(255, 255, 255, .10); }
.brand img.brand-mark { filter: drop-shadow(0 4px 10px rgba(47, 214, 160, .35)); }
.side-nav a { border-radius: 12px; transition: background .18s, color .18s, transform .18s; }
.side-nav a:hover { transform: translateX(-2px); }
.side-nav a .icon { opacity: .85; transition: color .18s, opacity .18s; }
.side-nav a:hover .icon { opacity: 1; }
.side-nav a.is-active {
  background: linear-gradient(270deg, rgba(47, 214, 160, .20), rgba(255, 255, 255, .08));
  box-shadow: inset -3px 0 0 var(--gem), 0 6px 16px -10px rgba(0, 0, 0, .5);
  font-weight: 700;
}
.side-nav a.is-active .icon { color: var(--gem); opacity: 1; }
.nav-label { letter-spacing: 0; font-weight: 700; }
.avatar { background: linear-gradient(145deg, #fff, #dfe8ff); box-shadow: 0 0 0 2px rgba(47, 214, 160, .55); }

/* ===== عنوان صفحه ===== */
.page-head h1, .main > h1 { letter-spacing: -.01em; }
.page-head h1::after, .main > h1::after {
  content: ""; display: block; width: 38px; height: 4px; margin-top: 6px; border-radius: 4px;
  background: linear-gradient(270deg, var(--accent), var(--gem));
}

/* ===== کارت‌ها ===== */
.card, .stat, .tile {
  border: 1px solid var(--line); border-radius: 18px;
  background: linear-gradient(180deg, #fff, #fbfcff);
  box-shadow: var(--shadow-1);
}
.tile { transition: transform .2s, box-shadow .2s, border-color .2s; }
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: rgba(31, 79, 191, .4); }
.stat-value { color: var(--ink); letter-spacing: -.01em; }
.card h2 { color: var(--ink); }

.status-hero {
  background: linear-gradient(135deg, #fff 0%, #f5f8ff 100%);
  border-color: var(--line); box-shadow: var(--shadow-1);
}
.status-hero::before { background: linear-gradient(180deg, var(--line-strong), var(--line)); }
.status-hero.is-in {
  background: linear-gradient(135deg, #fff 0%, #effaf5 100%);
  border-color: rgba(15, 157, 107, .35);
  box-shadow: 0 0 0 1px rgba(15, 157, 107, .10), 0 26px 44px -28px rgba(15, 157, 107, .6);
}
.status-hero.is-in::before { background: linear-gradient(180deg, var(--gem), var(--ok)); }
.is-in .status-badge::before { animation: pulse 2.2s ease-out infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(15, 157, 107, .45); }
  70%, 100% { box-shadow: 0 0 0 9px rgba(15, 157, 107, 0); }
}

/* ===== دکمه‌ها ===== */
button:not(.icon-btn):not(.btn-link):not(.btn-ghost):not(.btn-sm):not(.btn-sm-danger):not(.btn-danger):not(.is-out):not(.btn-hero):not(.btn-ok),
.btn:not(.btn-ghost):not(.btn-danger):not(.is-out):not(.btn-hero):not(.btn-ok) {
  background: linear-gradient(180deg, #2c62da, #1b45ae);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 10px 20px -10px rgba(31, 79, 191, .75);
  transition: transform .14s, box-shadow .2s, filter .2s;
}
button:not(.icon-btn):not(.btn-link):not(.btn-ghost):not(.btn-sm):not(.btn-sm-danger):not(.btn-danger):not(.is-out):not(.btn-hero):not(.btn-ok):hover,
.btn:not(.btn-ghost):not(.btn-danger):not(.is-out):not(.btn-hero):not(.btn-ok):hover {
  background: linear-gradient(180deg, #3a70e8, #2150c0); transform: translateY(-1px); filter: none;
}
button:not(.icon-btn):not(.btn-link):active, .btn:active { transform: translateY(0) scale(.985); }
.btn-danger { background: linear-gradient(180deg, #d8494b, #b02f2f); box-shadow: 0 10px 20px -12px rgba(201, 58, 58, .8); }
.btn-hero { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 18px 30px -14px rgba(31, 79, 191, .7); }
.btn-hero.is-out { box-shadow: none; background: #fff; }
.btn-ghost { background: #fff; transition: border-color .2s, background .2s; }
.btn-sm, .btn-small { transition: background .18s, border-color .18s, color .18s; }
.btn-sm { background: #f6f8fd; color: var(--accent-dark); border-color: var(--line-strong); }
.btn-sm:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark); }
.btn-sm-danger { background: #fff; }

/* ===== فرم‌ها ===== */
input[type=text], input[type=password], input[type=tel], input[type=email], input[type=number], select, textarea {
  background: #fff; border-color: var(--line-strong); transition: border-color .15s, box-shadow .15s;
}
input[type=text]:hover, input[type=password]:hover, input[type=number]:hover, select:hover, textarea:hover { border-color: #9fb0d4; }
input:focus, select:focus, textarea:focus { outline: none; box-shadow: var(--ring); border-color: var(--accent); }
label { color: #2a3552; }

/* ===== جدول‌ها و وضعیت‌ها ===== */
.table-wrap { background: #fff; box-shadow: var(--shadow-1); border-color: var(--line); border-radius: 16px; }
th { background: linear-gradient(180deg, #f3f6fd, #e9eef9); color: #44516f; }
tbody tr { transition: background .15s; }
.status { display: inline-flex; align-items: center; gap: 6px; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.count-badge { background: linear-gradient(180deg, #e8efff, #dbe6ff); }
.messages li { box-shadow: var(--shadow-1); border-radius: 12px; }

/* ===== یک حرکت ورود برای کل صفحه ===== */
.main { animation: rise .32s ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ===== نوار پایین موبایل ===== */
.tabbar { display: none; }
@media (max-width: 900px) {
  .sidebar {
    background:
      radial-gradient(260px 120px at 100% 0, rgba(47, 214, 160, .2), transparent 70%),
      linear-gradient(180deg, #15337f, #0d2160);
    box-shadow: 0 10px 24px -14px rgba(10, 26, 74, .7);
  }
  .main { padding-bottom: 104px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px;
    position: fixed; inset-inline: 10px; bottom: 10px; z-index: 40;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    border-radius: 24px;
    background: rgba(15, 37, 102, .93);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    box-shadow: 0 16px 36px -12px rgba(10, 26, 74, .75), inset 0 0 0 1px rgba(255, 255, 255, .09);
  }
  .tabbar a, .tabbar label {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 8px 2px 7px; border-radius: 18px; cursor: pointer; text-decoration: none;
    color: rgba(255, 255, 255, .74); font-size: 12px; font-weight: 600; line-height: 1.5;
    transition: background .18s, color .18s;
  }
  .tabbar .icon { width: 22px; height: 22px; }
  .tabbar a.is-active { color: #fff; background: rgba(255, 255, 255, .13); }
  .tabbar a.is-active .icon { color: var(--gem); }
  .side-nav { max-height: calc(100vh - 160px); }
}

/* خوانایی در تم روشن (رنگ‌های قدیمی تم تیره کم‌رنگ بودند) */
.is-in .status-badge { color: #0b7a55; }
.status-approved { background: var(--ok-soft); color: #0b7a55; }
.status-rejected { background: var(--danger-soft); color: #a72b2b; }
.status-pending, .status-open { color: var(--accent-dark); }
.status-open { border-color: rgba(31, 79, 191, .45); }
.messages li { color: #0b6f4d; }
.messages li.error { color: #9b2222; }
.messages li.warning { color: #7a5a06; }
.cell-sub, .note, .stat-sub, .result-meta { color: var(--muted); }
@media (max-width: 900px) {
  .brand { border: 0; margin: 0; padding: 2px 4px; }
}

/* ===== دکمه‌های بدون رنگ، صفحه‌بندی و منوی دو ستونهٔ موبایل ===== */
.btn-small { padding: 7px 18px; font-size: 14.5px; }
.btn.btn-ghost { background: #fff; color: var(--accent-dark); border: 1px solid var(--line-strong); box-shadow: none; }
.btn.btn-ghost:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark); transform: none; }
.filter-row .btn, .filter-row button { margin: 0; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 18px 0 4px; color: var(--muted); font-size: 14.5px; }
.pager .btn { margin: 0; padding: 7px 18px; font-size: 14.5px; }
.btn-link { color: var(--accent); }
details > summary { cursor: pointer; color: var(--accent); font-size: 13.5px; }

@media (max-width: 900px) {
  .nav-toggle:checked ~ .side-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; align-content: start; }
  .nav-label { grid-column: 1 / -1; margin: 10px 6px 0; }
  .side-nav a { padding: 12px 12px; font-size: 14.5px; border-radius: 12px; background: rgba(255, 255, 255, .06); }
  .side-nav a.is-active { background: linear-gradient(270deg, rgba(47, 214, 160, .24), rgba(255, 255, 255, .10)); }
  .side-nav { max-height: calc(100vh - 150px); }
}

/* ===== دکمه‌ها: همه رنگ و شکل مشخص دارند ===== */
.btn-hero { background: linear-gradient(180deg, #2c62da, #1b45ae); color: #fff; }
.btn-hero:hover { background: linear-gradient(180deg, #3a70e8, #2150c0); color: #fff; }
.btn-hero.is-out { background: #fff; color: var(--ink); }

.btn-sm { background: #fff; color: #1b45ae; border: 1px solid #b9c8ea; font-weight: 600; }
.btn-sm:hover { background: #eaf0ff; border-color: var(--accent); color: #1b45ae; }
.btn-sm-danger { background: #fff; color: #b02f2f; border-color: #efb3b3; }
.btn-sm-danger:hover { background: #c93a3a; border-color: #c93a3a; color: #fff; }

.btn-ok {
  background: linear-gradient(180deg, #1fbf8c, #0e8f69); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 10px 20px -10px rgba(15, 157, 107, .8);
  transition: transform .14s, filter .2s;
}
.btn-ok:hover { background: linear-gradient(180deg, #2bd29c, #12a077); color: #fff; transform: translateY(-1px); }

.btn-cancel {
  display: inline-block; margin-top: 16px; margin-inline-start: 6px; padding: 10px 22px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: #fff; color: var(--fg); font-size: 16px; font-weight: 600; text-decoration: none;
  transition: border-color .18s, background .18s;
}
.btn-cancel:hover { background: var(--surface-2, #f3f6fd); border-color: var(--accent); color: var(--fg); }
.filter-row .btn-cancel { margin: 0; padding: 9px 18px; }

@media (max-width: 900px) {
  /* منو: همهٔ گزینه‌ها (تا «گزارش تغییرات») با اسکرول دیده شوند و زیر نوار پایین نروند */
  .side-nav { max-height: calc(100vh - 170px); max-height: calc(100dvh - 170px); padding-bottom: 14px; overscroll-behavior: contain; }
}

/* ===== سرتیتر صفحه با دکمه: کنار هم، با فاصلهٔ درست از محتوای زیرش ===== */
.page-head:has(> .btn) {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px 16px; margin-bottom: 18px;
}
.page-head > .btn { margin: 0; }

/* جدول‌های مستقیم داخل صفحه (بدون کارت): قاب و پس‌زمینه */
.main > table {
  width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 16px;
  border-collapse: separate; border-spacing: 0; overflow: hidden; box-shadow: var(--shadow-1);
  margin-top: 4px;
}
.main > table tbody tr:last-child td { border-bottom: 0; }
.msg { margin: 0 0 14px; padding: 11px 14px; border-radius: 12px; background: var(--ok-soft); color: #0b6f4d; border: 1px solid rgba(15, 157, 107, .28); }
.msg.error { background: var(--danger-soft); color: #9b2222; border-color: rgba(201, 58, 58, .3); }
.msg.warning { background: rgba(245, 196, 81, .14); color: #7a5a06; border-color: rgba(245, 196, 81, .35); }
.main td, .main th { vertical-align: middle; }
