:root {
  --ta-bg: #071013;
  --ta-bg-2: #091419;
  --ta-panel: #0d171b;
  --ta-panel-2: #101c21;
  --ta-panel-3: #142328;
  --ta-line: #1d3137;
  --ta-line-soft: rgba(130, 171, 182, .13);
  --ta-text: #f7fbfc;
  --ta-text-2: #c6d1d6;
  --ta-muted: #82939b;
  --ta-green: #7dff21;
  --ta-green-2: #9dff4f;
  --ta-green-dark: #143713;
  --ta-green-soft: rgba(125, 255, 33, .10);
  --ta-purple: #9a4dff;
  --ta-danger: #ff6573;
  --ta-radius: 15px;
  --ta-shadow: 0 18px 44px rgba(0,0,0,.30);
  --ta-sidebar: 280px;
  --ta-topbar: 74px;
}

* { box-sizing: border-box; }
html { background: var(--ta-bg); }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--ta-text) !important;
  background:
    radial-gradient(circle at 82% 11%, rgba(46, 148, 49, .10), transparent 26rem),
    linear-gradient(180deg, #071014 0%, #071013 100%) !important;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: 14px;
  line-height: 1.45;
}
a:link, a:visited { color: var(--ta-text-2); }
a:hover { color: var(--ta-green-2); }
.ta-icon { width: 20px; height: 20px; display: block; fill: none; flex: 0 0 auto; }

