/* =============================================================================
   TOCAR ASSET MANAGEMENT — design system
   Premium dark technology + energetic lime accent
   ========================================================================== */

:root {
  --tc-black: #080808;
  --tc-dark: #111111;
  --tc-surface: #181818;
  --tc-surface-2: #222222;
  --tc-surface-3: #2a2a2a;
  --tc-border: #262626;
  --tc-border-strong: #333333;
  --tc-lime: #E8FF00;
  --tc-lime-dim: rgba(232, 255, 0, 0.14);
  --tc-white: #FFFFFF;
  --tc-text: #F3F4F6;
  --tc-muted: #9CA3AF;
  --tc-muted-2: #6B7280;
  --tc-success: #22C55E;
  --tc-warning: #F59E0B;
  --tc-danger: #EF4444;
  --tc-info: #38BDF8;

  --tc-sidebar-w: 264px;
  --tc-sidebar-w-collapsed: 76px;
  --tc-topbar-h: 64px;
  --tc-radius: 14px;
  --tc-radius-sm: 9px;
  --tc-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --tc-font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --tc-mono: "JetBrains Mono", "Cascadia Code", Consolas, "Courier New", monospace;

  /* Bootstrap dark overrides */
  --bs-body-bg: var(--tc-black);
  --bs-body-color: var(--tc-text);
  --bs-body-font-family: var(--tc-font);
  --bs-border-color: var(--tc-border);
  --bs-secondary-color: var(--tc-muted);
  --bs-tertiary-bg: var(--tc-surface-2);
  --bs-link-color: var(--tc-lime);
  --bs-link-hover-color: #f4ff66;
  --bs-primary: var(--tc-lime);
  --bs-primary-rgb: 232, 255, 0;
}

[data-bs-theme="dark"] {
  --bs-body-bg: var(--tc-black);
  --bs-body-color: var(--tc-text);
  --bs-border-color: var(--tc-border);
  --bs-secondary-color: var(--tc-muted);
  --bs-tertiary-bg: var(--tc-surface-2);
  --bs-link-color: var(--tc-lime);
  --bs-link-hover-color: #f4ff66;
}

html { scroll-behavior: smooth; }
body {
  background: var(--tc-black);
  color: var(--tc-text);
  font-family: var(--tc-font);
  font-size: 0.925rem;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
h1, h2, h3, h4, h5, h6 { font-weight: 700; letter-spacing: -0.015em; }
a { text-decoration: none; }
a:hover { text-decoration: underline; }
code { color: var(--tc-lime); background: var(--tc-lime-dim); padding: 0.1em 0.4em; border-radius: 4px; font-family: var(--tc-mono); font-size: 0.85em; }
.text-muted { color: var(--tc-muted) !important; }
::selection { background: var(--tc-lime); color: var(--tc-black); }
*:focus-visible { outline: 2px solid var(--tc-lime); outline-offset: 2px; }

/* ---------------------------------------------------------------- brand */
.tc-wordmark { font-weight: 900; font-size: 1.35rem; letter-spacing: 0.12em; color: var(--tc-white); line-height: 1; }
.tc-wordmark-sub { font-size: 0.6rem; letter-spacing: 0.28em; color: var(--tc-lime); font-weight: 600; line-height: 1.4; }
.tc-brand { display: flex; align-items: center; gap: 12px; color: inherit; }
.tc-brand:hover { text-decoration: none; }
.tc-brand-icon { width: 40px; height: 40px; flex-shrink: 0; }
.tc-brand-text { display: flex; flex-direction: column; gap: 3px; }
.tc-eyebrow { font-size: 0.7rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--tc-lime); font-weight: 700; margin-bottom: 4px; }

/* --------------------------------------------------------------- layout */
.tc-app { display: block; }
.tc-sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 1040;
  width: var(--tc-sidebar-w);
  background: var(--tc-dark);
  border-right: 1px solid var(--tc-border);
  display: flex; flex-direction: column;
  transition: transform 0.25s ease, width 0.2s ease;
}
.tc-sidebar-brand { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; height: var(--tc-topbar-h); border-bottom: 1px solid var(--tc-border); }
.tc-sidebar-close { background: none; border: 0; color: var(--tc-muted); font-size: 1.2rem; }
.tc-nav { flex: 1; overflow-y: auto; padding: 12px 12px 24px; }
.tc-nav::-webkit-scrollbar { width: 6px; }
.tc-nav::-webkit-scrollbar-thumb { background: var(--tc-surface-3); border-radius: 3px; }
.tc-nav-heading { font-size: 0.65rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--tc-muted-2); font-weight: 700; padding: 18px 12px 6px; }
.tc-nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; margin-bottom: 2px;
  border-radius: var(--tc-radius-sm);
  color: var(--tc-muted); font-weight: 500;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.tc-nav-link i { font-size: 1.05rem; width: 20px; text-align: center; flex-shrink: 0; }
