:root {
  --ink: #1b2929;
  --muted: #61706d;
  --paper: #f6f7f5;
  --surface: #fff;
  --line: #dfe5e0;
  --teal: #15514b;
  --teal-dark: #103d39;
  --brass: #a27838;
  --brass-light: #d6b783;
  --sand: #d6b783;
  --sand-dark: #a27838;
  --shadow: 0 10px 28px rgba(25,49,46,.06);
  --bs-primary: #15514b;
  --bs-primary-rgb: 21,81,75;
}
* { box-sizing: border-box; letter-spacing: 0; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--teal); }
a:hover { color: var(--teal-dark); }
img { max-width: 100%; }
:focus-visible { outline: 3px solid #c89544 !important; outline-offset: 2px; }

.app-shell { display: grid; grid-template-columns: 246px minmax(0,1fr); min-height: 100vh; }
.offcanvas-lg.sidebar { --bs-offcanvas-bg: #103d39; width: 246px; color: #edf2ee; background-color: var(--teal-dark) !important; }
.sidebar-inner { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; min-height: 570px; padding: 23px 14px 16px; overflow-y: auto; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 0 7px 18px; border-bottom: 1px solid rgba(255,255,255,.12); }
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand-mark { display: grid; place-items: center; flex: 0 0 auto; width: 39px; height: 39px; color: #143d38; background: var(--brass-light); border-radius: 8px; font-size: 20px; }
.brand-copy { display: flex; flex-direction: column; min-width: 0; }
.brand-copy strong { font-size: 14px; line-height: 1.15; white-space: nowrap; }
.brand-copy small { color: #b7c9c0; font-size: 11px; margin-top: 3px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 3px; padding-top: 20px; }
.nav-label { padding: 0 13px 8px; color: #9fbab0; font-size: 11px; text-transform: uppercase; font-weight: 700; }
.nav-label-secondary { padding-top: 27px; }
.sidebar-nav a { display: flex; align-items: center; gap: 12px; min-height: 43px; padding: 10px 13px; color: #d4e1da; text-decoration: none; border-radius: 6px; font-size: 14px; font-weight: 550; transition: background .15s, color .15s; }
.sidebar-nav a i { width: 21px; text-align: center; font-size: 17px; }
.sidebar-nav a:hover { background: rgba(255,255,255,.09); color: #fff; }
.sidebar-nav a.active { color: #fff; background: #23645d; box-shadow: inset 3px 0 var(--brass-light); }
.sidebar-account { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 16px 7px 9px; border-top: 1px solid rgba(255,255,255,.12); }
.account-avatar, .header-avatar { display: grid; place-items: center; flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; font-weight: 750; }
.account-avatar { color: #123d39; background: #d4e5db; }
.account-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.account-meta strong { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-meta small { color: #b9c9c1; margin-top: 2px; }
.account-icon { color: #d8e5dd; margin-left: auto; padding: 5px; }
.account-icon:hover { color: #fff; }
.sidebar-logout button { width: 100%; padding: 7px 13px; border: 0; border-radius: 6px; background: none; color: #b9c9c1; font-size: 13px; text-align: left; }
.sidebar-logout button:hover { color: #fff; background: rgba(255,255,255,.08); }
.sidebar-logout i { margin-right: 8px; }

.site-main { min-width: 0; }
.site-header { display: flex; align-items: center; gap: 15px; min-height: 76px; padding: 15px clamp(18px,3vw,42px); background: #fff; border-bottom: 1px solid var(--line); }
.header-title { display: flex; flex-direction: column; line-height: 1.2; }
.header-title strong { font-size: 16px; font-weight: 750; }
.header-overline { margin-bottom: 3px; color: var(--muted); font-size: 11px; }
.header-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.header-role { color: var(--muted); font-size: 12px; }
.header-avatar { color: var(--teal); background: #e9f0ed; text-decoration: none; }
.header-avatar:hover { color: #fff; background: var(--teal); }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--teal); font-size: 21px; }
.content-wrap { width: min(100%,1450px); margin: 0 auto; padding: 30px clamp(18px,3vw,42px) 70px; }
.content-wrap > h3, .content-wrap > h4 { color: var(--ink); font-weight: 750; }

.card, .modal-content, .dropdown-menu { background: var(--surface); border: 1px solid var(--line) !important; border-radius: 8px !important; box-shadow: var(--shadow) !important; }
.card .card { box-shadow: none !important; }
.card-title { color: var(--ink); }
.btn { border-radius: 6px; font-weight: 650; }
.btn-primary { --bs-btn-bg: var(--teal); --bs-btn-border-color: var(--teal); --bs-btn-hover-bg: var(--teal-dark); --bs-btn-hover-border-color: var(--teal-dark); --bs-btn-active-bg: var(--teal-dark); --bs-btn-active-border-color: var(--teal-dark); }
.btn-outline-primary { --bs-btn-color: var(--teal); --bs-btn-border-color: #9abbb1; --bs-btn-hover-bg: var(--teal); --bs-btn-hover-border-color: var(--teal); }
.btn-outline-secondary { --bs-btn-color: #52635f; --bs-btn-border-color: #c3cec8; --bs-btn-hover-bg: #52635f; --bs-btn-hover-border-color: #52635f; }
.form-control, .form-select, .input-group-text { border-radius: 6px; border-color: #cbd6cf; }
.form-control:focus, .form-select:focus { border-color: var(--teal); box-shadow: 0 0 0 .2rem rgba(21,81,75,.14); }
.page-link { color: var(--teal); border-color: var(--line); }
.active > .page-link, .page-link.active { background: var(--teal); border-color: var(--teal); }
.text-muted { color: var(--muted) !important; }
.bg-light { background-color: #eef2ee !important; }
.table { --bs-table-bg: transparent; }
.table thead th { background: #eef3ef !important; color: #3a5750; border-bottom-color: var(--line); font-size: 12px; text-transform: uppercase; }
.table td { border-bottom-color: #ebefec; }
.badge.text-bg-light { color: #3d5d53 !important; background: #edf3ee !important; }
.alert { border-radius: 6px; }
.upload-area { background: #eef4f0; border-color: #b9cfc4 !important; border-style: dashed !important; }
.upload-area:hover { background: #e7f0e9; }
.history-filter { width: min(100%,360px); min-width: 0; }
.translation-search .input-group { min-width: 0; }
.translation-search .form-control { min-width: 0; }

.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.page-heading h1 { margin: 0; font-size: clamp(24px,2.2vw,32px); font-weight: 780; }
.page-heading p { margin: 5px 0 0; color: var(--muted); }
.eyebrow { color: var(--brass); font-size: 11px; font-weight: 750; text-transform: uppercase; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 28px 0 14px; }
.section-heading h2 { margin: 0; font-size: 19px; font-weight: 750; }
.section-heading a { font-size: 13px; font-weight: 700; text-decoration: none; }
.dashboard-intro { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 25px 30px; border-radius: 8px; color: #fff; background: var(--teal-dark); }
.dashboard-intro .eyebrow { color: var(--brass-light); }
.dashboard-intro h1 { margin: 4px 0 6px; font-size: clamp(23px,2vw,30px); font-weight: 780; }
.dashboard-intro p { margin: 0; max-width: 650px; color: #c7dad0; }
.dashboard-intro .btn { flex: 0 0 auto; color: var(--teal-dark); background: var(--brass-light); border-color: var(--brass-light); }
.dashboard-metrics { display: flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 8px; background: #fff; margin-top: 16px; }
.dashboard-metric { min-width: 150px; flex: 1; padding: 17px 24px; }
.dashboard-metric + .dashboard-metric { border-left: 1px solid var(--line); }
.dashboard-metric small { display: block; color: var(--muted); font-size: 12px; }
.dashboard-metric strong { color: var(--teal-dark); font-size: 26px; line-height: 1.15; }
.collection-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.collection-grid-two { grid-template-columns: repeat(2,minmax(0,1fr)); margin-top: 16px; }
.collection-card { overflow: hidden; min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.collection-card-image { display: grid; place-items: center; aspect-ratio: 16/10; overflow: hidden; background: #edf0eb; }
.collection-card-image img { width: 100%; height: 100%; object-fit: cover; object-position: center 22%; }
.collection-card-body { padding: 15px 17px 17px; }
.collection-card-body h3 { margin: 0 0 5px; font-size: 15px; font-weight: 760; line-height: 1.35; }
.collection-card-body p { margin: 0 0 12px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.collection-card-body small { color: var(--teal); font-weight: 700; }
.prediction-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.summary-panel { padding: 22px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.summary-panel h3 { margin: 0; font-size: 16px; font-weight: 750; }
.summary-bars { display: grid; gap: 13px; margin-top: 21px; }
.summary-row { display: grid; grid-template-columns: minmax(0,1fr) 46px; gap: 5px 12px; font-size: 12px; }
.summary-row span { overflow-wrap: anywhere; }
.summary-row b { text-align: right; }
.summary-row .progress { grid-column: 1/-1; height: 7px; background: #e9efeb; }
.summary-row .progress-bar { background: var(--teal); }
.recent-list { margin: 12px 0 0; padding: 0; list-style: none; }
.recent-list li { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.recent-list li:last-child { border-bottom: 0; }
.recent-list strong { font-size: 13px; }
.recent-list small { display: block; margin-top: 3px; color: var(--muted); }
.recent-list span { color: var(--teal); font-size: 12px; font-weight: 750; white-space: nowrap; }

.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 26px; background: #eaf0ec; }
.auth-shell { width: min(100%,1120px); }
.auth-brand { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 17px; color: var(--teal-dark); text-decoration: none; }
.auth-brand strong, .auth-brand small { display: block; }
.auth-brand strong { font-size: 15px; line-height: 1.2; }
.auth-brand small { color: var(--muted); font-size: 11px; }
.auth-window { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 20px 50px rgba(18,63,60,.10); }
.auth-visual { position: relative; display: flex; min-height: 620px; height: 100%; padding: 34px; color: #fff; background: linear-gradient(0deg,rgba(10,38,35,.94),rgba(10,38,35,.18) 70%), url("/static/durrah.png") center 23%/cover; }
.auth-visual-content { display: flex; flex-direction: column; justify-content: space-between; width: 100%; }
.auth-kicker { display: inline-flex; align-items: center; gap: 8px; color: #f4e4c9; font-size: 12px; font-weight: 750; }
.auth-visual h1 { max-width: 420px; font-size: clamp(28px,3vw,42px); line-height: 1.08; font-weight: 780; }
.auth-visual p { max-width: 420px; color: #d7e4de; }
.auth-form-panel { display: flex; align-items: center; min-height: 620px; padding: clamp(24px,4vw,52px); }
.auth-form-inner { width: 100%; max-width: 430px; margin: auto; }
.auth-icon { display: grid; place-items: center; width: 46px; height: 46px; color: #fff; background: var(--teal); border-radius: 8px; }
.auth-form-inner h2 { font-size: 27px; font-weight: 780; }
.auth-switch { padding-top: 12px; border-top: 1px solid var(--line); }

@media (max-width:1199.98px) {
  .collection-grid, .collection-grid-two { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width:991.98px) {
  .app-shell { display: block; }
  .offcanvas-lg.sidebar { width: min(290px,86vw); }
  .sidebar-inner { min-height: 100%; }
  .site-header { min-height: 65px; }
  .content-wrap { padding-top: 22px; }
  .auth-visual { min-height: 260px; }
  .auth-form-panel { min-height: auto; }
}
@media (max-width:700px) {
  .dashboard-intro { display: block; padding: 22px; }
  .dashboard-intro .btn { margin-top: 17px; }
  .dashboard-metric { min-width: 50%; }
  .dashboard-metric + .dashboard-metric { border-left: 0; }
  .dashboard-metric:nth-child(even) { border-left: 1px solid var(--line); }
  .prediction-summary { grid-template-columns: 1fr; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .auth-page { padding: 14px; }
  .table-responsive { max-width: calc(100vw - 28px); }
  .content-wrap .row > * { min-width: 0; }
  .translation-search .input-group { flex-wrap: wrap; gap: 6px; }
  .translation-search .input-group > * { border-radius: 6px !important; }
  .translation-search .input-group .form-control { flex: 1 1 calc(100% - 58px); }
}
@media (max-width:560px) {
  .collection-grid, .collection-grid-two { grid-template-columns: 1fr; }
  .content-wrap { padding-inline: 14px; }
  .header-role { display: none; }
  .dashboard-metric { padding: 14px 17px; }
  .auth-visual { min-height: 220px; padding: 22px; }
  .auth-visual h1 { font-size: 26px; }
  .auth-visual p { font-size: 13px; }
  .auth-form-panel { padding: 22px; }
}