/* ===== Global chrome ===== */
#container { min-height: 100vh; background: transparent !important; }
#header {
  min-height: var(--ta-topbar);
  padding: 0 26px 0 28px !important;
  display: grid !important;
  grid-template-columns: var(--ta-sidebar) minmax(420px, 1fr) auto;
  align-items: center;
  gap: 18px;
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(6, 16, 20, .94) !important;
  border-bottom: 1px solid #18282e;
  box-shadow: 0 10px 28px rgba(0,0,0,.18);
  backdrop-filter: blur(18px);
}
#branding { margin: 0 !important; min-width: 0; }
.takeaway-brand {
  display: inline-flex;
  align-items: center;
  gap: 17px;
  text-decoration: none !important;
  min-width: 0;
}
.takeaway-brand img { width: 112px; height: 48px; object-fit: contain; object-position: left center; }
.takeaway-brand-subtitle {
  padding-left: 16px;
  border-left: 1px solid #23343a;
  color: var(--ta-green);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: .10em;
  text-transform: uppercase;
  white-space: nowrap;
}
#nav-global { min-width: 0; }
.ta-global-tools {
  width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(280px, 1fr) 250px 44px;
  align-items: center;
  gap: 14px;
}
.ta-menu-button,
.ta-bell {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #b9cad1 !important;
  cursor: pointer;
  text-decoration: none !important;
  transition: .18s ease;
}
.ta-menu-button:hover, .ta-bell:hover { background: #102027; color: var(--ta-green) !important; }
.ta-menu-button { flex-direction: column; gap: 4px; }
.ta-menu-button span { width: 18px; height: 2px; background: currentColor; border-radius: 999px; }
.ta-bell { border-left: 1px solid #1a2b31; border-radius: 0; }
.ta-bell .ta-icon { width: 22px; height: 22px; }
.ta-search-shell { position: relative; min-width: 0; }
.ta-search-shell > .ta-icon {
  position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 19px; height: 19px; color: #8ba0a9; z-index: 2;
}
.ta-search-shell input {
  width: 100%; height: 46px; padding: 0 76px 0 46px !important;
  border: 1px solid #243840 !important;
  border-radius: 12px !important;
  outline: 0;
  background: #0d181d !important;
  color: var(--ta-text) !important;
  font-size: 13px !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.02) !important;
}
.ta-search-shell input::placeholder { color: #7b8d95; }
.ta-search-shell input:focus { border-color: rgba(125,255,33,.62) !important; box-shadow: 0 0 0 3px rgba(125,255,33,.08) !important; }
.ta-search-shell kbd {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  padding: 4px 7px; border: 1px solid #2a3b42; border-radius: 7px; background: #101c21; color: #83959d; font: 700 10px/1 ui-sans-serif, system-ui; pointer-events: none;
}
.ta-search-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 1500;
  padding: 7px; background: #0c161a; border: 1px solid #25383e; border-radius: 12px; box-shadow: 0 22px 50px rgba(0,0,0,.38);
}
.ta-search-results a { display: flex; justify-content: space-between; gap: 14px; padding: 10px 11px; border-radius: 9px; color: #dce6e9 !important; text-decoration: none !important; font-weight: 750; }
.ta-search-results a:hover { background: #14241d; color: var(--ta-green-2) !important; }
.ta-search-results small { color: #74878f; font-weight: 700; }
.ta-search-empty { padding: 12px; color: #74878f; }
.ta-sync-card {
  min-height: 46px; display: flex; align-items: center; gap: 10px; padding: 7px 12px;
  border: 1px solid #1d3438; border-radius: 12px; background: #0d181c; color: #dce7e9;
}
.ta-sync-card .ta-status-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--ta-green); box-shadow: 0 0 14px rgba(125,255,33,.55); flex: 0 0 auto; }
.ta-sync-card strong, .ta-sync-card small { display: block; }
.ta-sync-card strong { color: var(--ta-green); font-size: 11px; line-height: 1.2; }
.ta-sync-card small { margin-top: 2px; color: #75878f; font-size: 9.5px; }
.ta-sync-card.is-error .ta-status-dot { background: var(--ta-danger); box-shadow: 0 0 14px rgba(255,101,115,.35); }
.ta-sync-card.is-error strong { color: #ff9aa4; }

#user-tools { margin: 0 !important; padding: 0 !important; text-align: left !important; white-space: normal !important; font-size: inherit !important; }
.ta-profile { position: relative; min-width: 185px; }
.ta-profile summary { list-style: none; display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 10px; cursor: pointer; }
.ta-profile summary::-webkit-details-marker { display: none; }
.ta-avatar { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; border: 1px solid #4f9c2c; background: linear-gradient(145deg, #143c16, #0c2610); color: var(--ta-green); font-size: 13px; font-weight: 900; box-shadow: 0 0 18px rgba(125,255,33,.10); }
.ta-profile-copy { min-width: 0; }
.ta-profile-copy strong, .ta-profile-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ta-profile-copy strong { color: #edf4f6; font-size: 11px; }
.ta-profile-copy small { margin-top: 2px; color: #7f9299; font-size: 10px; }
.ta-profile-chevron { color: #8ca0a7; }
.ta-profile-menu { position: absolute; top: calc(100% + 10px); right: 0; width: 190px; padding: 7px; z-index: 1600; border: 1px solid #273b41; border-radius: 12px; background: #0c171b; box-shadow: 0 18px 45px rgba(0,0,0,.4); }
.ta-profile-menu a, .ta-profile-menu button { width: 100%; display: block; padding: 10px 11px; border: 0; border-radius: 8px; background: transparent; color: #d4dfe2 !important; text-align: left; text-decoration: none !important; font: 700 12px/1.25 inherit; cursor: pointer; }
.ta-profile-menu a:hover, .ta-profile-menu button:hover { background: #15231d; color: var(--ta-green) !important; }

/* ===== Standard Django shell ===== */
.main { min-height: calc(100vh - var(--ta-topbar)); background: transparent !important; }
#toggle-nav-sidebar { display: none !important; }
#nav-sidebar {
  flex: 0 0 var(--ta-sidebar) !important;
  width: var(--ta-sidebar) !important;
  min-width: var(--ta-sidebar) !important;
  padding: 16px 12px 20px !important;
  position: sticky !important;
  top: var(--ta-topbar);
  height: calc(100vh - var(--ta-topbar));
  overflow: auto;
  background: linear-gradient(180deg, #081318 0%, #071116 100%) !important;
  border-right: 1px solid #16272d !important;
}
.ta-side-nav { min-height: 100%; display: flex; flex-direction: column; }
.ta-side-nav nav { display: grid; gap: 7px; }
.ta-side-link {
  min-height: 52px; display: flex !important; align-items: center; gap: 15px; padding: 10px 14px !important;
  border-radius: 10px; color: #adbec5 !important; text-decoration: none !important; font-size: 12px; font-weight: 720; line-height: 1.25;
  position: relative; transition: background .16s ease, color .16s ease;
}
.ta-side-link .ta-icon { width: 21px; height: 21px; }
.ta-side-link:hover { background: #10201a; color: #eff8f1 !important; }
.ta-side-link--active { background: linear-gradient(90deg, rgba(125,255,33,.15), rgba(125,255,33,.06)) !important; color: var(--ta-green) !important; }
.ta-side-link--active::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 5px; background: var(--ta-green); box-shadow: 0 0 14px rgba(125,255,33,.35); }
.ta-help-card { margin-top: auto; display: grid; grid-template-columns: 38px 1fr; align-items: center; gap: 10px; padding: 13px; border: 1px solid #1d3036; border-radius: 12px; background: #0d191d; }
.ta-help-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #12351a; color: var(--ta-green); }
.ta-help-icon .ta-icon { width: 18px; height: 18px; }
.ta-help-card strong, .ta-help-card small { display: block; }
.ta-help-card strong { color: #cbd8dc; font-size: 10px; }
.ta-help-card small { margin-top: 2px; color: #687b83; font-size: 9px; line-height: 1.3; }


body.ta-sidebar-fallback #nav-sidebar {
  position: fixed !important;
  left: 0;
  top: var(--ta-topbar);
  z-index: 900;
}
body.ta-sidebar-fallback #content,
body.ta-sidebar-fallback div.breadcrumbs {
  margin-left: var(--ta-sidebar) !important;
  width: calc(100% - var(--ta-sidebar)) !important;
}

#content-start { min-width: 0; }
#content { width: 100%; max-width: none !important; padding: 28px 30px 42px !important; }
#content-main { min-width: 0; }
#content h1, #content h2, #content h3 { color: #fff; font-weight: 850; letter-spacing: -.018em; }
#content h1 { margin: 0 0 4px !important; font-size: clamp(24px, 2.4vw, 34px); line-height: 1.15; }
.ta-page-subtitle { margin: 0 0 20px; color: #7d8e96; font-size: 12px; }
div.breadcrumbs { padding: 10px 30px !important; min-height: 40px; background: #081318 !important; color: #61747c !important; border-bottom: 1px solid #14272d; font-size: 11px; font-weight: 700; }
div.breadcrumbs a { color: #91a4ab !important; }

/* ===== Dashboard exact redesign ===== */
.ta-dashboard { max-width: 1440px; margin: 0 auto; }
.ta-hero { min-height: 116px; margin: -28px -30px 22px; padding: 27px 30px 18px; display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 30px; position: relative; overflow: hidden; background: linear-gradient(115deg, transparent 0 58%, rgba(29,100,35,.16) 58% 73%, rgba(26,126,39,.22) 73% 100%); }
.ta-hero::after { content: ""; position: absolute; right: 8%; top: -95px; width: 410px; height: 160px; transform: rotate(-18deg); background: linear-gradient(90deg, transparent, rgba(125,255,33,.08), transparent); pointer-events: none; }
.ta-breadcrumb-line { display: flex; gap: 9px; align-items: center; margin-bottom: 9px; color: #6d7f87; font-size: 10px; font-weight: 700; }
.ta-breadcrumb-line a { color: #8799a0 !important; text-decoration: none !important; }
.ta-hero h1 { margin: 0 0 4px !important; font-size: clamp(27px, 2.65vw, 38px) !important; }
.ta-hero p { margin: 0; color: #8da0a8; font-size: 13px; }
.ta-hero-message { align-self: center; text-align: right; padding-right: 18px; color: #8ba098; }
.ta-hero-message span, .ta-hero-message small { display: block; }
.ta-hero-message span { color: #a9bab1; font-size: 12px; }
.ta-hero-message small { margin-top: 4px; color: #72857d; font-size: 10px; }
.ta-hero-message::after { content: ""; display: inline-block; width: 14px; height: 3px; margin-left: 8px; border-radius: 3px; background: var(--ta-green); vertical-align: middle; }
.ta-dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.58fr) minmax(330px, .92fr); gap: 20px; align-items: start; }
.ta-dashboard-main { display: grid; gap: 16px; min-width: 0; }
.ta-card { overflow: hidden; border: 1px solid #1d3530; border-radius: 15px; background: linear-gradient(180deg, rgba(16,29,31,.98), rgba(10,21,25,.98)); box-shadow: 0 14px 34px rgba(0,0,0,.20); }
.ta-card-head { min-height: 70px; padding: 12px 16px; display: grid; grid-template-columns: 48px 1fr; align-items: center; gap: 13px; }
.ta-card-head h2, .ta-card-head p { margin: 0; }
.ta-card-head h2 { color: #f7fbfc !important; font-size: 15px !important; font-weight: 850 !important; }
.ta-card-head p { margin-top: 3px; color: #7b8e96; font-size: 10px; }
.ta-card-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 10px; background: linear-gradient(145deg, #1c8d1b, #0d5e12); color: #a3ff5b; box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 6px 18px rgba(39, 179, 43, .15); }
.ta-card-icon .ta-icon { width: 25px; height: 25px; }
.ta-card-icon--round { border-radius: 50%; }
.ta-management-list { margin: 0 12px 12px; overflow: hidden; border: 1px solid #1b2c31; border-radius: 11px; background: #0a1519; }
.ta-management-row { min-height: 51px; display: grid; grid-template-columns: 38px minmax(190px, 1fr) auto; align-items: center; gap: 10px; padding: 7px 10px; border-bottom: 1px solid rgba(95,125,135,.12); transition: background .15s ease; }
.ta-management-row:last-child { border-bottom: 0; }
.ta-management-row:hover { background: rgba(125,255,33,.035); }
.ta-row-icon { width: 30px; height: 30px; display: grid; place-items: center; color: #e2ebee; }
.ta-row-icon .ta-icon { width: 19px; height: 19px; }
.ta-row-copy { display: grid; grid-template-columns: minmax(145px, 220px) minmax(160px, 1fr); align-items: center; gap: 10px; min-width: 0; }
.ta-row-copy strong { color: #edf4f6; font-size: 10.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ta-row-copy small { color: #758991; font-size: 9.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ta-row-actions { display: flex; align-items: center; gap: 7px; }
.ta-btn { min-height: 30px; padding: 6px 10px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid #283b42; border-radius: 7px; background: #162329; color: #dbe5e8 !important; text-decoration: none !important; font-size: 9.5px; font-weight: 800; white-space: nowrap; transition: .15s ease; }
.ta-btn .ta-icon { width: 14px; height: 14px; }
.ta-btn:hover { background: #1c2b31; color: #fff !important; border-color: #3a5058; }
.ta-btn--primary { border-color: #248f25; background: linear-gradient(180deg, #135d17, #0f4813); color: #c8ffad !important; }
.ta-btn--primary:hover { background: #19721d; border-color: #35ad36; color: #efffe7 !important; }
.ta-btn--primary b { color: var(--ta-green); font-size: 16px; line-height: 10px; }
.ta-chevron { width: 27px; height: 30px; display: grid; place-items: center; color: #91a4ac !important; text-decoration: none !important; font-size: 20px; }
.ta-chevron:hover { color: var(--ta-green) !important; }
.ta-activity-card { position: sticky; top: calc(var(--ta-topbar) + 18px); }
.ta-card-head--activity { grid-template-columns: 48px 1fr auto; border-bottom: 1px solid rgba(95,125,135,.12); }
.ta-btn--compact { min-height: 30px; padding-inline: 10px; }
.ta-activity-list { padding: 0 14px 10px; }
.ta-activity-item { min-height: 60px; display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 10px; border-bottom: 1px solid rgba(95,125,135,.13); }
.ta-activity-item:last-child { border-bottom: 0; }
.ta-activity-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #123a17; color: var(--ta-green); font-size: 18px; font-weight: 800; }
.ta-activity-icon.is-change { background: #28134c; color: #bb7bff; }
.ta-activity-icon.is-delete { background: #3b151a; color: #ff8c96; }
.ta-activity-copy { min-width: 0; }
.ta-activity-copy strong, .ta-activity-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ta-activity-copy strong { color: #edf4f6; font-size: 10px; font-weight: 820; }
.ta-activity-copy small { margin-top: 3px; color: #72858d; font-size: 9px; }
.ta-activity-item time { color: #80939b; font-size: 9px; white-space: nowrap; }
.ta-empty-state { padding: 24px 8px; color: #72858d; text-align: center; font-size: 11px; }

/* ===== General admin cards/tables/forms ===== */
.module, .inline-group, .submit-row, .dashboard .module {
  background: var(--ta-panel) !important;
  border: 1px solid var(--ta-line) !important;
  border-radius: 13px !important;
  box-shadow: var(--ta-shadow);
  overflow: hidden;
}
.module h2, .module caption, .inline-group h2 {
  padding: 12px 15px !important;
  background: linear-gradient(90deg, #122118, #0f1a1d) !important;
  color: var(--ta-green) !important;
  border-bottom: 1px solid #20342d;
  font-size: 11px !important;
  font-weight: 900 !important;
  letter-spacing: .045em;
}
.dashboard .module table th, .dashboard .module table td { padding: 10px 13px !important; }
.dashboard .module table tr { border-bottom: 1px solid var(--ta-line-soft); }

#changelist { background: transparent !important; }
#changelist .changelist-form-container { min-width: 0; }
#changelist-search, #changelist .actions { margin: 0 0 12px !important; padding: 11px 12px !important; background: #0d181c !important; border: 1px solid #21353b !important; border-radius: 12px !important; }
#changelist-search > div, #changelist .actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
#changelist-search input[type="text"] { width: min(560px, 100%) !important; min-width: 220px; }
#changelist .actions select { min-width: 240px; }
#changelist .results { overflow: auto; border: 1px solid #21353b; border-radius: 12px; background: #0c171b; }
#result_list { width: 100%; border-collapse: collapse; background: #0c171b !important; color: var(--ta-text) !important; }
#result_list thead th { padding: 11px 12px !important; background: #122026 !important; color: #dce6e9 !important; border-bottom: 1px solid #2c413d !important; font-size: 10px; font-weight: 900; white-space: nowrap; }
#result_list tbody tr:nth-child(odd) { background: #0c171b !important; }
#result_list tbody tr:nth-child(even) { background: #0f1b20 !important; }
#result_list tbody tr:hover { background: #14251f !important; }
#result_list td, #result_list th { padding: 10px 12px !important; border-color: rgba(90,122,132,.13) !important; vertical-align: middle; }
#result_list tbody a { color: #d9e3e6 !important; font-weight: 750; }
#result_list tbody a:hover { color: var(--ta-green) !important; }
#changelist-filter { background: #0d181c !important; border: 1px solid #21353b !important; border-radius: 12px !important; box-shadow: none !important; }
#changelist-filter h2 { padding: 12px 13px !important; background: #122119 !important; color: var(--ta-green) !important; font-size: 11px !important; }
#changelist-filter h3 { margin: 12px 13px 5px !important; color: #c8d4d8 !important; font-size: 10px !important; }
#changelist-filter li { padding: 2px 13px !important; }
#changelist-filter a { color: #879aa2 !important; }
#changelist-filter li.selected a { color: var(--ta-green) !important; font-weight: 850; }

input, textarea, select, .vTextField, .vURLField, .vIntegerField, .vBigIntegerField, .vForeignKeyRawIdAdminField {
  min-height: 38px; padding: 8px 10px !important; background: #0a1519 !important; color: #e8f0f2 !important; border: 1px solid #2a3d44 !important; border-radius: 8px !important; outline: none; box-shadow: none !important;
}
textarea { min-height: 110px; }
input:focus, textarea:focus, select:focus { border-color: rgba(125,255,33,.60) !important; box-shadow: 0 0 0 3px rgba(125,255,33,.08) !important; }
.form-row { padding: 12px 14px !important; border-bottom: 1px solid rgba(91,120,130,.14) !important; }
.form-row label { color: #cbd7db !important; font-weight: 750; }
.help, p.help, form p.help, div.help, form div.help, .help-tooltip { color: #6f838b !important; }
.readonly { color: #b9c7cc !important; }
fieldset.module { margin-bottom: 15px !important; }
.aligned .form-row > div { min-width: 0; }

.button, input[type="submit"], input[type="button"], .submit-row input, a.button {
  min-height: 38px; padding: 8px 15px !important; border: 1px solid #309e2f !important; border-radius: 9px !important; background: linear-gradient(180deg, #1c7d1d, #135d16) !important; color: #edffe5 !important; box-shadow: none !important; font-weight: 850 !important; line-height: 1.2;
}
.button:hover, input[type="submit"]:hover, input[type="button"]:hover, .submit-row input:hover, a.button:hover { background: #248d25 !important; color: #fff !important; }
.default, input[type="submit"].default { background: var(--ta-green) !important; color: #082000 !important; border-color: #9aff55 !important; }
.deletelink, .deletelink-box a { background: #32161a !important; color: #ff9ba4 !important; border: 1px solid #66333a !important; }
.object-tools { margin-top: -4px !important; display: flex; gap: 7px; flex-wrap: wrap; }
.object-tools a { background: #14231b !important; color: var(--ta-green-2) !important; border: 1px solid #31502e !important; border-radius: 9px !important; font-weight: 850 !important; }
.object-tools a:hover { background: #1d6b20 !important; color: #efffe9 !important; }
.submit-row { padding: 11px 13px !important; }

.paginator { margin-top: 11px !important; padding: 10px 12px !important; background: #0d181c !important; color: #8da0a8 !important; border: 1px solid #21353b !important; border-radius: 10px; }
.paginator a:link, .paginator a:visited { padding: 4px 8px; background: #14231b; color: var(--ta-green); border-radius: 7px; }
.messagelist li { border-radius: 10px; border: 1px solid #24402d; background: #102417 !important; color: #e7f2e6 !important; }
.messagelist li.error, .errornote { background: #33151a !important; color: #ffc0c5 !important; border-color: #6d3239 !important; border-radius: 10px; }
.selector { background: transparent !important; }
.selector h2 { background: #122119 !important; }
.calendarbox, .clockbox { background: #0d181c !important; border: 1px solid #263a40 !important; color: #e6eef0 !important; }

/* ===== Login ===== */
.login { background: radial-gradient(circle at 50% 15%, rgba(60,150,48,.14), transparent 30rem), #071013 !important; }
.login #container { max-width: 430px; margin-top: 9vh; border: 1px solid #25383e; border-radius: 18px; overflow: hidden; box-shadow: 0 26px 70px rgba(0,0,0,.40); }
.login #header { display: flex !important; min-height: 98px; justify-content: center; padding: 14px !important; position: static; }
.login #branding { min-width: 0 !important; }
.login .takeaway-brand-subtitle { display: none; }
.login .takeaway-brand img { width: 165px; height: 64px; }
.login #content { padding: 24px !important; background: #0d181c !important; }
.login #nav-global, .login #user-tools, .login .ta-global-footer { display: none !important; }

/* ===== Footer/accent ===== */
.takeaway-admin-accent { position: fixed; right: -100px; bottom: -80px; width: 330px; height: 125px; transform: rotate(-8deg); background: var(--ta-green); opacity: .025; pointer-events: none; z-index: 0; }
.ta-global-footer { position: fixed; left: calc(var(--ta-sidebar) + 18px); right: 18px; bottom: 8px; z-index: 1; display: flex; justify-content: space-between; color: rgba(160,180,187,.32); font-size: 9px; pointer-events: none; }

/* ===== Tablet ===== */
@media (max-width: 1240px) {
  :root { --ta-sidebar: 235px; }
  #header { grid-template-columns: var(--ta-sidebar) minmax(360px,1fr) auto; padding-inline: 18px !important; }
  .takeaway-brand-subtitle { display: none; }
  .ta-global-tools { grid-template-columns: 40px minmax(250px,1fr) 44px; }
  .ta-sync-card { display: none; }
  .ta-dashboard-grid { grid-template-columns: minmax(0,1.4fr) minmax(300px,.8fr); }
  .ta-row-copy { grid-template-columns: minmax(130px, 190px) minmax(130px,1fr); }
}

@media (max-width: 980px) {
  :root { --ta-sidebar: 260px; }
  #header { grid-template-columns: 118px minmax(0,1fr) auto; gap: 10px; padding-inline: 12px !important; }
  .takeaway-brand img { width: 100px; }
  .ta-global-tools { grid-template-columns: 40px minmax(0,1fr) 40px; gap: 8px; }
  .ta-search-shell kbd { display: none; }
  .ta-search-shell input { padding-right: 12px !important; }
  .ta-profile-copy, .ta-profile-chevron { display: none; }
  .ta-profile { min-width: 42px; }
  #nav-sidebar { position: fixed !important; left: 0; top: var(--ta-topbar); z-index: 1400; transform: translateX(-105%); box-shadow: 18px 0 50px rgba(0,0,0,.42); transition: transform .2s ease; }
  body.ta-sidebar-fallback #content, body.ta-sidebar-fallback div.breadcrumbs { margin-left: 0 !important; width: 100% !important; }
  body.ta-sidebar-open #nav-sidebar { transform: translateX(0); }
  #content { padding: 22px 16px 36px !important; }
  .ta-hero { margin: -22px -16px 18px; padding: 22px 16px 16px; }
  .ta-dashboard-grid { grid-template-columns: 1fr; }
  .ta-activity-card { position: static; }
  .ta-global-footer { left: 18px; }
}

@media (max-width: 680px) {
  :root { --ta-topbar: 64px; }
  #header { min-height: var(--ta-topbar); grid-template-columns: 95px minmax(0,1fr) 42px; padding-inline: 8px !important; }
  .takeaway-brand img { width: 88px; height: 38px; }
  .ta-global-tools { grid-template-columns: 36px minmax(0,1fr); }
  .ta-bell { display: none; }
  .ta-menu-button { width: 36px; height: 38px; }
  .ta-search-shell input { height: 40px; font-size: 11px !important; }
  .ta-search-shell > .ta-icon { left: 12px; width: 17px; height: 17px; }
  .ta-search-shell input { padding-left: 38px !important; }
  .ta-avatar { width: 38px; height: 38px; }
  #content { padding: 16px 8px 32px !important; }
  .ta-hero { min-height: 102px; margin: -16px -8px 14px; padding: 18px 12px 12px; grid-template-columns: 1fr; }
  .ta-hero-message { display: none; }
  .ta-hero h1 { font-size: 25px !important; }
  .ta-hero p { font-size: 11px; }
  .ta-card-head { grid-template-columns: 42px 1fr; min-height: 62px; padding: 10px 11px; }
  .ta-card-icon { width: 40px; height: 40px; }
  .ta-card-head--activity { grid-template-columns: 42px 1fr; }
  .ta-card-head--activity .ta-btn { grid-column: 1 / -1; width: 100%; }
  .ta-management-list { margin: 0 7px 7px; }
  .ta-management-row { grid-template-columns: 30px minmax(0,1fr); gap: 7px; padding: 9px 7px; }
  .ta-row-copy { display: block; }
  .ta-row-copy strong, .ta-row-copy small { display: block; }
  .ta-row-copy small { margin-top: 2px; }
  .ta-row-actions { grid-column: 2; flex-wrap: wrap; }
  .ta-chevron { display: none; }
  .ta-btn { min-height: 28px; padding: 5px 8px; }
  #changelist-search > div, #changelist .actions { align-items: stretch; }
  #changelist-search input[type="text"], #changelist .actions select { width: 100% !important; min-width: 0; }
  .button, input[type="submit"], input[type="button"], .submit-row input, a.button { min-height: 40px; }
  .ta-global-footer { display: none; }
}


/* ===== v2.9.7.1 — layout fidelity correction ===== */
/* Django's stock dashboard.css fixes #content to ~500px. The new dashboard
   must own the full workspace after the navigation rail. */
#content,
.dashboard #content,
.ta-dashboard-page #content,
.colMS,
.dashboard .colMS {
  width: auto !important;
  max-width: none !important;
  margin-right: 0 !important;
}
.main > #content-start {
  flex: 1 1 0 !important;
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
}
#content-main,
.dashboard #content-main,
.ta-dashboard-page #content-main {
  width: 100% !important;
  max-width: none !important;
  float: none !important;
}

/* Header DOM order in Django is branding -> user tools -> nav-global.
   Explicit grid areas keep the approved design: brand | search/status | user. */
#header {
  grid-template-columns: var(--ta-sidebar) minmax(520px, 1fr) minmax(180px, 220px) !important;
  grid-template-areas: "brand global user" !important;
}
#branding { grid-area: brand; }
#nav-global { grid-area: global; width: 100%; min-width: 0; }
#user-tools { grid-area: user; width: 100%; min-width: 0; justify-self: end; }
.ta-profile { width: 100%; min-width: 0; }
.ta-global-tools {
  grid-template-columns: 42px minmax(320px, 1fr) 250px 44px !important;
  width: 100%;
}

/* Dashboard now uses the complete content plane and matches the approved
   two-column composition instead of the narrow stock-Django dashboard. */
.ta-dashboard {
  width: 100%;
  max-width: none !important;
  margin: 0 !important;
}
.ta-hero {
  width: auto;
  min-height: 132px;
  margin-bottom: 24px;
  padding-top: 30px;
  padding-bottom: 22px;
}
.ta-hero h1 {
  max-width: 860px;
  font-size: clamp(30px, 2.45vw, 40px) !important;
  line-height: 1.08 !important;
}
.ta-hero p { font-size: 13px; }
.ta-dashboard-grid {
  grid-template-columns: minmax(0, 1.72fr) minmax(360px, .98fr) !important;
  gap: 22px !important;
  width: 100%;
}
.ta-dashboard-main { gap: 18px; }
.ta-card-head { min-height: 76px; padding: 14px 17px; }
.ta-card-head h2 { font-size: 17px !important; }
.ta-card-head p { font-size: 11px; }
.ta-management-row {
  min-height: 54px;
  grid-template-columns: 38px minmax(260px, 1fr) auto;
  padding: 8px 11px;
}
.ta-row-copy {
  grid-template-columns: minmax(190px, 250px) minmax(180px, 1fr);
  gap: 14px;
}
.ta-row-copy strong { font-size: 12px; }
.ta-row-copy small { font-size: 10.5px; }
.ta-btn { min-height: 32px; padding: 6px 11px; font-size: 10.5px; }
.ta-activity-list { padding-inline: 15px; }
.ta-activity-item { min-height: 62px; grid-template-columns: 40px minmax(0,1fr) auto; }
.ta-activity-copy strong { font-size: 11.5px; }
.ta-activity-copy small { font-size: 10px; }
.ta-activity-item time { font-size: 9.5px; }

/* Internal admin pages: compact title line and one coherent content surface. */
body:not(.ta-dashboard-page) #content { position: relative; padding-top: 26px !important; }
body:not(.ta-dashboard-page) #content > h1 {
  max-width: calc(100% - 250px);
  padding-right: 16px;
  font-size: clamp(25px, 2vw, 31px) !important;
  line-height: 1.13 !important;
}
body:not(.ta-dashboard-page) #content > .ta-page-subtitle { margin: 4px 0 18px; }
body:not(.ta-dashboard-page) #content > .object-tools {
  position: absolute;
  top: 25px;
  right: 30px;
  margin: 0 !important;
  z-index: 5;
  justify-content: flex-end;
  max-width: 230px;
}
body:not(.ta-dashboard-page) #content > .object-tools a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 13px !important;
}

/* Changelists: table + filter form one balanced grid. */
#changelist {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 270px;
  align-items: start;
  gap: 18px;
  width: 100% !important;
}
#changelist:not(:has(#changelist-filter)) { grid-template-columns: minmax(0,1fr); }
#changelist .changelist-form-container {
  grid-column: 1;
  width: auto !important;
  min-width: 0 !important;
  float: none !important;
}
#changelist-filter {
  grid-column: 2;
  width: auto !important;
  min-width: 0 !important;
  margin: 0 !important;
  position: sticky !important;
  top: calc(var(--ta-topbar) + 16px);
  max-height: calc(100vh - var(--ta-topbar) - 32px);
  overflow: auto;
}
#toolbar {
  margin: 0 0 14px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}
#changelist-search {
  width: 100% !important;
  margin: 0 !important;
  padding: 10px 12px !important;
}
#changelist-search > div {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}
#changelist-search input[type="text"] {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
}
#changelist-search input[type="submit"] { min-width: 84px; }
#changelist .results { width: 100%; max-width: 100%; }
#result_list { min-width: 760px; }
#changelist-filter h2 { font-size: 12px !important; }
#changelist-filter h3 { font-size: 11px !important; }
#changelist-filter a { font-size: 11px; line-height: 1.35; }

/* Keep the desktop approved geometry through common notebook widths. */
@media (max-width: 1420px) {
  #header {
    grid-template-columns: var(--ta-sidebar) minmax(390px,1fr) 52px !important;
  }
  .ta-profile-copy, .ta-profile-chevron { display: none; }
  .ta-profile { width: 44px; justify-self: end; }
  .ta-global-tools { grid-template-columns: 40px minmax(260px,1fr) 220px 42px !important; }
  .ta-dashboard-grid { grid-template-columns: minmax(0,1.55fr) minmax(330px,.85fr) !important; }
  .ta-row-copy { grid-template-columns: minmax(165px,220px) minmax(150px,1fr); }
}

@media (max-width: 1120px) {
  #header {
    grid-template-columns: 116px minmax(0,1fr) 46px !important;
    grid-template-areas: "brand global user" !important;
  }
  .takeaway-brand-subtitle { display: none; }
  .ta-global-tools { grid-template-columns: 40px minmax(0,1fr) 42px !important; }
  .ta-sync-card { display: none; }
  .ta-dashboard-grid { grid-template-columns: 1fr !important; }
  .ta-activity-card { position: static; }
  #changelist { grid-template-columns: minmax(0,1fr) 240px; gap: 14px; }
}

@media (max-width: 980px) {
  #changelist { grid-template-columns: 1fr !important; }
  #changelist-filter {
    grid-column: 1;
    position: static !important;
    max-height: none;
  }
  body:not(.ta-dashboard-page) #content > h1 { max-width: 100%; padding-right: 0; }
  body:not(.ta-dashboard-page) #content > .object-tools {
    position: static;
    max-width: none;
    margin: 10px 0 16px !important;
    justify-content: flex-start;
  }
}

@media (max-width: 680px) {
  #changelist-search > div { grid-template-columns: 1fr; }
  #changelist-search input[type="submit"] { width: 100%; }
}

/* ===== v2.9.7.2 — readable workspace + Russian UI correction ===== */
/* Keep every admin screen inside the viewport. Horizontal scrolling, when a
   data table truly needs it, belongs to that table only — never to the page. */
html, body, #container {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden !important;
}
.main {
  width: 100%;
  max-width: 100vw;
  min-width: 0 !important;
  overflow-x: hidden !important;
}
.main > #content-start {
  flex: 1 1 0 !important;
  width: 0 !important;
  min-width: 0 !important;
  max-width: none !important;
  overflow-x: hidden !important;
}
#content,
#content-main,
#changelist,
#changelist .changelist-form-container,
#changelist .results {
  min-width: 0 !important;
  max-width: 100% !important;
}
#content {
  width: 100% !important;
  overflow-x: hidden !important;
}
div.breadcrumbs {
  width: 100% !important;
  max-width: 100% !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Django has no #nav-global wrapper: the block output itself is a direct
   #header child. Put the real .ta-global-tools in the middle grid area. */
#header {
  width: 100%;
  max-width: 100vw;
  grid-template-columns: var(--ta-sidebar) minmax(0, 1fr) minmax(190px, 220px) !important;
  grid-template-areas: "brand global user" !important;
  overflow: visible;
}
#branding { grid-area: brand; min-width: 0; }
.ta-global-tools {
  grid-area: global !important;
  min-width: 0 !important;
  width: 100% !important;
  grid-template-columns: 42px minmax(0, 1fr) 250px 44px !important;
}
#user-tools {
  grid-area: user !important;
  width: 100%;
  min-width: 0;
  justify-self: stretch;
}
.ta-profile { width: 100%; min-width: 0; }
.ta-search-shell, .ta-search-shell input { min-width: 0 !important; }

/* Dashboard labels/descriptions must be readable instead of ellipsized. */
.ta-row-copy strong,
.ta-row-copy small,
.ta-activity-copy strong,
.ta-activity-copy small {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  overflow-wrap: anywhere;
}
.ta-management-row,
.ta-activity-item { height: auto; }
.ta-row-copy { align-items: start; }

/* Changelist: balanced table + filter, without forcing the entire page wider
   than the screen. */
#changelist {
  grid-template-columns: minmax(0, 1fr) minmax(220px, 245px) !important;
  gap: 16px !important;
}
#changelist .changelist-form-container {
  overflow: hidden;
}
#changelist .results {
  width: 100% !important;
  overflow-x: auto !important;
  overflow-y: visible;
  scrollbar-gutter: stable;
  overscroll-behavior-inline: contain;
}
#result_list {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: auto !important;
}
#result_list thead th,
#result_list tbody th,
#result_list tbody td,
#result_list .nowrap {
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: normal;
  line-height: 1.28;
}
#result_list thead th {
  vertical-align: bottom;
}
#result_list td,
#result_list th {
  max-width: 260px;
}
#result_list .field-id,
#result_list .column-id,
#result_list .field-object_id,
#result_list .column-object_id {
  width: 62px;
  max-width: 74px;
}

/* Search markup is label + input + button. The old two-column rule sent the
   button to a second full-width row and made the interface look broken. */
#changelist-search > div {
  display: grid !important;
  grid-template-columns: 24px minmax(180px, 1fr) auto !important;
  align-items: center !important;
  gap: 10px !important;
}
#changelist-search label {
  width: 24px;
  margin: 0 !important;
  display: grid;
  place-items: center;
}
#changelist-search label img {
  display: block;
  width: 18px;
  height: 18px;
  opacity: .62;
}
#changelist-search input[type="text"] {
  grid-column: 2;
  width: 100% !important;
  min-width: 0 !important;
}
#changelist-search input[type="submit"] {
  grid-column: 3;
  width: auto !important;
  min-width: 92px;
  margin: 0 !important;
}

/* Keep filter copy readable and let long Russian values wrap. */
#changelist-filter,
#changelist-filter * { min-width: 0; }
#changelist-filter a {
  white-space: normal !important;
  overflow-wrap: anywhere;
}

/* Common notebook widths: preserve profile/search without page overflow. */
@media (max-width: 1420px) {
  #header {
    grid-template-columns: var(--ta-sidebar) minmax(0,1fr) 52px !important;
    grid-template-areas: "brand global user" !important;
  }
  .ta-global-tools {
    grid-template-columns: 40px minmax(0,1fr) 205px 40px !important;
  }
}
@media (max-width: 1180px) {
  .ta-sync-card { display: none !important; }
  .ta-global-tools { grid-template-columns: 40px minmax(0,1fr) 40px !important; }
  #changelist { grid-template-columns: minmax(0,1fr) 220px !important; }
}
@media (max-width: 980px) {
  .main > #content-start {
    flex: 1 1 100% !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  #changelist { grid-template-columns: 1fr !important; }
  #changelist-filter { grid-column: 1 !important; }
}
@media (max-width: 680px) {
  #changelist-search > div {
    grid-template-columns: 22px minmax(0,1fr) !important;
  }
  #changelist-search input[type="submit"] {
    grid-column: 1 / -1;
    width: 100% !important;
  }
}

/* ===== v2.9.7.3 — unified beautiful inner pages ===== */
/* Bring changelists and inner pages to the same polished visual language as
   the main “Справочники и управление” dashboard: hero card, compact actions,
   search surface, card-based table block and tidy filter sidebar. */
body:not(.ta-dashboard-page) #content {
  padding-top: 0 !important;
}
.ta-inner-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(240px, .65fr);
  gap: 18px;
  align-items: stretch;
  margin: 0 0 18px;
  padding: 22px 22px 20px;
  border-radius: 22px;
  border: 1px solid rgba(66, 112, 98, .42);
  background:
    linear-gradient(135deg, rgba(10,18,22,.98) 0%, rgba(7,17,22,.98) 48%, rgba(9,36,22,.92) 100%),
    radial-gradient(circle at 86% 14%, rgba(125,255,33,.16), transparent 34%);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .24);
  overflow: hidden;
}
.ta-inner-hero::before,
.ta-inner-hero::after {
  content: "";
  position: absolute;
  right: -56px;
  background: linear-gradient(135deg, rgba(125,255,33,.16), rgba(125,255,33,.04));
  transform: skewX(-26deg);
  pointer-events: none;
}
.ta-inner-hero::before {
  top: -28px;
  width: 240px;
  height: 128px;
}
.ta-inner-hero::after {
  top: 34px;
  width: 196px;
  height: 110px;
  opacity: .55;
}
.ta-inner-hero-main {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  min-width: 0;
}
.ta-inner-hero-copy {
  min-width: 0;
}
.ta-inner-hero-copy h1 {
  margin: 0 !important;
  max-width: none !important;
  padding-right: 0 !important;
  font-size: clamp(25px, 2.35vw, 38px) !important;
  line-height: 1.08 !important;
  letter-spacing: -.03em;
}
.ta-inner-hero-copy .ta-page-subtitle {
  margin: 8px 0 0 !important;
  max-width: 760px;
  color: var(--ta-text-2);
}
.ta-inner-hero-actions {
  display: flex;
  justify-content: flex-end;
  align-items: start;
}
.ta-inner-hero-actions .object-tools {
  position: static !important;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
.ta-inner-hero-actions .object-tools li {
  list-style: none;
  margin: 0 !important;
}
.ta-inner-hero-actions .object-tools a {
  min-height: 40px !important;
  padding: 9px 16px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(112, 220, 69, .26) !important;
  background: linear-gradient(180deg, rgba(28, 138, 41, .95), rgba(18, 108, 31, .98)) !important;
  color: #f3ffe9 !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 8px 18px rgba(22, 90, 25, .18);
}
.ta-inner-hero-actions .object-tools a:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}
.ta-inner-hero-aside {
  position: relative;
  z-index: 1;
  align-self: stretch;
  justify-self: end;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 10px 0 10px 18px;
  color: #dbe7d2;
  text-align: right;
}
.ta-inner-hero-aside span {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: #9fc18d;
}
.ta-inner-hero-aside strong {
  font-size: 18px;
  line-height: 1.14;
}
.ta-inner-hero-aside small {
  color: rgba(208, 231, 202, .76);
  font-size: 11px;
  line-height: 1.45;
}

/* Unified search/action area */
#changelist .changelist-form-container {
  display: grid;
  gap: 16px;
}
#toolbar {
  margin: 0 !important;
  padding: 14px !important;
  border-radius: 18px !important;
  border: 1px solid rgba(43, 66, 74, .92) !important;
  background: linear-gradient(180deg, rgba(10,22,26,.96), rgba(8,19,23,.96)) !important;
  box-shadow: 0 12px 26px rgba(0,0,0,.18);
}
#changelist-search {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}
#changelist-search > div {
  grid-template-columns: 24px minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 10px !important;
}
#changelist-search label img {
  opacity: .72;
}
#changelist-search input[type="text"] {
  height: 48px !important;
  border-radius: 13px !important;
  border: 1px solid rgba(38, 57, 63, .94) !important;
  background: #0a1519 !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.02) !important;
}
#changelist-search input[type="submit"] {
  height: 48px !important;
  min-width: 96px;
  padding: 0 20px !important;
  border-radius: 13px !important;
  border: 1px solid rgba(112, 220, 69, .24) !important;
  background: linear-gradient(180deg, rgba(31, 153, 45, .96), rgba(21, 119, 34, .98)) !important;
  color: #f3ffe9 !important;
  font-weight: 900 !important;
  letter-spacing: .01em;
}
#changelist-search input[type="submit"]:hover {
  filter: brightness(1.05);
}

/* Data card */
#changelist .results {
  padding: 0 !important;
  border-radius: 18px;
  border: 1px solid rgba(43, 66, 74, .92) !important;
  background: linear-gradient(180deg, rgba(10,23,27,.98), rgba(8,18,22,.98)) !important;
  box-shadow: 0 14px 30px rgba(0,0,0,.2);
}
#result_list {
  width: max-content !important;
  min-width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
}
#result_list thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  white-space: nowrap !important;
  min-width: 114px;
  font-size: 11px !important;
  line-height: 1.22 !important;
  letter-spacing: .02em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #112028, #0f1c23) !important;
}
#result_list td,
#result_list th {
  min-width: 114px;
  max-width: none !important;
  padding: 14px 12px !important;
}
#result_list tbody td {
  font-size: 13px;
}
#result_list tbody td,
#result_list tbody th {
  border-top: 1px solid rgba(83, 112, 122, .15) !important;
}
#result_list tbody tr:first-child td,
#result_list tbody tr:first-child th {
  border-top-color: rgba(83, 112, 122, .22) !important;
}
#result_list tbody tr:hover {
  background: rgba(17, 43, 31, .62) !important;
}
#result_list .field-id,
#result_list .column-id,
#result_list .field-object_id,
#result_list .column-object_id,
#result_list .action-checkbox-column {
  min-width: 60px;
  width: 60px;
  white-space: nowrap !important;
}
#result_list .field-status,
#result_list .column-status,
#result_list .field-payment_mode,
#result_list .column-payment_mode,
#result_list .field-payment_method,
#result_list .column-payment_method {
  min-width: 130px;
}
#result_list .field-store,
#result_list .column-store,
#result_list .field-employee,
#result_list .column-employee,
#result_list .field-sales_rep,
#result_list .column-sales_rep,
#result_list .field-shop,
#result_list .column-shop {
  min-width: 170px;
}
#result_list .field-created,
#result_list .column-created,
#result_list .field-started_at,
#result_list .column-started_at,
#result_list .field-ended_at,
#result_list .column-ended_at,
#result_list .field-updated_at,
#result_list .column-updated_at {
  min-width: 148px;
}