.tc-nav-link:hover { background: var(--tc-surface-2); color: var(--tc-white); text-decoration: none; }
.tc-nav-link.active { background: var(--tc-lime); color: var(--tc-black); font-weight: 700; }
.tc-sidebar-foot { border-top: 1px solid var(--tc-border); padding: 14px 18px; }
.tc-user-chip { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tc-user-meta { display: flex; flex-direction: column; min-width: 0; }
.tc-user-name { font-weight: 600; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-user-role { font-size: 0.7rem; color: var(--tc-muted); }
.tc-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: var(--tc-lime); color: var(--tc-black);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.8rem; letter-spacing: 0.02em;
}

.tc-main { margin-left: var(--tc-sidebar-w); min-height: 100vh; display: flex; flex-direction: column; transition: margin-left 0.2s ease; }
.tc-topbar {
  position: sticky; top: 0; z-index: 1020;
  height: var(--tc-topbar-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 24px;
  background: rgba(8, 8, 8, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--tc-border);
}
.tc-page-title { font-size: 1.15rem; margin: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-topbar-actions { display: flex; align-items: center; gap: 12px; }
.tc-company-switch { display: flex; align-items: center; gap: 8px; color: var(--tc-muted); }
.tc-company-switch .form-select { min-width: 190px; }
.tc-company-static { color: var(--tc-muted); font-size: 0.85rem; display: inline-flex; gap: 6px; align-items: center; }
.tc-user-btn { display: inline-flex; align-items: center; gap: 10px; background: none; border: 1px solid transparent; color: var(--tc-text); padding: 4px 8px 4px 4px; border-radius: 40px; font-weight: 600; }
.tc-user-btn:hover { border-color: var(--tc-border-strong); background: var(--tc-surface); }
.tc-content { flex: 1; padding: 24px; max-width: 1600px; width: 100%; }
.tc-footer { display: flex; justify-content: space-between; padding: 14px 24px; border-top: 1px solid var(--tc-border); font-size: 0.75rem; color: var(--tc-muted); }
.tc-page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; }

.tc-sidebar-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 1035; opacity: 0; visibility: hidden; transition: opacity 0.2s; }

/* collapsed (desktop) */
@media (min-width: 992px) {
  body.tc-collapsed .tc-sidebar { width: var(--tc-sidebar-w-collapsed); }
  body.tc-collapsed .tc-main { margin-left: var(--tc-sidebar-w-collapsed); }
  body.tc-collapsed .tc-brand-text, body.tc-collapsed .tc-nav-heading, body.tc-collapsed .tc-nav-link span, body.tc-collapsed .tc-user-meta { display: none; }
  body.tc-collapsed .tc-nav-link { justify-content: center; padding: 11px; }
  body.tc-collapsed .tc-sidebar-brand { justify-content: center; padding: 12px; }
}
/* off-canvas (tablet + mobile) */
@media (max-width: 991.98px) {
  .tc-sidebar { transform: translateX(-100%); box-shadow: var(--tc-shadow); }
  body.tc-sidebar-open .tc-sidebar { transform: translateX(0); }
  body.tc-sidebar-open .tc-sidebar-backdrop { opacity: 1; visibility: visible; }
  .tc-main { margin-left: 0; }
  .tc-topbar { padding: 0 14px; }
  .tc-content { padding: 16px; }
  .tc-company-switch .form-select { min-width: 130px; }
}
@media (max-width: 575.98px) {
  .tc-page-title { font-size: 1rem; }
  .tc-company-switch i { display: none; }
  .tc-company-switch .form-select { min-width: 110px; max-width: 150px; }
}

/* --------------------------------------------------------------- buttons */
.tc-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: var(--tc-radius-sm);
  background: transparent; border: 1px solid transparent; color: var(--tc-muted);
  font-size: 1rem; transition: all 0.15s;
}
.tc-icon-btn:hover { background: var(--tc-surface-2); color: var(--tc-white); border-color: var(--tc-border-strong); text-decoration: none; }
.tc-icon-btn-danger:hover { color: var(--tc-danger); }
.btn { border-radius: var(--tc-radius-sm); font-weight: 600; letter-spacing: 0.01em; }
.btn-primary, .tc-btn-lime {
  --bs-btn-bg: var(--tc-lime); --bs-btn-border-color: var(--tc-lime); --bs-btn-color: var(--tc-black);
  --bs-btn-hover-bg: #f4ff66; --bs-btn-hover-border-color: #f4ff66; --bs-btn-hover-color: var(--tc-black);
  --bs-btn-active-bg: #d4ea00; --bs-btn-active-border-color: #d4ea00; --bs-btn-active-color: var(--tc-black);
  --bs-btn-disabled-bg: #6a7300; --bs-btn-disabled-border-color: #6a7300; --bs-btn-disabled-color: #1a1a1a;
  --bs-btn-focus-shadow-rgb: 232, 255, 0;
}
.btn-outline-light { --bs-btn-border-color: var(--tc-border-strong); --bs-btn-color: var(--tc-text); --bs-btn-hover-bg: var(--tc-surface-2); --bs-btn-hover-border-color: var(--tc-border-strong); --bs-btn-hover-color: var(--tc-white); }
.btn-secondary { --bs-btn-bg: var(--tc-surface-2); --bs-btn-border-color: var(--tc-surface-2); --bs-btn-hover-bg: var(--tc-surface-3); --bs-btn-hover-border-color: var(--tc-surface-3); }
.btn-link { --bs-btn-color: var(--tc-lime); }
.btn-lg { padding: 0.7rem 1.4rem; }

