/* ==========================================================================
   ONETRIMS – admin panel styles
   ========================================================================== */

:root {
  --navy: #0b2340;
  --navy-800: #0a1e37;
  --navy-900: #07182c;
  --ink: #14263c;
  --text: #42536a;
  --muted: #76869a;
  --line: #e2e8f0;
  --bg: #eef2f7;
  --card: #ffffff;
  --accent: #b88a44;
  --accent-soft: #f5ecdb;
  --ok: #176c4c;
  --ok-bg: #e9f5ef;
  --danger: #a83030;
  --danger-bg: #fbeeee;
  --warn: #8a5a12;
  --warn-bg: #fcf5e6;
  --info: #24527f;
  --info-bg: #edf3fa;
  --radius: 13px;
  --shadow-sm: 0 6px 20px rgba(11, 35, 64, .06);
  --sidebar: 264px;
  --font: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.admin-body {
  margin: 0; font-family: var(--font); font-size: 14.5px; line-height: 1.55;
  color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased;
}
a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0 0 .45em; color: var(--ink); line-height: 1.25; letter-spacing: -.015em; font-weight: 700; }
h1 { font-size: 1.58rem; }
h2 { font-size: 1.22rem; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 .9em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.icon { width: 1em; height: 1em; fill: currentColor; vertical-align: -.125em; flex: none; }

/* Layout ------------------------------------------------------------------ */
.admin-sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: var(--navy-900);
  color: rgba(255, 255, 255, .68); display: flex; flex-direction: column; z-index: 200;
  transition: transform .22s ease;
}
.admin-brand { display: flex; align-items: center; gap: 11px; padding: 20px 20px 18px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.admin-brand__mark { width: 38px; height: 38px; border-radius: 8px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.05rem; flex: none; position: relative; }
.admin-brand__mark::after { content: ""; position: absolute; inset: 4px; border: 1px solid rgba(255, 255, 255, .4); border-radius: 4px; }
.admin-brand__name { color: #fff; font-size: 1.1rem; font-weight: 800; letter-spacing: .05em; line-height: 1.1; }
.admin-brand__caption { display: block; font-size: .58rem; color: rgba(255, 255, 255, .4); letter-spacing: .19em; text-transform: uppercase; margin-top: 3px; }
.admin-sidebar__scroll { flex: 1; overflow-y: auto; padding: 14px 12px 24px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .2) transparent; }
.admin-sidebar__scroll::-webkit-scrollbar { width: 6px; }
.admin-sidebar__scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .16); border-radius: 4px; }
.nav-label { font-size: .59rem; letter-spacing: .17em; text-transform: uppercase; color: rgba(255, 255, 255, .32); padding: 17px 10px 7px; font-weight: 700; }
.admin-nav { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.admin-nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 7px;
  color: rgba(255, 255, 255, .66); font-size: .845rem; font-weight: 500; position: relative;
}
.admin-nav a .icon { width: 16px; height: 16px; opacity: .8; }
.admin-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.admin-nav a.is-active { background: rgba(184, 138, 68, .16); color: #fff; }
.admin-nav a.is-active::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; background: var(--accent); border-radius: 0 3px 3px 0; }
.admin-nav a.is-active .icon { color: var(--accent); opacity: 1; }
.admin-sidebar__footer { border-top: 1px solid rgba(255, 255, 255, .08); padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.admin-user { display: flex; align-items: center; gap: 9px; min-width: 0; }
.admin-user__avatar { width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .82rem; flex: none; }
.admin-user__name { color: #fff; font-size: .8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-user__role { color: rgba(255, 255, 255, .4); font-size: .65rem; }
.icon-btn-form { display: inline-flex; }
.icon-btn { width: 32px; height: 32px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .7); cursor: pointer; }
.icon-btn:hover { background: rgba(255, 255, 255, .14); color: #fff; }

.admin-main { margin-left: var(--sidebar); min-height: 100vh; display: flex; flex-direction: column; }
.admin-topbar {
  position: sticky; top: 0; z-index: 120; background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); min-height: 64px; display: flex; align-items: center;
  justify-content: space-between; gap: 18px; padding: 10px 28px;
}
.admin-topbar__left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.sidebar-toggle { display: none; width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; align-items: center; justify-content: center; }
.admin-topbar__title { font-size: .94rem; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-topbar__sub { font-size: .71rem; color: var(--muted); }
.admin-topbar__actions { display: flex; align-items: center; gap: 9px; flex: none; }
.admin-content { padding: 26px 28px 50px; width: 100%; max-width: 1500px; }

/* Headings and panels ----------------------------------------------------- */
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.page-heading h1 { margin-bottom: 3px; }
.page-heading p { color: var(--muted); font-size: .85rem; margin: 0; }
.page-heading__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); margin-bottom: 22px; }
.panel__head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.panel__head h2, .panel__head h3 { margin: 0; font-size: .98rem; }
.panel__head p { margin: 3px 0 0; font-size: .78rem; color: var(--muted); }
.panel__body { padding: 20px; }
.panel__body--flush { padding: 0; }
.panel__foot { padding: 14px 20px; border-top: 1px solid var(--line); background: #fafbfd; border-radius: 0 0 var(--radius) var(--radius); font-size: .78rem; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.span-2 { grid-column: span 2; }
.muted { color: var(--muted); }
.small { font-size: .78rem; }
.mb-0 { margin-bottom: 0; } .mt-0 { margin-top: 0; } .mt-3 { margin-top: 16px; } .mb-3 { margin-bottom: 16px; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; } .gap-3 { gap: 16px; } .wrap { flex-wrap: wrap; }
.w-100 { width: 100%; }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }

/* Stat cards -------------------------------------------------------------- */
.stat-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 16px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; box-shadow: var(--shadow-sm); }
.stat-card__label { font-size: .7rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 700; margin-bottom: 8px; }
.stat-card__value { font-size: 1.85rem; font-weight: 800; color: var(--navy); line-height: 1; letter-spacing: -.03em; }
.stat-card__foot { font-size: .7rem; color: var(--muted); margin-top: 8px; }
.stat-card__icon { width: 40px; height: 40px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; flex: none; }
.stat-card__icon .icon { width: 19px; height: 19px; }
.stat-card--alert .stat-card__icon { background: var(--danger-bg); color: var(--danger); }

/* Buttons ----------------------------------------------------------------- */
.btn-admin {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; padding: 8px 15px; border-radius: 7px; border: 1px solid transparent;
  font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; line-height: 1.2;
  transition: all .16s ease; white-space: nowrap;
}
.btn-admin .icon { width: 14px; height: 14px; }
.btn-admin--primary { background: var(--navy); color: #fff; }
.btn-admin--primary:hover { background: #103055; color: #fff; }
.btn-admin--accent { background: var(--accent); color: #fff; }
.btn-admin--accent:hover { background: #9c7434; color: #fff; }
.btn-admin--outline { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-admin--outline:hover { border-color: var(--navy); color: var(--navy); }
.btn-admin--danger { background: var(--danger); color: #fff; }
.btn-admin--danger:hover { background: #8a2727; color: #fff; }
.btn-admin--ghost { background: transparent; color: var(--muted); }
.btn-admin--ghost:hover { background: var(--bg); color: var(--ink); }
.btn-admin--sm { min-height: 31px; padding: 5px 10px; font-size: .74rem; }
.btn-admin--xs { min-height: 27px; padding: 3px 8px; font-size: .7rem; }
.btn-admin[disabled] { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; gap: 6px; flex-wrap: wrap; }
button.btn-admin { font-family: inherit; }
.inline-form { display: inline; }

/* Tables ------------------------------------------------------------------ */
.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.admin-table th { text-align: left; padding: 11px 14px; font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: #f8fafc; border-bottom: 1px solid var(--line); font-weight: 700; white-space: nowrap; }
.admin-table td { padding: 12px 14px; border-bottom: 1px solid #edf1f6; vertical-align: middle; color: var(--text); }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table tbody tr:hover { background: #fbfcfe; }
.admin-table .primary-cell { color: var(--ink); font-weight: 600; }
.admin-table .sub-cell { color: var(--muted); font-size: .73rem; margin-top: 2px; }
.table-thumb { width: 46px; height: 46px; border-radius: 7px; object-fit: cover; border: 1px solid var(--line); background: #f1f4f8; flex: none; }
.cell-with-thumb { display: flex; align-items: center; gap: 10px; }
.table-actions { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }
.table-actions .icon-btn { background: #fff; border-color: var(--line); color: var(--muted); }
.table-actions .icon-btn:hover { color: var(--navy); border-color: var(--navy); }
.table-empty { text-align: center; padding: 44px 20px; color: var(--muted); font-size: .85rem; }

/* Badges ------------------------------------------------------------------ */
.badge-status { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 30px; font-size: .66rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.badge-status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-status--new { background: #eaf2fc; color: #215b98; }
.badge-status--pending { background: var(--warn-bg); color: var(--warn); }
.badge-status--replied { background: var(--ok-bg); color: var(--ok); }
.badge-status--closed { background: #eef1f5; color: #5f7085; }
.badge-status--published, .badge-status--active { background: var(--ok-bg); color: var(--ok); }
.badge-status--draft, .badge-status--inactive { background: #eef1f5; color: #5f7085; }
.badge-status--danger { background: var(--danger-bg); color: var(--danger); }
.badge-status--info { background: var(--info-bg); color: var(--info); }
.chip { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 5px; background: var(--bg); color: var(--text); font-size: .7rem; }

/* Forms ------------------------------------------------------------------- */
.admin-form .form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.admin-form .form-row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.admin-form .form-row--1 { grid-template-columns: 1fr; }
.admin-form .field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.admin-form .field--full { grid-column: 1 / -1; }
.admin-form label, .admin-form .field-label { font-size: .76rem; font-weight: 700; color: var(--ink); }
.admin-form .req { color: var(--danger); }
.admin-form input[type="text"], .admin-form input[type="email"], .admin-form input[type="password"],
.admin-form input[type="number"], .admin-form input[type="url"], .admin-form input[type="date"],
.admin-form input[type="datetime-local"], .admin-form select, .admin-form textarea, .admin-input {
  width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 9px 12px;
  font: inherit; font-size: .84rem; color: var(--ink); background: #fff; transition: border-color .15s, box-shadow .15s;
}
.admin-form textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
.admin-form textarea.tall { min-height: 260px; }
.admin-form textarea.code { font-family: Consolas, "Courier New", monospace; font-size: .78rem; }
.admin-form input:focus, .admin-form select:focus, .admin-form textarea:focus {
  outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(184, 138, 68, .14);
}
.admin-form input[type="file"] { padding: 7px 10px; font-size: .78rem; background: #f8fafc; }
.admin-form .help { font-size: .71rem; color: var(--muted); }
.admin-form .check-row { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--text); margin-bottom: 9px; }
.admin-form .check-row input { width: 15px; height: 15px; accent-color: var(--navy); }
.form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; padding-top: 18px; border-top: 1px solid var(--line); }
.form-actions--plain { border-top: 0; padding-top: 0; }
.form-note { background: var(--info-bg); border: 1px solid #d5e3f2; color: var(--info); border-radius: 8px; padding: 12px 15px; font-size: .77rem; margin-bottom: 18px; }
.form-note strong { color: var(--info); }
.form-note--warn { background: var(--warn-bg); border-color: #f0e0bb; color: var(--warn); }
.form-note--warn strong { color: var(--warn); }
.form-note--danger { background: var(--danger-bg); border-color: #f0d0d0; color: var(--danger); }
.form-note--danger strong { color: var(--danger); }
.form-note--ok { background: var(--ok-bg); border-color: #cbe7d8; color: var(--ok); }
.form-note--ok strong { color: var(--ok); }

/* Media upload ------------------------------------------------------------ */
.image-upload { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.image-preview { width: 120px; height: 120px; border-radius: 9px; border: 1px dashed var(--line); background: #f7f9fc; display: flex; align-items: center; justify-content: center; overflow: hidden; flex: none; color: var(--muted); font-size: .65rem; text-align: center; }
.image-preview img { width: 100%; height: 100%; object-fit: cover; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.media-item { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fff; }
.media-item__img { aspect-ratio: 1; background: #f1f4f8; }
.media-item__img img { width: 100%; height: 100%; object-fit: cover; }
.media-item__body { padding: 9px 10px; font-size: .72rem; }
.media-item__body input { width: 100%; border: 1px solid var(--line); border-radius: 5px; font: inherit; font-size: .72rem; padding: 4px 6px; margin-top: 3px; }
.media-item__foot { display: flex; justify-content: space-between; align-items: center; gap: 5px; margin-top: 6px; }
.media-item__foot input[type="number"] { width: 54px; padding: 3px 5px; border: 1px solid var(--line); border-radius: 4px; font: inherit; font-size: .72rem; }

/* Login ------------------------------------------------------------------- */
.auth-body { margin: 0; min-height: 100vh; font-family: var(--font); background: var(--navy-900); color: var(--text); display: flex; align-items: center; justify-content: center; padding: 28px; position: relative; overflow-x: hidden; }
.auth-body::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(720px 420px at 85% 12%, rgba(184, 138, 68, .2), transparent 70%),
    radial-gradient(600px 400px at 10% 90%, rgba(36, 82, 127, .25), transparent 70%),
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: auto, auto, 56px 56px, 56px 56px;
}
.auth-card { position: relative; z-index: 2; width: min(100%, 430px); background: #fff; border-radius: 16px; box-shadow: 0 40px 90px rgba(0, 0, 0, .35); padding: 38px 36px 32px; }
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 26px; }
.auth-brand__mark { width: 42px; height: 42px; border-radius: 9px; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.1rem; position: relative; }
.auth-brand__mark::after { content: ""; position: absolute; inset: 4px; border: 1px solid rgba(184, 138, 68, .55); border-radius: 5px; }
.auth-brand__name { font-size: 1.16rem; font-weight: 800; color: var(--navy); letter-spacing: .05em; line-height: 1.1; }
.auth-brand__caption { display: block; font-size: .57rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.auth-card h1 { font-size: 1.38rem; margin-bottom: 6px; }
.auth-card > p { font-size: .83rem; color: var(--muted); margin-bottom: 22px; }
.auth-card .field { margin-bottom: 16px; }
.auth-card .field label { font-size: .76rem; font-weight: 700; }
.auth-card .field input { width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 7px; font: inherit; font-size: .88rem; }
.auth-card .field input:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(184, 138, 68, .14); }
.auth-card .btn-admin { width: 100%; min-height: 44px; margin-top: 6px; }
.auth-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 14px 0 18px; font-size: .76rem; color: var(--muted); flex-wrap: wrap; }
.auth-footer { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); text-align: center; font-size: .73rem; color: var(--muted); }
.auth-footer a { color: var(--navy); font-weight: 600; }
.auth-note { background: var(--warn-bg); color: var(--warn); border: 1px solid #f0e0bb; padding: 10px 12px; border-radius: 7px; font-size: .73rem; margin-bottom: 16px; }
.auth-note--danger { background: var(--danger-bg); border-color: #f0d0d0; color: var(--danger); }
.auth-back { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; font-size: .76rem; color: rgba(255, 255, 255, .55); }
.auth-back:hover { color: #fff; }
.auth-body .auth-back-wrap { position: fixed; left: 24px; bottom: 22px; z-index: 3; }

/* Alerts ------------------------------------------------------------------ */
.alert { border: 1px solid transparent; border-radius: 8px; padding: 11px 15px; font-size: .8rem; margin: 0 0 10px; display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.alert--success { background: var(--ok-bg); border-color: #cbe7d8; color: var(--ok); }
.alert--danger { background: var(--danger-bg); border-color: #f0cccc; color: var(--danger); }
.alert--warning { background: var(--warn-bg); border-color: #efdfba; color: var(--warn); }
.alert--info { background: var(--info-bg); border-color: #cfdef0; color: var(--info); }
.alert__close { background: none; border: 0; color: inherit; opacity: .55; font-size: 1rem; cursor: pointer; padding: 0; line-height: 1; }
.alert__close:hover { opacity: 1; }
.flash-area { margin-bottom: 18px; }

/* Inquiry detail ---------------------------------------------------------- */
.detail-grid { display: grid; grid-template-columns: 1.5fr .85fr; gap: 22px; align-items: start; }
.detail-list { display: grid; gap: 0; margin: 0; }
.detail-list > div { display: grid; grid-template-columns: 135px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid #edf1f6; font-size: .82rem; }
.detail-list > div:last-child { border-bottom: 0; }
.detail-list dt { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.detail-list dd { margin: 0; color: var(--ink); word-break: break-word; }
.message-box { background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; padding: 15px; font-size: .84rem; white-space: pre-wrap; color: var(--ink); max-height: 420px; overflow-y: auto; }
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.timeline__item { position: relative; padding: 0 0 18px; }
.timeline__item::before { content: ""; position: absolute; left: -22px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); }
.timeline__meta { font-size: .68rem; color: var(--muted); margin-bottom: 3px; display: flex; gap: 8px; flex-wrap: wrap; }
.timeline__body { font-size: .81rem; background: #f8fafc; border: 1px solid var(--line); border-radius: 7px; padding: 10px 12px; white-space: pre-wrap; }
.attachment-row { display: flex; align-items: center; gap: 9px; padding: 8px 0; border-bottom: 1px solid #edf1f6; font-size: .79rem; }
.attachment-row:last-child { border-bottom: 0; }
.attachment-row .icon { color: var(--accent); width: 16px; height: 16px; }

/* Tabs -------------------------------------------------------------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tabs a { padding: 9px 14px; font-size: .82rem; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--navy); }
.tabs a.is-active { color: var(--navy); border-bottom-color: var(--accent); }

/* Pagination -------------------------------------------------------------- */
.pagination { display: flex; gap: 4px; justify-content: center; margin: 22px 0 0; list-style: none; padding: 0; }
.pagination a, .pagination span { min-width: 32px; height: 32px; padding: 0 9px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-size: .76rem; color: var(--text); }
.pagination a:hover { border-color: var(--navy); color: var(--navy); }
.pagination .is-current { background: var(--navy); color: #fff; border-color: var(--navy); }
.pagination .disabled { opacity: .4; }

/* Misc -------------------------------------------------------------------- */
.empty-state { text-align: center; padding: 46px 24px; color: var(--muted); }
.empty-state h3 { color: var(--ink); margin-bottom: .3em; }
.empty-state p { font-size: .82rem; max-width: 440px; margin: 0 auto 16px; }
.notice { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 12px 16px; border-radius: 0 8px 8px 0; font-size: .79rem; color: #6a5125; margin-bottom: 18px; }
.code-box { background: #0d2138; color: #d9e4f0; border-radius: 8px; padding: 13px 15px; font-family: Consolas, monospace; font-size: .76rem; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
.color-input-wrap { display: flex; gap: 8px; align-items: center; }
.color-input-wrap input[type="color"] { width: 44px; height: 38px; padding: 2px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.role-permissions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 8px; }
.role-permissions .check-row { margin: 0; padding: 5px 0; border-bottom: 1px solid #f1f4f8; }
.filter-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filter-bar input, .filter-bar select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: .78rem; background: #fff; }
.filter-bar input[type="search"] { min-width: 190px; }
.filter-bar .btn-admin { min-height: 34px; }
.quick-links { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.quick-link { border: 1px solid var(--line); border-radius: 9px; padding: 14px; background: #fff; display: flex; align-items: center; gap: 10px; font-size: .78rem; font-weight: 600; color: var(--ink); }
.quick-link:hover { border-color: var(--accent); color: var(--navy); background: #fffdf8; }
.quick-link .icon { color: var(--accent); width: 17px; height: 17px; }
.recent-list { list-style: none; padding: 0; margin: 0; }
.recent-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #edf1f6; font-size: .79rem; }
.recent-list li:last-child { border-bottom: 0; }
.recent-list .time { color: var(--muted); font-size: .7rem; white-space: nowrap; }
.counter-badge { background: var(--danger); color: #fff; border-radius: 20px; padding: 1px 6px; font-size: .6rem; font-weight: 700; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(7, 24, 44, .55); z-index: 190; }
.help-list { margin: 0; padding-left: 18px; font-size: .78rem; color: var(--muted); }
.help-list li { margin-bottom: 5px; }
.switch-row { display: flex; align-items: center; gap: 8px; }
.status-select { padding: 6px 9px; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: .76rem; background: #fff; }
.dropdown-menu-admin { position: relative; }
.dropdown-menu-admin > button { list-style: none; }
.dropdown-menu-admin__panel { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-sm); padding: 6px; min-width: 160px; display: none; z-index: 30; }
.dropdown-menu-admin.open .dropdown-menu-admin__panel { display: block; }
.dropdown-menu-admin__panel a, .dropdown-menu-admin__panel button { display: flex; width: 100%; gap: 8px; align-items: center; padding: 7px 9px; border: 0; background: none; font: inherit; font-size: .77rem; color: var(--text); border-radius: 5px; cursor: pointer; text-align: left; }
.dropdown-menu-admin__panel a:hover, .dropdown-menu-admin__panel button:hover { background: var(--bg); color: var(--navy); }
.mono { font-family: Consolas, "Courier New", monospace; font-size: .78rem; }
.tag-list { display: flex; gap: 5px; flex-wrap: wrap; }
.divider-label { font-size: .65rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 700; margin: 20px 0 8px; }

@media (max-width: 1200px) {
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  .quick-links { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1024px) {
  .admin-sidebar { transform: translateX(-100%); }
  .sidebar-open .admin-sidebar { transform: translateX(0); }
  .sidebar-open .sidebar-overlay { display: block; }
  .admin-main { margin-left: 0; }
  .sidebar-toggle { display: inline-flex; }
  .admin-content { padding: 20px 18px 40px; }
  .admin-topbar { padding: 8px 16px; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .stat-cards { grid-template-columns: 1fr; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .admin-form .form-row, .admin-form .form-row--3 { grid-template-columns: 1fr; }
  .page-heading { flex-direction: column; }
  .role-permissions { grid-template-columns: 1fr; }
  .detail-list > div { grid-template-columns: 1fr; gap: 3px; }
  .auth-card { padding: 28px 22px 24px; }
  .quick-links { grid-template-columns: 1fr; }
  .admin-topbar__sub { display: none; }
  .hide-mobile { display: none !important; }
}