/* Filter card mirrors the dashboard side card. */
#changelist-filter {
  border-radius: 18px !important;
  border: 1px solid rgba(43, 66, 74, .92) !important;
  background: linear-gradient(180deg, rgba(10,22,26,.98), rgba(8,18,22,.98)) !important;
  box-shadow: 0 14px 30px rgba(0,0,0,.18);
}
#changelist-filter h2 {
  margin: 0 !important;
  padding: 17px 18px !important;
  border-radius: 18px 18px 0 0;
  border-bottom: 1px solid rgba(61, 86, 95, .45);
  background: linear-gradient(180deg, rgba(14, 55, 28, .82), rgba(12, 40, 22, .72));
  color: var(--ta-green-2) !important;
  letter-spacing: .02em;
}
#changelist-filter > div,
#changelist-filter details,
#changelist-filter ul {
  padding-inline: 16px !important;
}
#changelist-filter h3 {
  margin: 14px 0 8px !important;
  font-size: 13px !important;
  color: #f3f8f6 !important;
}
#changelist-filter ul {
  margin: 0 0 12px !important;
}
#changelist-filter li {
  margin: 0 0 6px !important;
}
#changelist-filter a {
  display: inline-block;
  border-radius: 8px;
  padding: 2px 0;
}
#changelist-filter a:hover {
  color: var(--ta-green-2) !important;
}