/* ----------------------------------------------------------------- cards */
.tc-card {
  background: var(--tc-surface);
  border: 1px solid var(--tc-border);
  border-radius: var(--tc-radius);
  overflow: hidden;
}
.tc-card-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--tc-border); }
.tc-card-title { font-size: 0.95rem; margin: 0; font-weight: 700; }
.tc-card-actions { display: flex; gap: 8px; }
.tc-card-body { padding: 20px; }
.tc-card-footer { padding: 14px 20px; border-top: 1px solid var(--tc-border); }
.tc-card > .tc-table-wrap { border-radius: 0; }

/* ------------------------------------------------------------------ kpis */
.tc-kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.tc-kpi-grid-compact { grid-template-columns: repeat(2, 1fr); }
.tc-kpi {
  position: relative; background: var(--tc-surface); border: 1px solid var(--tc-border); border-radius: var(--tc-radius);
  padding: 18px 18px 16px; overflow: hidden; transition: transform 0.15s, border-color 0.15s;
}
.tc-kpi:hover { transform: translateY(-2px); border-color: var(--tc-border-strong); }
.tc-kpi::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--kpi-color, var(--tc-lime)); }
.tc-kpi-icon { position: absolute; right: 14px; top: 14px; font-size: 1.25rem; color: var(--kpi-color, var(--tc-lime)); opacity: 0.85; }
.tc-kpi-value { font-size: 2.1rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.tc-kpi-label { color: var(--tc-muted); font-size: 0.78rem; margin-top: 4px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; }
.tc-kpi-lime { --kpi-color: var(--tc-lime); }
.tc-kpi-success { --kpi-color: var(--tc-success); }
.tc-kpi-warning { --kpi-color: var(--tc-warning); }
.tc-kpi-danger { --kpi-color: var(--tc-danger); }
.tc-kpi-info { --kpi-color: var(--tc-info); }
.tc-kpi-muted { --kpi-color: var(--tc-muted); }

/* ---------------------------------------------------------------- badges */
.tc-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 30px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  white-space: nowrap; border: 1px solid transparent;
}
.tc-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tc-badge-lime    { color: var(--tc-lime);    background: rgba(232,255,0,0.12);  border-color: rgba(232,255,0,0.3); }
.tc-badge-success { color: var(--tc-success); background: rgba(34,197,94,0.12);  border-color: rgba(34,197,94,0.3); }
.tc-badge-warning { color: var(--tc-warning); background: rgba(245,158,11,0.12); border-color: rgba(245,158,11,0.3); }
.tc-badge-danger  { color: var(--tc-danger);  background: rgba(239,68,68,0.12);  border-color: rgba(239,68,68,0.3); }
.tc-badge-info    { color: var(--tc-info);    background: rgba(56,189,248,0.12); border-color: rgba(56,189,248,0.3); }
.tc-badge-muted   { color: var(--tc-muted);   background: rgba(156,163,175,0.12);border-color: rgba(156,163,175,0.3); }
.tc-tag { font-family: var(--tc-mono); font-size: 0.8rem; color: var(--tc-lime); font-weight: 600; letter-spacing: 0.02em; }

/* ---------------------------------------------------------------- alerts */
.tc-alert {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px; border-radius: var(--tc-radius-sm); margin-bottom: 14px;
  border: 1px solid; font-size: 0.875rem;
}
.tc-alert i { font-size: 1.05rem; line-height: 1.3; }
.tc-alert > div { flex: 1; }
.tc-alert-close { background: none; border: 0; color: inherit; opacity: 0.6; padding: 0 2px; }
.tc-alert-close:hover { opacity: 1; }
.tc-alert-success { color: #86efac; background: rgba(34,197,94,0.1); border-color: rgba(34,197,94,0.35); }
.tc-alert-info    { color: #bae6fd; background: rgba(56,189,248,0.1); border-color: rgba(56,189,248,0.35); }
.tc-alert-warning { color: #fde68a; background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.35); }
.tc-alert-danger  { color: #fecaca; background: rgba(239,68,68,0.1);  border-color: rgba(239,68,68,0.35); }

/* ---------------------------------------------------------------- tables */
.tc-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tc-table { --bs-table-bg: transparent; --bs-table-color: var(--tc-text); --bs-table-border-color: var(--tc-border); --bs-table-hover-bg: rgba(255,255,255,0.03); --bs-table-hover-color: var(--tc-text); min-width: 640px; }
.tc-table thead th { font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--tc-muted); font-weight: 700; background: var(--tc-dark); padding: 12px 16px; white-space: nowrap; border-bottom: 1px solid var(--tc-border); }
.tc-table tbody td { padding: 12px 16px; vertical-align: middle; border-bottom: 1px solid var(--tc-border); }
.tc-table tbody tr:last-child td { border-bottom: 0; }
.tc-table tbody tr:hover td { background: var(--bs-table-hover-bg); }
.tc-row-link { cursor: pointer; }
.tc-sort { color: inherit; display: inline-flex; align-items: center; gap: 4px; }
.tc-sort:hover { color: var(--tc-white); text-decoration: none; }
.tc-sort.active { color: var(--tc-lime); }
.tc-sort i { font-size: 0.8rem; opacity: 0.7; }
.tc-empty { text-align: center; padding: 48px 16px !important; color: var(--tc-muted); }
.tc-empty i { font-size: 2rem; display: block; margin-bottom: 8px; opacity: 0.6; }
.tc-actions { display: inline-flex; gap: 2px; align-items: center; }

/* --------------------------------------------------------------- filters */
.tc-filters { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--tc-border); background: var(--tc-dark); }
.tc-filter { min-width: 160px; flex: 0 1 auto; }
.tc-filter-search { position: relative; flex: 1 1 240px; }
.tc-filter-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--tc-muted); pointer-events: none; }
.tc-filter-search .form-control { padding-left: 34px; }
.tc-filter-actions { display: flex; align-items: center; gap: 4px; }
@media (max-width: 575.98px) { .tc-filter { flex: 1 1 100%; } }

/* ------------------------------------------------------------ pagination */
.tc-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--tc-border); font-size: 0.85rem; color: var(--tc-muted); }
.tc-pagination-info { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.tc-per-page .form-select { width: auto; }
.pagination { --bs-pagination-bg: transparent; --bs-pagination-border-color: var(--tc-border); --bs-pagination-color: var(--tc-text); --bs-pagination-hover-bg: var(--tc-surface-2); --bs-pagination-hover-color: var(--tc-white); --bs-pagination-hover-border-color: var(--tc-border-strong); --bs-pagination-active-bg: var(--tc-lime); --bs-pagination-active-border-color: var(--tc-lime); --bs-pagination-active-color: var(--tc-black); --bs-pagination-disabled-bg: transparent; --bs-pagination-disabled-color: var(--tc-muted-2); --bs-pagination-disabled-border-color: var(--tc-border); --bs-pagination-focus-box-shadow: none; }
.pagination .page-link { font-weight: 600; }

/* ----------------------------------------------------------------- forms */
.form-control, .form-select, .input-group-text {
  background: var(--tc-dark); border-color: var(--tc-border-strong); color: var(--tc-text); border-radius: var(--tc-radius-sm);
}
.form-control:focus, .form-select:focus { background: var(--tc-dark); color: var(--tc-text); border-color: var(--tc-lime); box-shadow: 0 0 0 3px rgba(232,255,0,0.15); }
.form-control::placeholder { color: var(--tc-muted-2); }
.form-control:disabled, .form-select:disabled { background: var(--tc-surface-2); opacity: 0.7; }
.form-select { --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%239CA3AF' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e"); }
.form-label { font-size: 0.8rem; font-weight: 600; color: var(--tc-muted); letter-spacing: 0.02em; margin-bottom: 6px; }
.form-text { color: var(--tc-muted-2); }
.tc-req { color: var(--tc-lime); }
.form-check-input { background-color: var(--tc-dark); border-color: var(--tc-border-strong); }
.form-check-input:checked { background-color: var(--tc-lime); border-color: var(--tc-lime); }
.form-check-input:checked[type="checkbox"] { --bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23080808' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e"); }
.form-check-input:checked[type="radio"] { --bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%23080808'/%3e%3c/svg%3e"); }
.form-switch .form-check-input:checked { --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23080808'/%3e%3c/svg%3e"); }
.form-check-input:focus { box-shadow: 0 0 0 3px rgba(232,255,0,0.15); border-color: var(--tc-lime); }
.is-invalid, .form-control.is-invalid:focus { border-color: var(--tc-danger) !important; box-shadow: none; }
.invalid-feedback { color: #fca5a5; }
.input-group-text { color: var(--tc-muted); }
.tc-password { position: relative; }
.tc-password .form-control { padding-right: 44px; }
.tc-password-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--tc-muted); padding: 6px 8px; }
.tc-password-toggle:hover { color: var(--tc-white); }
.tc-form-section { border-top: 1px solid var(--tc-border); padding-top: 18px; margin-top: 8px; }
.tc-form-section-title { font-size: 0.75rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--tc-lime); font-weight: 700; margin-bottom: 14px; }

/* ------------------------------------------------- dropdowns / modals / toast */
.dropdown-menu { --bs-dropdown-bg: var(--tc-surface-2); --bs-dropdown-border-color: var(--tc-border-strong); --bs-dropdown-link-color: var(--tc-text); --bs-dropdown-link-hover-bg: var(--tc-surface-3); --bs-dropdown-link-hover-color: var(--tc-white); --bs-dropdown-link-active-bg: var(--tc-lime); --bs-dropdown-link-active-color: var(--tc-black); --bs-dropdown-header-color: var(--tc-muted); border-radius: var(--tc-radius-sm); box-shadow: var(--tc-shadow); }
.dropdown-item { font-size: 0.875rem; }
.modal-content { background: var(--tc-surface); border: 1px solid var(--tc-border-strong); border-radius: var(--tc-radius); box-shadow: var(--tc-shadow); }
.modal-header, .modal-footer { border-color: var(--tc-border); }
.modal-title { font-size: 1rem; }
.toast { background: var(--tc-surface-2); border: 1px solid var(--tc-border-strong); color: var(--tc-text); border-radius: var(--tc-radius-sm); }
.toast .toast-body { display: flex; gap: 10px; align-items: center; }
.toast-success { border-left: 4px solid var(--tc-success); }
.toast-danger  { border-left: 4px solid var(--tc-danger); }
.toast-warning { border-left: 4px solid var(--tc-warning); }
.toast-info    { border-left: 4px solid var(--tc-info); }

/* ------------------------------------------------------------- misc bits */
.tc-dl { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; margin: 0; }
.tc-dl dt { color: var(--tc-muted); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700; padding-top: 3px; }
.tc-dl dd { margin: 0; }
.tc-list-plain { list-style: none; padding: 0; margin: 0; }
.tc-list-plain li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--tc-border); font-size: 0.875rem; }
.tc-list-plain li:last-child { border-bottom: 0; }
.tc-list-plain i { color: var(--tc-lime); }
.tc-bars { display: flex; flex-direction: column; gap: 10px; }
.tc-bar-row { display: grid; grid-template-columns: 150px 1fr 40px; align-items: center; gap: 12px; }
.tc-bar-track { height: 8px; background: var(--tc-surface-2); border-radius: 4px; overflow: hidden; }
.tc-bar-fill { height: 100%; border-radius: 4px; background: var(--tc-lime); transition: width 0.6s ease; }
.tc-bar-success { background: var(--tc-success); } .tc-bar-warning { background: var(--tc-warning); } .tc-bar-danger { background: var(--tc-danger); } .tc-bar-muted { background: var(--tc-muted); } .tc-bar-info { background: var(--tc-info); }
.tc-bar-value { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 575.98px) { .tc-bar-row { grid-template-columns: 120px 1fr 32px; } }
.tc-pre { background: var(--tc-black); border: 1px solid var(--tc-border); border-radius: var(--tc-radius-sm); padding: 14px; font-size: 0.75rem; color: var(--tc-muted); max-height: 360px; overflow: auto; }
.tc-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 10px; }
.tc-swatch span { display: block; height: 48px; border-radius: var(--tc-radius-sm); border: 1px solid var(--tc-border-strong); margin-bottom: 4px; }
.tc-swatch small { color: var(--tc-muted); font-size: 0.68rem; line-height: 1.3; }
.tc-placeholder { text-align: center; padding: 56px 20px; }
.tc-placeholder i { font-size: 2.6rem; color: var(--tc-lime); display: block; margin-bottom: 10px; }