/* Forms and detail pages inherit the same surface language. */
.change-form .module,
body.change-form .submit-row,
body.change-form .inline-group,
body.delete-confirmation form,
body.change-list #changelist .actions {
  border-radius: 18px !important;
  border-color: rgba(43, 66, 74, .92) !important;
  box-shadow: 0 12px 26px rgba(0,0,0,.16);
}

@media (max-width: 1180px) {
  .ta-inner-hero {
    grid-template-columns: 1fr;
  }
  .ta-inner-hero-aside {
    padding: 0;
    text-align: left;
  }
}
@media (max-width: 900px) {
  .ta-inner-hero-main {
    grid-template-columns: 1fr;
  }
  .ta-inner-hero-actions {
    justify-content: flex-start;
  }
}
@media (max-width: 680px) {
  .ta-inner-hero {
    padding: 18px 16px;
    border-radius: 18px;
  }
  #toolbar,
  #changelist .results,
  #changelist-filter {
    border-radius: 16px !important;
  }
}

/* v2.9.7.4: constrain grid items, not only the table inside them. */
#changelist #changelist-form {
  min-width: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
}
#changelist .results {
  max-height: min(65vh, 720px);
  overflow: auto !important;
}
#changelist .results:focus-visible { outline: 2px solid var(--ta-green); outline-offset: 2px; }
#changelist:not(:has(#changelist-filter)) {
  grid-template-columns: minmax(0, 1fr) !important;
}
#changelist-search > div { min-width: 0; }
#changelist-search .quiet { grid-column: 1 / -1; }
.ta-inner-hero-copy h1, .ta-inner-hero-aside strong {
  overflow-wrap: anywhere;
}
.ta-inner-hero-actions, .ta-inner-hero-actions .object-tools,
.ta-inner-hero-actions .object-tools li { min-width: 0; max-width: 100%; }
.ta-inner-hero-actions .object-tools a {
  display: inline-flex;
  align-items: center;
  white-space: normal;
  overflow-wrap: anywhere;
  text-transform: none;
}
body.change-form .form-row input:not([type="checkbox"]):not([type="radio"]),
body.change-form .form-row textarea,
body.change-form .form-row select {
  max-width: 100% !important;
  box-sizing: border-box;
}
body.change-form .readonly, body.change-form #content > h2 {
  overflow-wrap: anywhere;
}
body.change-form .related-widget-wrapper,
body.change-form .flex-container > :not(label) {
  min-width: 0;
  max-width: 100%;
}
body.change-form .submit-row { flex-wrap: wrap; gap: 10px; }
body.change-form .submit-row input { white-space: normal; max-width: 100%; }
body.change-form .inline-group .tabular { overflow-x: auto; }
#change-history { overflow-x: auto; }
.paginator { line-height: 2.2; overflow-wrap: anywhere; }
.paginator a, .paginator .this-page { display: inline-block; }
@media (max-width: 1180px) {
  body:not(.login) #header {
    grid-template-columns: 116px minmax(0, 1fr) 46px !important;
  }
  .ta-inner-hero-aside { display: none; }
}
@media (max-width: 680px) {
  body:not(.login) #header {
    grid-template-columns: 88px minmax(0, 1fr) 40px !important;
    gap: 8px;
  }
  .ta-global-tools {
    grid-template-columns: 36px minmax(0, 1fr) !important;
    gap: 6px;
  }
  #changelist-search > div {
    grid-template-columns: 22px minmax(0, 1fr) !important;
  }
  #changelist-search input[type="submit"] {
    grid-column: 1 / -1 !important;
    width: 100% !important;
  }
  .ta-inner-hero-actions .object-tools { float: none; }
  body.change-form .submit-row > * { width: 100%; margin: 0 !important; }
}