/* ----------------------------------------------------- page head / tabs */
.tc-heading { font-size: 1.5rem; margin: 0 0 2px; }
.tc-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--tc-muted); margin-bottom: 4px; }
.tc-crumbs a { color: var(--tc-muted); }
.tc-crumbs a:hover { color: var(--tc-lime); text-decoration: none; }
.tc-crumbs i { font-size: 0.6rem; opacity: 0.6; }
.tc-tabs .nav-link { color: var(--tc-muted); border-radius: 30px; font-weight: 600; font-size: 0.85rem; padding: 6px 16px; }
.tc-tabs .nav-link:hover { color: var(--tc-white); background: var(--tc-surface-2); }
.tc-tabs .nav-link.active { background: var(--tc-lime); color: var(--tc-black); }
.tc-avatar-sm { width: 28px; height: 28px; font-size: 0.65rem; }
.tc-avatar-lg { width: 56px; height: 56px; font-size: 1.15rem; }
.tc-check-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--tc-border); border-radius: var(--tc-radius-sm); margin-bottom: 8px; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.tc-check-row:hover { border-color: var(--tc-border-strong); background: var(--tc-surface-2); }
.tc-check-row:has(input:checked) { border-color: rgba(232,255,0,0.45); background: rgba(232,255,0,0.05); }
.tc-check-row .form-check-input { margin: 0; flex-shrink: 0; }
a.tc-kpi { color: inherit; }
a.tc-kpi:hover { text-decoration: none; }
.tc-table td a { color: var(--tc-text); }
.tc-table td a:hover { color: var(--tc-lime); text-decoration: none; }

/* ------------------------------------------------------- assets & files */
.tc-thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--tc-surface-2); border: 1px solid var(--tc-border); flex-shrink: 0; }
.tc-thumb-empty { display: inline-flex; align-items: center; justify-content: center; color: var(--tc-muted-2); }
.tc-asset-hero { display: grid; grid-template-columns: 260px 1fr; gap: 24px; padding: 20px; }
.tc-asset-hero-image img { width: 100%; height: 220px; object-fit: cover; border-radius: var(--tc-radius-sm); border: 1px solid var(--tc-border); background: var(--tc-black); }
.tc-asset-hero-empty { height: 220px; border-radius: var(--tc-radius-sm); border: 1px dashed var(--tc-border-strong); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--tc-muted-2); }
.tc-asset-hero-empty i { font-size: 2.2rem; }
.tc-asset-title { font-size: 1.6rem; margin: 4px 0 2px; }
.tc-dl-hero { grid-template-columns: max-content 1fr; }
@media (max-width: 767.98px) { .tc-asset-hero { grid-template-columns: 1fr; } .tc-asset-hero-image img, .tc-asset-hero-empty { height: 180px; } }
.tc-count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: rgba(255,255,255,0.12); font-size: 0.7rem; text-align: center; }
.tc-tabs .nav-link.active .tc-count { background: rgba(0,0,0,0.18); }
.tc-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tc-gallery-item { position: relative; margin: 0; border: 1px solid var(--tc-border); border-radius: var(--tc-radius-sm); overflow: hidden; background: var(--tc-black); }
.tc-gallery-item.is-primary { border-color: rgba(232,255,0,0.5); }
.tc-gallery-item img { width: 100%; height: 120px; object-fit: cover; display: block; }
.tc-gallery-flag { position: absolute; top: 8px; left: 8px; background: var(--tc-lime); color: var(--tc-black); font-size: 0.65rem; font-weight: 800; padding: 2px 8px; border-radius: 20px; letter-spacing: 0.05em; }
.tc-gallery-item figcaption { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; font-size: 0.75rem; }
.tc-gallery-item figcaption .tc-actions { justify-content: flex-end; }
.tc-logo-preview { width: 72px; height: 72px; object-fit: contain; border-radius: var(--tc-radius-sm); background: var(--tc-white); border: 1px solid var(--tc-border-strong); padding: 6px; flex-shrink: 0; }
.tc-logo-preview-lg { width: 120px; height: 120px; }
.tc-logo-empty { display: inline-flex; align-items: center; justify-content: center; background: var(--tc-surface-2); color: var(--tc-muted-2); font-size: 1.6rem; }
.tc-card-body .tc-form-section { margin-top: 18px; }

/* ------------------------------------------------- custody & timeline */
.tc-choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.tc-choice { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--tc-border-strong); border-radius: var(--tc-radius-sm); cursor: pointer; background: var(--tc-dark); transition: border-color 0.15s, background 0.15s; }
.tc-choice input { margin-top: 3px; }
.tc-choice i { font-size: 1.3rem; color: var(--tc-muted); }
.tc-choice span { display: flex; flex-direction: column; gap: 2px; }
.tc-choice small { color: var(--tc-muted); }
.tc-choice.active { border-color: var(--tc-lime); background: rgba(232,255,0,0.06); }
.tc-choice.active i { color: var(--tc-lime); }
.tc-check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.tc-timeline { list-style: none; margin: 0; padding: 0 0 0 8px; position: relative; }
.tc-timeline::before { content: ""; position: absolute; left: 23px; top: 8px; bottom: 8px; width: 2px; background: var(--tc-border-strong); }
.tc-timeline-item { position: relative; display: flex; gap: 16px; padding: 6px 0 18px; }
.tc-timeline-dot { position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--tc-surface-2); border: 2px solid var(--tc-border-strong); color: var(--tc-muted); flex-shrink: 0; font-size: 0.9rem; }
.tc-timeline-body { flex: 1; padding-top: 4px; }
.tc-timeline-title { font-weight: 600; }
.tc-timeline-detail { color: var(--tc-text); opacity: 0.85; font-size: 0.85rem; margin-top: 2px; }
.tc-timeline-meta { color: var(--tc-muted); font-size: 0.75rem; margin-top: 4px; }
.tc-tl-lime .tc-timeline-dot { border-color: var(--tc-lime); color: var(--tc-lime); }
.tc-tl-success .tc-timeline-dot { border-color: var(--tc-success); color: var(--tc-success); }
.tc-tl-warning .tc-timeline-dot { border-color: var(--tc-warning); color: var(--tc-warning); }
.tc-tl-danger .tc-timeline-dot { border-color: var(--tc-danger); color: var(--tc-danger); }
.tc-tl-info .tc-timeline-dot { border-color: var(--tc-info); color: var(--tc-info); }
.dropdown-item form, .dropdown-menu form { margin: 0; }