/* Text acceptance: let content wrap instead of clipping at fixed widths. */
div.breadcrumbs {
  white-space: normal;
  overflow-wrap: anywhere;
  text-overflow: clip;
  height: auto;
}
.form-row .help, .form-row .help > div,
.form-row label, .form-row .readonly, .form-row .file-upload {
  max-width: 100% !important;
  box-sizing: border-box;
  overflow-wrap: anywhere;
  white-space: normal;
}
.form-row .help { width: auto !important; }
.aligned .form-row > div { min-width: 0 !important; max-width: 100% !important; }
@media (max-width: 767px) {
  .aligned .form-row > div { width: 100% !important; }
}
.form-row .help, .form-row .help-tooltip { color: #9bafb7 !important; }
.ta-inner-hero-actions .object-tools li { height: auto; float: none; }
#result_list {
  width: 100% !important;
  table-layout: auto !important;
}
#result_list thead th, #result_list thead th .text a,
#result_list thead th .text span {
  white-space: normal !important;
  overflow-wrap: anywhere;
}
#result_list td, #result_list th { max-width: 320px !important; }
#result_list thead th .text a, #result_list thead th .text span {
  overflow-wrap: normal;
}
#result_list thead th.sorted .text { margin-right: 0; }
#result_list thead th .sortoptions { float: none; margin: 0 0 5px; }
.inline-group .tabular td.original p {
  position: static !important;
  height: auto !important;
  overflow: visible !important;
  white-space: normal;
  overflow-wrap: anywhere;
}
.inline-group .tabular tr.has_original td { padding-top: 12px !important; }
.inline-group .tabular fieldset.module { overflow: visible; }
.ta-profile-copy strong, .ta-profile-copy small {
  white-space: normal;
  overflow-wrap: anywhere;
  overflow: visible;
  text-overflow: clip;
}