/* ------------------------------------------------ dashboard, alerts, QR */
.tc-alert-list { display: flex; flex-direction: column; }
.tc-alert-row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--tc-border); color: var(--tc-text); transition: background 0.15s; }
.tc-alert-row:last-child { border-bottom: 0; }
.tc-alert-row:hover { background: var(--tc-surface-2); text-decoration: none; color: var(--tc-white); }
.tc-alert-row.is-zero { opacity: 0.55; }
.tc-alert-icon { width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.05rem; flex-shrink: 0; border: 1px solid; }
.tc-alert-icon-lime { color: var(--tc-lime); background: rgba(232,255,0,0.1); border-color: rgba(232,255,0,0.3); }
.tc-alert-icon-success { color: var(--tc-success); background: rgba(34,197,94,0.1); border-color: rgba(34,197,94,0.3); }
.tc-alert-icon-warning { color: var(--tc-warning); background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.3); }
.tc-alert-icon-danger { color: var(--tc-danger); background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.3); }
.tc-alert-icon-info { color: var(--tc-info); background: rgba(56,189,248,0.1); border-color: rgba(56,189,248,0.3); }
.tc-alert-icon-muted { color: var(--tc-muted); background: rgba(156,163,175,0.1); border-color: rgba(156,163,175,0.3); }
.tc-alert-count { font-weight: 800; font-size: 1.1rem; font-variant-numeric: tabular-nums; min-width: 32px; text-align: right; }
.tc-chart-body { height: 240px; position: relative; }
.tc-chart-body canvas { width: 100% !important; height: 100% !important; }
.tc-chart-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--tc-muted-2); }
.tc-chart-empty i { font-size: 1.8rem; }
.tc-activity { list-style: none; margin: 0; padding: 0; }
.tc-activity li { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--tc-border); font-size: 0.85rem; }
.tc-activity li:last-child { border-bottom: 0; }
.tc-activity-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tc-lime); margin-top: 7px; flex-shrink: 0; }
.tc-bell { position: relative; }
.tc-bell-badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--tc-danger); color: #fff; font-size: 0.65rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.tc-notif-menu { width: 340px; max-width: 92vw; padding: 0; overflow: hidden; }
.tc-notif-head { padding: 10px 14px; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700; border-bottom: 1px solid var(--tc-border-strong); }
.tc-notif-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; color: var(--tc-text); border-bottom: 1px solid var(--tc-border); }
.tc-notif-item:hover { background: var(--tc-surface-3); text-decoration: none; color: var(--tc-white); }
.tc-notif-empty { padding: 18px 14px; color: var(--tc-muted); display: flex; gap: 8px; align-items: center; }
.tc-notif-foot { display: block; text-align: center; padding: 10px; font-weight: 600; color: var(--tc-lime); }
.tc-notif-foot:hover { background: var(--tc-surface-3); text-decoration: none; }
.tc-qr-frame { display: inline-block; background: #fff; padding: 12px; border-radius: var(--tc-radius-sm); }
.tc-qr-frame img { width: 240px; max-width: 100%; height: auto; display: block; }

/* --------------------------------------------------------------- reports */
.tc-report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.tc-report-card { display: flex; align-items: center; gap: 16px; padding: 18px 20px; background: var(--tc-surface); border: 1px solid var(--tc-border); border-radius: var(--tc-radius); color: var(--tc-text); transition: transform 0.15s, border-color 0.15s; }
.tc-report-card:hover { transform: translateY(-2px); border-color: var(--tc-lime); text-decoration: none; color: var(--tc-white); }
.tc-report-icon { width: 48px; height: 48px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.4rem; color: var(--tc-lime); background: var(--tc-lime-dim); flex-shrink: 0; }
.tc-report-body { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.tc-report-title { font-weight: 700; font-size: 1rem; }
.tc-report-formats { display: flex; gap: 4px; flex-shrink: 0; }
.tc-report-formats span { font-size: 0.6rem; font-weight: 800; letter-spacing: 0.08em; padding: 2px 6px; border-radius: 4px; background: var(--tc-surface-2); color: var(--tc-muted); }
.tc-report-arrow { color: var(--tc-muted-2); }
.tc-report-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 20px; border-bottom: 1px solid var(--tc-border); font-size: 0.85rem; color: var(--tc-muted); background: var(--tc-surface); }
.tc-report-summary strong { color: var(--tc-text); }
@media (max-width: 575.98px) { .tc-report-formats { display: none; } }

/* -------------------------------------------------------------- audit log */
.tc-audit-detail { margin-top: 8px; padding: 10px 12px; background: var(--tc-black); border: 1px solid var(--tc-border); border-radius: var(--tc-radius-sm); font-family: var(--tc-mono); font-size: 0.72rem; max-width: 520px; margin-left: auto; word-break: break-word; }
.tc-audit-col { margin-bottom: 8px; }
.tc-audit-col:last-child { margin-bottom: 0; }
.tc-audit-label { font-family: var(--tc-font); font-size: 0.65rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--tc-muted); font-weight: 700; margin-bottom: 4px; }
.tc-json-key { color: var(--tc-lime); }
.tc-json-key::after { content: ":"; color: var(--tc-muted); }