/* Inline records need a readable first column after removing Django's
   absolutely positioned, single-line label. */
.inline-group .tabular td.original:has(p) { min-width: 180px; }
.inline-group .tabular td.original p {
  min-width: 150px;
  padding: 0 10px !important;
  font-size: 12px !important;
  line-height: 1.5;
  color: var(--ta-text-2) !important;
}

/* Django's autocomplete has its own stylesheet loaded after extrastyle. */
body .related-widget-wrapper {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
body .related-widget-wrapper > .select2-container {
  flex: 0 1 320px;
  min-width: 0;
  max-width: 100% !important;
}
body .select2-container--admin-autocomplete .select2-selection--single,
body .select2-container--admin-autocomplete .select2-selection--multiple {
  height: auto !important;
  min-height: 40px;
  background: #0a1519 !important;
  border: 1px solid #2a3d44 !important;
  border-radius: 8px !important;
}
body .select2-container--admin-autocomplete .select2-selection--single .select2-selection__rendered {
  white-space: normal !important;
  overflow-wrap: anywhere;
  text-overflow: clip;
  line-height: 1.5 !important;
  padding: 9px 30px 9px 10px;
  color: var(--ta-text) !important;
}
body .select2-container--admin-autocomplete .select2-selection--single .select2-selection__arrow {
  top: 50%;
  transform: translateY(-50%);
}
body .select2-container--admin-autocomplete .select2-dropdown {
  background: var(--ta-panel) !important;
  color: var(--ta-text) !important;
  border-color: #2a3d44 !important;
}
body .select2-container--admin-autocomplete .select2-results__option {
  padding: 9px 12px;
  white-space: normal;
  overflow-wrap: anywhere;
  color: var(--ta-text-2) !important;
}
body .select2-container--admin-autocomplete .select2-results__option--highlighted[aria-selected],
body .select2-container--admin-autocomplete .select2-results__option[aria-selected=true] {
  background: #19452a !important;
  color: #edffe5 !important;
}
body .select2-container--admin-autocomplete.select2-container--focus .select2-selection,
body .select2-container--admin-autocomplete.select2-container--open .select2-selection {
  outline: 2px solid var(--ta-green);
  outline-offset: 2px;
}
.inline-group .tabular table { background: var(--ta-panel); }
.inline-group .tabular thead th {
  background: #122026 !important;
  color: var(--ta-text) !important;
  border-color: var(--ta-line) !important;
  white-space: normal;
  min-width: 100px;
}
.inline-group .tabular tbody td {
  background: var(--ta-panel) !important;
  border-color: var(--ta-line) !important;
  color: var(--ta-text-2) !important;
  vertical-align: top;
}
.inline-group .tabular tbody tr:nth-child(even) td { background: var(--ta-panel-2) !important; }
@media (max-width: 767px) {
  body.change-form .submit-row input:not(.default) {
    height: auto !important;
    min-height: 64px;
    line-height: 1.5;
  }
}
@media (max-width: 680px) {
  .ta-management-row { grid-template-columns: 30px minmax(0, 1fr); }
  .ta-row-copy { min-width: 0; }
}
@media (min-width: 981px) {
  body.ta-sidebar-collapsed #nav-sidebar { display: none !important; }
  body.ta-sidebar-collapsed.ta-sidebar-fallback #content,
  body.ta-sidebar-collapsed.ta-sidebar-fallback div.breadcrumbs {
    margin-left: 0 !important;
    width: 100% !important;
  }
}
.ta-search-results a:focus-visible { outline: 2px solid var(--ta-green); outline-offset: -2px; }
.ta-search-results a span { min-width: 0; overflow-wrap: anywhere; }
.ta-search-results a small { flex: 0 0 auto; }
.ta-field-full-value {
  flex-basis: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 6px 0 0;
  padding: 8px 10px;
  border-left: 2px solid #31502e;
  background: #10221b;
  color: var(--ta-text-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.5;
}
.ta-field-full-value[hidden] { display: none !important; }
.ta-full-value-host { flex-wrap: wrap; }
#change-history { border: 1px solid var(--ta-line); border-radius: 16px; }
#change-history table { width: 100%; background: var(--ta-panel); }
#change-history th, #change-history td {
  padding: 14px 16px;
  white-space: normal;
  overflow-wrap: anywhere;
  color: var(--ta-text-2);
  border-color: var(--ta-line);
  background: var(--ta-panel);
  vertical-align: top;
}
#change-history thead th { background: #122026; color: var(--ta-text); }
#change-history tbody tr:nth-child(even) > * { background: var(--ta-panel-2); }
#change-history .paginator { background: #122026; color: var(--ta-text-2); }
body .calendarbox, body .clockbox {
  background: var(--ta-panel);
  color: var(--ta-text);
  border: 1px solid var(--ta-line);
  border-radius: 12px;
  box-shadow: var(--ta-shadow);
}
body .calendar table { background: var(--ta-panel); }
body .calendar td, body .calendar th {
  background: var(--ta-panel) !important;
  color: var(--ta-text-2);
  border-color: var(--ta-line) !important;
}
body .calendar td a, body .timelist a { color: var(--ta-text-2) !important; }
body .calendar td a:hover, body .timelist a:hover,
body .calendar td.selected a { background: #19452a !important; color: #edffe5 !important; }
body .calendar-shortcuts { background: #122026; }
body .calendar-cancel { background: #182a31; }
body .selector .selector-available h2, body .selector .selector-chosen h2 {
  background: #122026 !important;
  color: var(--ta-text) !important;
  border-color: var(--ta-line) !important;
}
body .selector .selector-chosen h2 { border-left: 3px solid var(--ta-green); }
body .selector .selector-available, body .selector .selector-chosen,
body .selector .selector-filter, body .selector .selector-chosen .selector-filter {
  background: var(--ta-panel);
  border-color: var(--ta-line);
  min-width: 0;
}

/* Inner pages have one document scroller; only data tables scroll internally.
   overflow-x:hidden also made overflow-y:auto and shifted sticky children. */
body:not(.ta-dashboard-page),
body:not(.ta-dashboard-page) #container,
body:not(.ta-dashboard-page) .main,
body:not(.ta-dashboard-page) #content-start,
body:not(.ta-dashboard-page) #content {
  overflow-x: clip !important;
  overflow-y: visible !important;
}
body:not(.ta-dashboard-page) #nav-sidebar { align-self: flex-start; }
#changelist.ta-changelist {
  overflow: visible !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}
.ta-inner-hero { grid-template-columns: minmax(0, 1fr); }
.ta-inner-hero-main { align-items: center; }
.ta-inner-hero-aside { display: none; }
.ta-inner-hero-actions { align-items: center; }
#changelist-filter.ta-filter-card { align-self: start; }
#changelist-filter details { padding: 14px 16px !important; border-top: 1px solid var(--ta-line); }
#changelist-filter details:first-of-type { border-top: 0; }
#changelist-filter details > summary { font-size: 13px; font-weight: 700; line-height: 1.5; color: var(--ta-text); }
#changelist-filter details > ul { padding: 8px 0 0 !important; margin: 0 !important; }
#changelist-filter li { margin: 0 0 3px !important; padding: 0 !important; list-style: none; }
#changelist-filter li a { display: block; padding: 7px 10px; font-size: 13px; line-height: 1.5; color: #b1c1c8 !important; }
#changelist-filter li.selected { border-left: 0; }
#changelist-filter li.selected a { background: #173321; color: var(--ta-green) !important; }
#changelist-filter #changelist-filter-extra-actions { padding: 12px 16px !important; }
#changelist-filter #changelist-filter-extra-actions h3 { margin: 0 !important; }
#changelist-filter #changelist-filter-extra-actions a { font-size: 12px; }
#result_list thead th { font-size: 12px !important; line-height: 1.4 !important; }
#result_list tbody td, #result_list tbody th { font-size: 14px; line-height: 1.5; }
.ta-table-scroll-hint { margin: 8px 0 !important; padding: 0 4px; color: #b1c1c8; font-size: 12px; line-height: 1.5; }
.ta-table-scroll-hint[hidden] { display: none !important; }
@media (min-width: 981px) {
  #changelist .results { max-height: clamp(260px, calc(100dvh - 400px), 720px); }
}
/* v2.9.7.6: custom navigation owns visibility, including Django's mobile reset. */
#nav-sidebar { margin-left: 0 !important; left: 0 !important; visibility: visible !important; }
.ta-sidebar-backdrop { display: none; }
@media (max-width: 980px) {
  #nav-sidebar {
    display: block !important;
    visibility: hidden !important;
    pointer-events: none;
    width: min(300px, calc(100vw - 48px)) !important;
    min-width: 0 !important;
    height: calc(100vh - var(--ta-topbar));
    height: calc(100dvh - var(--ta-topbar));
    box-sizing: border-box;
    padding-bottom: max(20px, env(safe-area-inset-bottom)) !important;
    overscroll-behavior: contain;
  }
  body.ta-sidebar-open #nav-sidebar { visibility: visible !important; pointer-events: auto; }
  .ta-sidebar-backdrop:not([hidden]) {
    display: block; position: fixed; inset: var(--ta-topbar) 0 0;
    z-index: 1399; border: 0; border-radius: 0; padding: 0;
    background: rgba(0, 0, 0, .48); cursor: pointer;
  }
  .ta-menu-button { width: 48px !important; height: 44px !important; flex-shrink: 0; gap: 3px; }
  .ta-menu-button::after { content: 'Меню'; font-size: 10px; line-height: 12px; }
  .ta-global-tools { grid-template-columns: 48px minmax(0, 1fr) !important; }
}
@media (prefers-reduced-motion: reduce) { #nav-sidebar { transition: none !important; } }
@media (min-width: 681px) and (max-width: 980px) {
  .ta-global-tools { grid-template-columns: 48px minmax(0, 1fr) 44px !important; }
}