/* ------------------------------------------------------------ user manual */
.tc-manual { display: grid; grid-template-columns: 280px 1fr; gap: 24px; align-items: start; }
.tc-manual-toc { position: sticky; top: calc(var(--tc-topbar-h) + 16px); }
.tc-manual-toc-list { display: flex; flex-direction: column; max-height: calc(100vh - var(--tc-topbar-h) - 120px); overflow-y: auto; padding: 6px; }
.tc-manual-toc-list a { display: flex; gap: 10px; align-items: flex-start; padding: 7px 10px; border-radius: var(--tc-radius-sm); color: var(--tc-muted); font-size: 0.82rem; line-height: 1.3; }
.tc-manual-toc-list a:hover { background: var(--tc-surface-2); color: var(--tc-white); text-decoration: none; }
.tc-manual-body { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.tc-manual-section { scroll-margin-top: calc(var(--tc-topbar-h) + 16px); }
.tc-manual-letter { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 8px; background: var(--tc-lime); color: var(--tc-black); font-weight: 900; font-size: 0.8rem; flex-shrink: 0; }
.tc-manual-h { display: flex; align-items: center; gap: 12px; font-size: 1.2rem; margin: 0 0 14px; }
.tc-manual-h3 { font-size: 0.95rem; margin: 16px 0 8px; color: var(--tc-lime); }
.tc-steps { padding-left: 0; margin: 0 0 12px; list-style: none; counter-reset: step; }
.tc-steps > li { position: relative; padding: 8px 0 8px 40px; border-bottom: 1px solid var(--tc-border); counter-increment: step; line-height: 1.55; }
.tc-steps > li:last-child { border-bottom: 0; }
.tc-steps > li::before { content: counter(step); position: absolute; left: 0; top: 9px; width: 26px; height: 26px; border-radius: 50%; background: var(--tc-surface-2); border: 1px solid var(--tc-border-strong); color: var(--tc-lime); font-weight: 800; font-size: 0.75rem; display: inline-flex; align-items: center; justify-content: center; }
.tc-manual-list { padding-left: 18px; margin: 0 0 10px; line-height: 1.55; }
.tc-manual-list li { margin-bottom: 4px; }
.tc-manual-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--tc-radius-sm); background: var(--tc-lime-dim); border: 1px solid rgba(232,255,0,0.3); font-size: 0.875rem; margin-top: 10px; }
.tc-manual-note i { color: var(--tc-lime); font-size: 1.05rem; }
.tc-manual-fig { margin: 8px 0 18px; }
.tc-manual-fig svg { width: 100%; height: auto; display: block; border-radius: 14px; border: 1px solid var(--tc-border); }
.tc-manual-fig figcaption { font-size: 0.75rem; color: var(--tc-muted); margin-top: 6px; text-align: center; }
.tc-manual-intro p { line-height: 1.6; }
@media (max-width: 991.98px) { .tc-manual { grid-template-columns: 1fr; } .tc-manual-toc { position: static; } .tc-manual-toc-list { max-height: 260px; } }
@media print {
  .tc-no-print, .tc-page-head .btn { display: none !important; }
  .tc-manual { display: block; }
  .tc-manual-section { break-inside: avoid; margin-bottom: 12px; }
  .tc-manual-fig svg { border-color: #ccc; }
  .tc-manual-letter { background: #000; color: #fff; }
}

/* -------------------------------------------------------- barcode scanner */
.tc-scanner-view { width: 100%; min-height: 240px; background: var(--tc-black); border-radius: var(--tc-radius-sm); overflow: hidden; border: 1px solid var(--tc-border); }
.tc-scanner-view video { width: 100% !important; height: auto !important; display: block; border-radius: var(--tc-radius-sm); }
.tc-scanner-view img { max-width: 100%; }
.tc-scanner-fallback { margin-top: 12px; padding: 12px; border: 1px dashed var(--tc-border-strong); border-radius: var(--tc-radius-sm); }
.tc-scanner-status { min-height: 1.2em; }
#scannerTorch.active { background: var(--tc-lime); color: var(--tc-black); border-color: var(--tc-lime); }
@keyframes tc-scan-flash { 0% { box-shadow: 0 0 0 0 rgba(232,255,0,0.9); } 100% { box-shadow: 0 0 0 10px rgba(232,255,0,0); } }
.tc-scan-flash { animation: tc-scan-flash 0.9s ease-out 2; border-color: var(--tc-lime) !important; }
@media (max-width: 575.98px) { .tc-scanner-view { min-height: 200px; } }

/* ------------------------------------------------------ software licences */
.tc-secret { font-family: var(--tc-mono); font-size: 0.85rem; letter-spacing: 0.04em; word-break: break-all; }
.tc-kpi-money { font-size: 1.35rem; }
.tc-kpi-grid-licence { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.tc-staff-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.tc-staff-pick .tc-check-row { margin-bottom: 0; }

/* ----------------------------------------------------------------- errors */
.tc-error { text-align: center; max-width: 720px; margin: 40px auto; padding: 20px; }
.tc-error-code { font-size: 6rem; font-weight: 900; letter-spacing: -0.05em; line-height: 1; color: var(--tc-lime); }
.tc-error-icon { font-size: 2rem; color: var(--tc-muted); display: block; margin: 8px 0 14px; }
.tc-error-title { margin-bottom: 8px; }

/* ------------------------------------------------------------------- auth */
.tc-auth { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; position: relative; overflow: hidden; }
.tc-auth-glow { position: absolute; width: 640px; height: 640px; border-radius: 50%; background: radial-gradient(circle, rgba(232,255,0,0.14) 0%, rgba(232,255,0,0) 65%); top: -200px; right: -160px; pointer-events: none; }
.tc-auth-wrap { width: 100%; max-width: 420px; position: relative; }
.tc-auth-brand { text-align: center; margin-bottom: 28px; }
.tc-auth-logo { width: 64px; height: 64px; margin-bottom: 14px; }
.tc-auth-brand .tc-wordmark { font-size: 2rem; }
.tc-auth-brand .tc-wordmark-sub { font-size: 0.72rem; margin-top: 4px; }
.tc-auth-card { padding: 30px 30px 28px; box-shadow: var(--tc-shadow); }
.tc-auth-title { font-size: 1.35rem; margin-bottom: 4px; }
.tc-auth-foot { text-align: center; color: var(--tc-muted-2); font-size: 0.75rem; margin-top: 22px; }
@media (max-width: 575.98px) { .tc-auth-card { padding: 22px 18px; } }

/* ------------------------------------------------------------------ print */
@media print {
  .tc-sidebar, .tc-topbar, .tc-footer, .tc-filters, .tc-pagination, .tc-actions, .tc-sidebar-backdrop { display: none !important; }
  .tc-main { margin: 0; }
  body { background: #fff; color: #000; }
  .tc-card { border-color: #ccc; background: #fff; }
}
