/* ═══════════════════════════════════════════════════════════════════════════════
   TRUNKED — PHP Native Layout CSS v6.0 — Premium Metoxi-inspired Edition
   Collapsible sidebar, premium top bar, dropdowns, search, notifications
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ── Shell / App container ─────────────────────────────────────────────────── */
.tk-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: var(--tk-bg-primary);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Mobile top bar ────────────────────────────────────────────────────────── */
.tk-mobile-bar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--tk-bg-sidebar);
  border-bottom: 1px solid var(--tk-border);
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 200;
  backdrop-filter: blur(20px);
}

.tk-mobile-logo-link { display: flex; align-items: center; }
.tk-mobile-logo { height: 128px; width: auto; object-fit: contain; max-height: 48px; }
.tk-mobile-right { display: flex; align-items: center; gap: 8px; }

.tk-mobile-menu-btn {
  background: none;
  border: none;
  color: var(--tk-text-secondary);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tk-mobile-menu-btn svg { width: 22px; height: 22px; }

.tk-theme-toggle-sm {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  color: var(--tk-text-secondary);
}
.tk-theme-toggle-sm svg { width: 18px; height: 18px; }
.tk-theme-toggle-sm .tk-icon-sun { display: none; }
html.light .tk-theme-toggle-sm .tk-icon-moon { display: none; }
html.light .tk-theme-toggle-sm .tk-icon-sun  { display: block; }

/* ═══════════════════════════════════════════════════════════════════════════════
   SIDEBAR — Collapsible with smooth transitions
   ═══════════════════════════════════════════════════════════════════════════════ */
.tk-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--tk-bg-sidebar);
  border-right: 1px solid var(--tk-border);
  display: flex;
  flex-direction: column;
  overflow-y: hidden;
  overflow-x: hidden;
  height: 100vh;
  position: sticky;
  top: 0;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), background var(--tk-transition), border-color var(--tk-transition);
  z-index: 100;
}

/* Collapsed sidebar state */
.tk-sidebar-collapsed .tk-sidebar {
  width: 72px;
}

.tk-sidebar-collapsed .tk-sidebar-logo {
  justify-content: center;
  padding: 12px 8px 8px;
}

.tk-sidebar-collapsed .tk-logo-img {
  height: 32px;
  width: 32px;
  object-fit: contain;
  object-position: left center;
  transform: none;
}

.tk-sidebar-collapsed .tk-nav-label,
.tk-sidebar-collapsed .tk-nav-section-label span,
.tk-sidebar-collapsed .tk-user-info,
.tk-sidebar-collapsed .tk-logout-btn,
.tk-sidebar-collapsed .tk-sidebar-theme-text,
.tk-sidebar-collapsed .tk-bigman-tag {
  opacity: 0;
  width: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: opacity 0.2s, width 0.2s;
}

.tk-sidebar-collapsed .tk-nav-section-label {
  height: 8px;
  padding: 4px 0;
  margin: 0 auto;
  border-bottom: 1px solid var(--tk-border);
  width: 32px;
}

.tk-sidebar-collapsed .tk-nav-item {
  justify-content: center;
  padding: 10px;
}

.tk-sidebar-collapsed .tk-user-card {
  justify-content: center;
  padding: 8px;
}

.tk-sidebar-collapsed .tk-sidebar-theme {
  justify-content: center;
}

.tk-sidebar-collapsed .tk-sidebar-theme-btn {
  justify-content: center;
  padding: 8px;
}

/* Tooltip on hover for collapsed sidebar */
.tk-sidebar-collapsed .tk-nav-item {
  position: relative;
}
.tk-sidebar-collapsed .tk-nav-item:hover::after {
  content: attr(title);
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  background: var(--tk-bg-card);
  color: var(--tk-text-primary);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  white-space: nowrap;
  box-shadow: var(--tk-shadow-md);
  z-index: 200;
  margin-left: 8px;
  border: 1px solid var(--tk-border);
  pointer-events: none;
}

.tk-sidebar-logo {
  padding: 14px 16px 8px;
  flex-shrink: 0;
  height: 56px;
  overflow: hidden;
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
}
.tk-sidebar-logo a { display: inline-block; }
.tk-logo-img {
  height: 160px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(111,204,222,0.25));
  transition: all 0.3s ease;
  transform: scale(1);
  transform-origin: left center;
  max-width: 100%;
}
html.light .tk-logo-img {
  filter: drop-shadow(0 2px 8px rgba(42,58,134,0.18));
}

/* ── Nav ────────────────────────────────────────────────────────────────────── */
.tk-nav {
  flex: 1;
  padding: 6px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--tk-border) transparent;
}
.tk-nav::-webkit-scrollbar {
  width: 4px;
}
.tk-nav::-webkit-scrollbar-track {
  background: transparent;
}
.tk-nav::-webkit-scrollbar-thumb {
  background: var(--tk-border);
  border-radius: 4px;
}
.tk-nav::-webkit-scrollbar-thumb:hover {
  background: var(--tk-text-muted);
}

.tk-nav-section-label {
  padding: 16px 10px 6px;
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tk-text-muted);
  font-family: var(--tk-font-title);
  font-weight: 600;
  transition: all 0.3s ease;
  overflow: visible;
  white-space: nowrap;
}

.tk-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 10px;
  font-size: 0.9rem;
  color: var(--tk-text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.tk-nav-item:hover {
  background: var(--tk-surface-glass);
  color: var(--tk-text-primary);
}

.tk-nav-item.tk-nav-active {
  background: var(--tk-accent-glow);
  color: var(--tk-accent);
  font-weight: 600;
}

.tk-nav-item.tk-nav-active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--tk-accent);
  border-radius: 0 3px 3px 0;
}

html.light .tk-nav-item.tk-nav-active {
  background: rgba(42,58,134,0.1);
  color: #2a3a86;
}
html.light .tk-nav-item.tk-nav-active::before {
  background: #2a3a86;
}

.tk-nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  stroke: currentColor;
}

.tk-nav-label {
  transition: opacity 0.2s, width 0.3s;
  overflow: hidden;
  white-space: nowrap;
}

/* ── Sidebar bottom ────────────────────────────────────────────────────────── */
.tk-sidebar-bottom {
  flex-shrink: 0;
  border-top: 1px solid var(--tk-border);
  margin-top: auto;
}

/* ── User card ──────────────────────────────────────────────────────────────── */
.tk-user-card {
  margin: 8px 10px;
  padding: 10px 12px;
  background: var(--tk-surface-glass);
  border: 1px solid var(--tk-border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

html.light .tk-user-card {
  background: rgba(42,58,134,0.05);
}

.tk-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--tk-accent-deep), var(--tk-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.tk-user-info { flex: 1; min-width: 0; transition: opacity 0.2s; }
.tk-user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--tk-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tk-user-role {
  font-size: 0.7rem;
  color: var(--tk-text-muted);
  margin-top: 1px;
}

.tk-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tk-text-muted);
  transition: color 0.2s;
  flex-shrink: 0;
}
.tk-logout-btn:hover { color: #ef4444; }
.tk-logout-btn svg { width: 16px; height: 16px; }

/* ── Sidebar theme toggle ───────────────────────────────────────────────────── */
.tk-sidebar-theme {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.tk-sidebar-theme-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--tk-surface-glass);
  border: 1px solid var(--tk-border);
  border-radius: 10px;
  padding: 8px 12px;
  color: var(--tk-text-secondary);
  cursor: pointer;
  font-size: 0.78rem;
  width: 100%;
  transition: all 0.2s ease;
}
.tk-sidebar-theme-btn:hover {
  background: var(--tk-bg-card-hover);
  color: var(--tk-text-primary);
}
.tk-sidebar-theme-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.tk-sidebar-theme-btn .tk-icon-sun { display: none; }
html.light .tk-sidebar-theme-btn .tk-icon-moon { display: none; }
html.light .tk-sidebar-theme-btn .tk-icon-sun { display: block; }

.tk-sidebar-theme-text {
  transition: opacity 0.2s;
}

/* ── Sidebar Bigman tag ─────────────────────────────────────────────────────── */
.tk-sidebar .tk-bigman-tag {
  display: block;
  text-align: center;
  padding: 6px 8px 10px;
  flex-shrink: 0;
  transition: opacity 0.2s;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   TOP BAR — Premium header with search, icons, notifications
   ═══════════════════════════════════════════════════════════════════════════════ */
.tk-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--tk-bg-primary);
  position: relative;
}

.tk-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--tk-bg-secondary);
  border-bottom: 1px solid var(--tk-border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  flex-shrink: 0;
  backdrop-filter: blur(20px);
  transition: background var(--tk-transition);
}

html.light .tk-topbar {
  background: rgba(255,255,255,0.97);
}

.tk-topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.tk-topbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Sidebar toggle button */
.tk-sidebar-toggle {
  background: none;
  border: none;
  color: var(--tk-text-secondary);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s;
}
.tk-sidebar-toggle:hover {
  background: var(--tk-surface-glass);
  color: var(--tk-text-primary);
}

/* Search bar */
.tk-topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--tk-bg-input);
  border: 1px solid var(--tk-border);
  border-radius: 10px;
  padding: 7px 14px;
  max-width: 420px;
  width: 100%;
  transition: all 0.2s;
  position: relative;
}
.tk-topbar-search:focus-within {
  border-color: var(--tk-border-focus);
  box-shadow: 0 0 0 3px var(--tk-accent-glow);
}
.tk-topbar-search svg {
  color: var(--tk-text-muted);
  flex-shrink: 0;
}
.tk-topbar-search-input {
  background: none !important;
  border: none !important;
  outline: none !important;
  color: var(--tk-text-primary) !important;
  font-size: 0.85rem !important;
  width: 100%;
  padding: 0 !important;
  box-shadow: none !important;
}
.tk-topbar-search-input::placeholder {
  color: var(--tk-text-muted) !important;
}

.tk-search-kbd {
  display: flex;
  align-items: center;
  gap: 3px;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}
.tk-search-kbd kbd {
  background: var(--tk-surface-glass);
  border: 1px solid var(--tk-border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.65rem;
  color: var(--tk-text-muted);
  font-family: inherit;
}

/* Top bar icon buttons */
.tk-topbar-icon-btn {
  background: none;
  border: none;
  color: var(--tk-text-secondary);
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  transition: all 0.2s;
  position: relative;
}
.tk-topbar-icon-btn:hover {
  background: var(--tk-surface-glass);
  color: var(--tk-text-primary);
}

.tk-notif-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  background: #ef4444;
  color: #fff;
  font-size: 0.55rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}

/* Top bar user avatar */
.tk-topbar-user {
  cursor: pointer;
  margin-left: 4px;
}
.tk-topbar-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--tk-accent-deep), var(--tk-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  border: 2px solid var(--tk-border);
  transition: border-color 0.2s;
}
.tk-topbar-user:hover .tk-topbar-user-avatar {
  border-color: var(--tk-accent);
}

/* ── User Dropdown (topbar) ────────────────────────────────────────────────── */
.tk-topbar-user-wrap {
  position: relative;
  margin-left: 4px;
}

.tk-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 240px;
  background: var(--tk-bg-card);
  border: 1px solid var(--tk-border);
  border-radius: 14px;
  box-shadow: var(--tk-shadow-lg);
  z-index: 200;
  overflow: hidden;
  animation: tk-fade-in 0.15s ease-out;
}

.tk-user-dropdown-header {
  padding: 14px 16px;
}

.tk-user-dropdown-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--tk-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tk-user-dropdown-email {
  font-size: 0.72rem;
  color: var(--tk-text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tk-user-dropdown-divider {
  height: 1px;
  background: var(--tk-border);
  margin: 0;
}

.tk-user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 0.82rem;
  color: var(--tk-text-secondary);
  text-decoration: none;
  transition: all 0.15s ease;
  cursor: pointer;
}

.tk-user-dropdown-item:hover {
  background: var(--tk-surface-glass);
  color: var(--tk-text-primary);
}

.tk-user-dropdown-item svg {
  flex-shrink: 0;
  color: var(--tk-text-muted);
}

.tk-user-dropdown-item:hover svg {
  color: var(--tk-text-primary);
}

.tk-user-dropdown-logout:hover {
  background: rgba(239,68,68,0.08);
  color: #ef4444;
}

.tk-user-dropdown-logout:hover svg {
  color: #ef4444;
}

/* ── Breadcrumb ────────────────────────────────────────────────────────────── */
.tk-breadcrumb {
  padding: 12px 24px 0;
  font-size: 0.78rem;
  color: var(--tk-text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.tk-breadcrumb a {
  color: var(--tk-text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.tk-breadcrumb a:hover {
  color: var(--tk-accent);
}
.tk-breadcrumb-sep {
  color: var(--tk-text-muted);
  opacity: 0.5;
}
.tk-breadcrumb-active {
  color: var(--tk-text-primary);
  font-weight: 500;
}

/* ── Search results dropdown ───────────────────────────────────────────────── */
.tk-search-results {
  position: absolute;
  top: 56px;
  left: 0;
  right: 0;
  z-index: 60;
  padding: 0 24px;
  pointer-events: none;
}
.tk-search-results-inner {
  background: var(--tk-bg-card);
  border: 1px solid var(--tk-border);
  border-radius: 12px;
  box-shadow: var(--tk-shadow-lg);
  max-width: 480px;
  overflow: hidden;
  pointer-events: all;
  animation: tk-fade-in 0.15s ease-out;
}
.tk-search-result-item {
  display: block;
  padding: 12px 16px;
  text-decoration: none;
  border-bottom: 1px solid var(--tk-border);
  transition: background 0.15s;
}
.tk-search-result-item:last-child { border-bottom: none; }
.tk-search-result-item:hover { background: var(--tk-surface-glass); }
.tk-search-result-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--tk-text-primary);
}
.tk-search-result-desc {
  font-size: 0.75rem;
  color: var(--tk-text-muted);
  margin-top: 2px;
}
.tk-search-empty {
  padding: 20px 16px;
  text-align: center;
  color: var(--tk-text-muted);
  font-size: 0.85rem;
}

/* ── Notification dropdown ─────────────────────────────────────────────────── */
.tk-notif-dropdown {
  position: absolute;
  top: 56px;
  right: 24px;
  width: 340px;
  background: var(--tk-bg-card);
  border: 1px solid var(--tk-border);
  border-radius: 14px;
  box-shadow: var(--tk-shadow-lg);
  z-index: 60;
  overflow: hidden;
  animation: tk-fade-in 0.15s ease-out;
}
.tk-notif-header {
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--tk-border);
}
.tk-notif-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--tk-text-primary);
}
.tk-notif-count {
  font-size: 0.7rem;
  color: var(--tk-accent);
  background: var(--tk-accent-glow);
  padding: 2px 8px;
  border-radius: 12px;
}
.tk-notif-list {
  max-height: 320px;
  overflow-y: auto;
}
.tk-notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--tk-border);
  transition: background 0.15s;
}
.tk-notif-item:last-child { border-bottom: none; }
.tk-notif-item:hover { background: var(--tk-surface-glass); }
.tk-notif-item-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--tk-surface-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--tk-accent);
}
.tk-notif-item-content { flex: 1; min-width: 0; }
.tk-notif-item-text {
  font-size: 0.8rem;
  color: var(--tk-text-primary);
  line-height: 1.3;
}
.tk-notif-item-time {
  font-size: 0.7rem;
  color: var(--tk-text-muted);
  margin-top: 2px;
}
.tk-notif-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--tk-text-muted);
  font-size: 0.85rem;
}

/* ── Apps quick-nav dropdown ───────────────────────────────────────────────── */
.tk-apps-dropdown {
  position: absolute;
  top: 56px;
  right: 60px;
  width: 280px;
  background: var(--tk-bg-card);
  border: 1px solid var(--tk-border);
  border-radius: 14px;
  box-shadow: var(--tk-shadow-lg);
  z-index: 60;
  padding: 16px;
  animation: tk-fade-in 0.15s ease-out;
}
.tk-apps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.tk-apps-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 4px;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.2s;
  color: var(--tk-text-secondary);
  font-size: 0.7rem;
}
.tk-apps-item:hover {
  background: var(--tk-surface-glass);
  color: var(--tk-text-primary);
}
.tk-apps-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Mobile page title (shows in topbar on mobile when search is hidden) ──── */
.tk-topbar-page-title {
  display: none;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--tk-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
  font-family: var(--tk-font-title);
}

/* ── Visibility helpers ──────────────────────────────────────────────────── */
.tk-desktop-only { }
.tk-tablet-up { }

@media (max-width: 768px) {
  .tk-desktop-only { display: none !important; }
  .tk-topbar-page-title { display: block; }
}
@media (max-width: 640px) {
  .tk-tablet-up { display: none !important; }
  .tk-topbar-page-title { max-width: 120px; font-size: 0.82rem; }
}

/* ── Page content ───────────────────────────────────────────────────────────── */
.tk-content {
  flex: 1;
  padding: 20px 24px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

/* ── Page footer ────────────────────────────────────────────────────────────── */
.tk-page-footer {
  padding: 16px 24px;
  text-align: center;
  flex-shrink: 0;
}

/* ── Overlay for mobile sidebar — defined in RESPONSIVE section below ─── */

/* ═══════════════════════════════════════════════════════════════════════════════
   PREMIUM COMPONENT STYLES
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ── Stat cards — Premium ────────────────────────────────────────────────────── */
.tk-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.tk-stat-card {
  background: var(--tk-bg-card);
  border: 1px solid var(--tk-border);
  border-radius: 16px;
  padding: 20px 22px;
  border-left: 3px solid var(--tk-accent);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.tk-stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  background: var(--tk-card-shine);
  border-radius: 0 16px 0 80px;
  pointer-events: none;
  opacity: 0.6;
}

.tk-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--tk-shadow-md);
  border-color: var(--tk-border-focus);
}

.tk-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--tk-text-primary);
  font-family: var(--tk-font-title);
  position: relative;
  z-index: 1;
}

.tk-stat-label {
  font-size: 0.75rem;
  color: var(--tk-text-muted);
  margin-top: 4px;
  position: relative;
  z-index: 1;
}

/* ── Icon stat card (Metoxi-style top row) ─────────────────────────────────── */
.tk-icon-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.tk-icon-stat-card {
  background: var(--tk-bg-card);
  border: 1px solid var(--tk-border);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.tk-icon-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--tk-shadow-md);
}

.tk-icon-stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tk-icon-stat-info {
  flex: 1;
  min-width: 0;
}

.tk-icon-stat-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--tk-text-primary);
  line-height: 1.2;
}

.tk-icon-stat-label {
  font-size: 0.75rem;
  color: var(--tk-text-muted);
  margin-top: 2px;
}

/* ── Wide revenue card (hero KPI) ──────────────────────────────────────────── */
.tk-hero-kpi {
  background: var(--tk-bg-card);
  border: 1px solid var(--tk-border);
  border-radius: 18px;
  padding: 24px 28px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.tk-hero-kpi::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--tk-accent), transparent);
  opacity: 0.3;
}

.tk-hero-kpi-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.tk-hero-kpi-main {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.tk-hero-kpi-amount {
  font-size: 2rem;
  font-weight: 700;
  color: var(--tk-text-primary);
  font-family: var(--tk-font-title);
}

.tk-hero-kpi-badge {
  padding: 3px 10px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
}
.tk-badge-up { background: rgba(5,150,105,0.15); color: #059669; }
.tk-badge-down { background: rgba(239,68,68,0.15); color: #ef4444; }

.tk-hero-kpi-label {
  font-size: 0.85rem;
  color: var(--tk-text-muted);
  margin-top: 4px;
}

/* ── Dashboard grid layouts ────────────────────────────────────────────────── */
.tk-dash-row {
  display: grid;
  gap: 20px;
  margin-bottom: 20px;
}
.tk-dash-row-2 { grid-template-columns: 1fr 1fr; }
.tk-dash-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.tk-dash-row-hero { grid-template-columns: 1fr 1.5fr; }

/* ── Mini chart / sparkline container ──────────────────────────────────────── */
.tk-mini-chart {
  height: 60px;
  margin-top: 12px;
  position: relative;
}

.tk-mini-chart-bar {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 100%;
}

.tk-mini-chart-bar span {
  flex: 1;
  background: var(--tk-accent);
  border-radius: 3px 3px 0 0;
  opacity: 0.7;
  min-height: 4px;
  transition: opacity 0.2s;
}
.tk-mini-chart-bar span:hover {
  opacity: 1;
}

/* ── Percentage circle ─────────────────────────────────────────────────────── */
.tk-pct-circle {
  width: 80px;
  height: 80px;
  position: relative;
}
.tk-pct-circle svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.tk-pct-circle-bg {
  fill: none;
  stroke: var(--tk-surface-glass);
  stroke-width: 6;
}
.tk-pct-circle-fill {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s ease;
}
.tk-pct-circle-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--tk-text-primary);
}

/* ── Cards — Premium ─────────────────────────────────────────────────────────── */
.tk-card {
  background: var(--tk-bg-card);
  border: 1px solid var(--tk-border);
  border-radius: 18px;
  padding: 22px;
  margin-bottom: 16px;
  box-shadow: var(--tk-shadow-sm);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.tk-card:hover {
  box-shadow: var(--tk-shadow-md);
}

html.light .tk-card {
  background: #ffffff;
  border-color: rgba(42,58,134,0.1);
}

/* Premium card variant */
.tk-card-premium {
  background: var(--tk-bg-card);
  border: 1px solid var(--tk-border);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--tk-shadow-sm);
  position: relative;
}

.tk-card-premium::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--tk-accent), transparent);
  opacity: 0.3;
}

html.light .tk-card-premium {
  background: #ffffff;
}

/* Card header with icon */
.tk-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--tk-border);
}

.tk-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tk-card-heading {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--tk-text-primary);
  font-family: var(--tk-font-title);
  margin: 0;
}

.tk-card-subheading {
  font-size: 0.78rem;
  color: var(--tk-text-muted);
  margin: 2px 0 0;
}

/* Settings divider */
.tk-settings-divider {
  height: 1px;
  background: var(--tk-border);
  margin: 24px 0;
}

/* Settings grid */
.tk-settings-grid {
  max-width: 720px;
}

/* ── Tables — Premium ────────────────────────────────────────────────────────── */
.tk-table-wrap { overflow-x: auto; }

.tk-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.tk-table thead tr {
  border-bottom: 1px solid var(--tk-border);
}

.tk-table th {
  text-align: left;
  padding: 12px 14px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--tk-text-muted) !important;
  font-family: var(--tk-font-title);
  font-weight: 500;
  background: var(--tk-surface-glass);
}

.tk-table th:first-child {
  border-radius: 10px 0 0 10px;
}

.tk-table th:last-child {
  border-radius: 0 10px 10px 0;
}

.tk-table td {
  padding: 12px 14px;
  color: var(--tk-text-secondary);
  font-size: 0.875rem;
  border-bottom: 1px solid var(--tk-border);
  transition: background 0.15s ease;
}

.tk-table tbody tr:hover {
  background: var(--tk-surface-glass);
}

.tk-table tbody tr:last-child td {
  border-bottom: none;
}

html.light .tk-table td { color: #3a3e58 !important; }
html.light .tk-table th { color: #7a7e98 !important; background: rgba(42,58,134,0.03); }
html.light .tk-table tbody tr:hover { background: rgba(42,58,134,0.03) !important; }

/* ── Buttons — Premium ───────────────────────────────────────────────────────── */
.tk-btn {
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  letter-spacing: 0.04em;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-family: var(--tk-font-body);
  position: relative;
  overflow: hidden;
}

.tk-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, transparent 60%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s;
}
.tk-btn:hover::after { opacity: 1; }

.tk-btn-primary {
  background: linear-gradient(135deg, #2a3a86, #3a4fa0);
  color: #fff;
  box-shadow: 0 2px 8px rgba(42,58,134,0.3);
}
.tk-btn-primary:hover {
  background: linear-gradient(135deg, #3a4fa0, #4b60b2);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(42,58,134,0.4);
}

.tk-btn-success {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
  box-shadow: 0 2px 8px rgba(5,150,105,0.25);
}
.tk-btn-success:hover {
  background: linear-gradient(135deg, #047857, #059669);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(5,150,105,0.35);
}

.tk-btn-danger {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: #fff;
  box-shadow: 0 2px 8px rgba(220,38,38,0.25);
}
.tk-btn-danger:hover {
  background: linear-gradient(135deg, #b91c1c, #dc2626);
  transform: translateY(-1px);
}

.tk-btn-secondary {
  background: var(--tk-bg-input);
  color: var(--tk-text-primary);
  border: 1px solid var(--tk-border);
}
.tk-btn-secondary:hover {
  background: var(--tk-surface-glass);
  border-color: var(--tk-border-focus);
  transform: translateY(-1px);
}

/* ── Badges — Premium ────────────────────────────────────────────────────────── */
.tk-badge {
  padding: 3px 10px;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 600;
  display: inline-block;
  letter-spacing: 0.02em;
}

/* ── Form controls ───────────────────────────────────────────────────────────── */
.tk-input, .tk-select, .tk-textarea {
  width: 100%;
  padding: 9px 14px;
  border-radius: 10px;
  background: var(--tk-bg-input);
  border: 1px solid var(--tk-border);
  color: var(--tk-text-primary);
  font-size: 0.9rem;
  box-sizing: border-box;
  transition: all var(--tk-transition);
  font-family: var(--tk-font-body);
}

.tk-input:focus, .tk-select:focus, .tk-textarea:focus {
  border-color: var(--tk-border-focus);
  outline: none;
  box-shadow: 0 0 0 3px var(--tk-accent-glow);
}

.tk-form-label {
  display: block;
  font-size: 0.8rem;
  color: var(--tk-text-muted);
  margin-bottom: 6px;
  font-weight: 500;
}

.tk-form-group {
  margin-bottom: 16px;
}

.tk-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* ── Filter bar ──────────────────────────────────────────────────────────────── */
.tk-filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 20px;
  padding: 14px 18px;
  background: var(--tk-bg-card);
  border: 1px solid var(--tk-border);
  border-radius: 14px;
}

.tk-filter-bar .tk-input,
.tk-filter-bar .tk-select {
  width: auto;
  padding: 7px 12px;
}

.tk-filter-sep {
  color: var(--tk-text-muted);
  font-size: 0.85rem;
}

.tk-filter-right {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

html.light .tk-filter-bar {
  background: #ffffff;
  border-color: rgba(42,58,134,0.1);
}

/* ── Empty state ─────────────────────────────────────────────────────────────── */
.tk-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--tk-text-muted);
  font-size: 0.9rem;
}

/* ── Action bar ──────────────────────────────────────────────────────────────── */
.tk-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── Loading spinner ─────────────────────────────────────────────────────────── */
.tk-loading {
  text-align: center;
  padding: 40px;
  color: var(--tk-text-muted);
}

/* ── Alert/notification — Premium ────────────────────────────────────────────── */
.tk-alert {
  padding: 14px 18px;
  border-radius: 12px;
  margin-bottom: 16px;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: tk-fade-in 0.3s ease-out;
}
.tk-alert-success {
  background: rgba(5,150,105,0.1);
  color: #059669;
  border: 1px solid rgba(5,150,105,0.2);
  border-left: 3px solid #059669;
}
.tk-alert-error {
  background: rgba(220,38,38,0.08);
  color: #dc2626;
  border: 1px solid rgba(220,38,38,0.15);
  border-left: 3px solid #dc2626;
}
.tk-alert-info {
  background: var(--tk-accent-glow);
  color: var(--tk-accent);
  border: 1px solid var(--tk-border);
  border-left: 3px solid var(--tk-accent);
}

/* ── Modal — Premium ─────────────────────────────────────────────────────────── */
.tk-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 500;
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.tk-modal-backdrop.tk-modal-open { display: flex; }

.tk-modal {
  background: var(--tk-bg-card);
  border: 1px solid var(--tk-border);
  border-radius: 22px;
  box-shadow: var(--tk-shadow-lg);
  padding: 28px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  animation: tk-fade-in 0.2s ease-out;
  position: relative;
}

.tk-modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--tk-accent), transparent);
  opacity: 0.3;
  border-radius: 22px 22px 0 0;
}

html.light .tk-modal { background: #ffffff; }

.tk-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.tk-modal-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--tk-text-primary);
  font-family: var(--tk-font-title);
}
.tk-modal-close {
  background: var(--tk-surface-glass) !important;
  border: 1px solid var(--tk-border) !important;
  border-radius: 8px !important;
  color: var(--tk-text-muted);
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  padding: 4px 8px;
  transition: all 0.2s;
  width: auto;
  height: auto;
  letter-spacing: normal !important;
  text-transform: none !important;
  font-weight: normal !important;
  box-shadow: none !important;
}
.tk-modal-close::before {
  display: none !important;
}
.tk-modal-close:hover {
  color: var(--tk-text-primary);
  background: var(--tk-bg-input) !important;
  transform: none !important;
}

.tk-modal-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--tk-border);
}

/* ── Monthly/Yearly stat pair (Metoxi-inspired) ──────────────────────────────── */
.tk-revenue-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.tk-revenue-pair-card {
  background: var(--tk-bg-card);
  border: 1px solid var(--tk-border);
  border-radius: 16px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.tk-revenue-pair-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tk-revenue-pair-info { flex: 1; }
.tk-revenue-pair-label {
  font-size: 0.78rem;
  color: var(--tk-text-muted);
}
.tk-revenue-pair-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--tk-text-primary);
  line-height: 1.2;
}
.tk-revenue-pair-change {
  font-size: 0.7rem;
  margin-top: 2px;
}

/* ── Progress bar (goal-style) ─────────────────────────────────────────────── */
.tk-goal-bar {
  margin-top: 12px;
}
.tk-goal-bar-track {
  height: 8px;
  background: var(--tk-surface-glass);
  border-radius: 4px;
  overflow: hidden;
}
.tk-goal-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s ease;
}
.tk-goal-bar-label {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--tk-text-muted);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE — Mobile-first fixes (REBUILT v9.0 — fully usable on mobile)
   ═══════════════════════════════════════════════════════════════════════════════ */

/* -- Overlay: NO blur — blur causes the dashboard to become unreadable/unusable -- */
.tk-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 150;
  /* CRITICAL: No blur filters — they block interaction and obscure content */
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  filter: none !important;
  opacity: 0;
  transition: opacity 0.3s ease;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}
.tk-overlay-show {
  display: block !important;
  opacity: 1;
}

/* -- Body scroll lock when mobile sidebar is open -- */
body.tk-sidebar-mobile-open {
  overflow: hidden !important;
  touch-action: none;
}
/* Prevent the main content from being interactive behind overlay */
body.tk-sidebar-mobile-open .tk-main {
  pointer-events: none;
}
body.tk-sidebar-mobile-open .tk-sidebar {
  pointer-events: auto;
}
body.tk-sidebar-mobile-open .tk-sidebar-overlay {
  pointer-events: auto;
}

@media (max-width: 1200px) {
  .tk-icon-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .tk-dash-row-2 { grid-template-columns: 1fr; }
  .tk-dash-row-3 { grid-template-columns: 1fr; }
  .tk-dash-row-hero { grid-template-columns: 1fr; }
  .tk-revenue-pair { grid-template-columns: 1fr; }
}

@media (max-width: 1024px) {
  /* Show mobile top bar */
  .tk-mobile-bar { display: flex; }

  /* Shell needs top padding for fixed mobile bar */
  .tk-shell {
    padding-top: 56px;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  /* ── Sidebar: off-canvas left drawer ── */
  .tk-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    height: 100dvh;
    width: 280px !important;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 200;
    box-shadow: none;
    will-change: transform;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .tk-sidebar.tk-sidebar-open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.35);
  }

  /* ── Undo collapsed sidebar state on mobile — always show full sidebar ── */
  .tk-sidebar-collapsed .tk-sidebar {
    width: 280px !important;
    transform: translateX(-100%);
  }
  .tk-sidebar-collapsed .tk-sidebar.tk-sidebar-open {
    transform: translateX(0);
  }
  .tk-sidebar-collapsed .tk-nav-label,
  .tk-sidebar-collapsed .tk-nav-section-label span,
  .tk-sidebar-collapsed .tk-user-info,
  .tk-sidebar-collapsed .tk-logout-btn,
  .tk-sidebar-collapsed .tk-sidebar-theme-text,
  .tk-sidebar-collapsed .tk-bigman-tag {
    opacity: 1;
    width: auto;
    overflow: visible;
  }
  .tk-sidebar-collapsed .tk-nav-section-label {
    height: auto;
    border-bottom: none;
    width: auto;
    padding: 14px 10px 4px;
  }
  .tk-sidebar-collapsed .tk-nav-item {
    justify-content: flex-start;
    padding: 11px 12px;
  }
  .tk-sidebar-collapsed .tk-nav-item:hover::after {
    display: none;
    content: none;
  }
  .tk-sidebar-collapsed .tk-user-card {
    justify-content: flex-start;
    padding: 10px 12px;
  }
  .tk-sidebar-collapsed .tk-sidebar-theme {
    justify-content: stretch;
  }
  .tk-sidebar-collapsed .tk-sidebar-theme-btn {
    justify-content: flex-start;
    padding: 8px 12px;
  }
  .tk-sidebar-collapsed .tk-logo-img {
    height: 160px;
    width: auto;
    object-fit: contain;
    object-position: left center;
    transform: none;
  }
  .tk-sidebar-collapsed .tk-sidebar-logo {
    padding: 14px 16px 8px;
    justify-content: flex-start;
  }

  /* ── Main content: full width ── */
  .tk-main {
    width: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Show the sidebar toggle in topbar on mobile */
  .tk-sidebar-toggle { display: flex; }
  .tk-content { padding: 16px; }
  .tk-topbar-search { max-width: 220px; }

  /* ── Notification/Apps/User dropdowns: make responsive ── */
  .tk-notif-dropdown {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    max-height: 70vh;
    border-radius: 18px 18px 0 0 !important;
    z-index: 300;
    overflow-y: auto;
  }
  .tk-apps-dropdown {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    border-radius: 18px 18px 0 0 !important;
    z-index: 300;
  }
  .tk-user-dropdown {
    right: 0;
    width: 240px;
    max-width: calc(100vw - 16px);
  }

  /* Tables scroll on mobile */
  .tk-table-wrap {
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
  }

  /* Filter bar wraps on mobile */
  .tk-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .tk-filter-bar .tk-input,
  .tk-filter-bar .tk-select {
    width: 100%;
  }
  .tk-filter-right {
    margin-left: 0;
    width: 100%;
    justify-content: stretch;
  }
  .tk-filter-right .tk-btn {
    flex: 1;
    justify-content: center;
  }

  /* Action bar stacks vertically */
  .tk-action-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  /* Modal full-width on mobile */
  .tk-modal {
    max-width: 100%;
    border-radius: 16px 16px 0 0;
    margin-top: auto;
  }
  .tk-modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  /* Form grids single column on mobile */
  .tk-form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .tk-topbar-search { display: none; }
  .tk-icon-stat-grid { grid-template-columns: 1fr 1fr; }

  /* Topbar: reduce padding */
  .tk-topbar { padding: 0 12px; height: 50px; }
  .tk-breadcrumb { padding: 8px 12px 0; font-size: 0.72rem; }
  .tk-content { padding: 12px; }

  /* Hero KPI responsive */
  .tk-hero-kpi { padding: 18px 16px; }
  .tk-hero-kpi-amount { font-size: 1.5rem; }

  /* Card padding smaller */
  .tk-card { padding: 14px; border-radius: 14px; }
  .tk-card-premium { padding: 18px; border-radius: 16px; }

  /* Card header stacking */
  .tk-card-header {
    flex-wrap: wrap;
    gap: 10px;
  }

  /* Topbar icon buttons tighter */
  .tk-topbar-right { gap: 2px; }
  .tk-topbar-icon-btn { padding: 6px; }
  .tk-topbar-icon-btn svg { width: 16px; height: 16px; }

  /* Fullscreen and grid buttons hidden on small screens */
  #tkFullscreen { display: none; }

  /* Search results panel */
  .tk-search-results {
    padding: 0 12px;
  }
}

@media (max-width: 640px) {
  .tk-stat-grid { grid-template-columns: 1fr 1fr; }
  .tk-form-grid { grid-template-columns: 1fr; }
  .tk-topbar { padding: 0 10px; }
  .tk-breadcrumb { padding: 6px 10px 0; font-size: 0.7rem; }
  .tk-icon-stat-grid { grid-template-columns: 1fr; }

  /* Mobile bar adjustments */
  .tk-mobile-bar { padding: 0 12px; height: 52px; }
  .tk-mobile-logo { max-height: 36px; }

  /* Revenue pair stacks */
  .tk-revenue-pair { grid-template-columns: 1fr; gap: 10px; }
  .tk-revenue-pair-card { padding: 14px 16px; }
  .tk-revenue-pair-value { font-size: 1.1rem; }

  /* Smaller stat cards */
  .tk-stat-card { padding: 14px 16px; border-radius: 12px; }
  .tk-stat-value { font-size: 1.2rem; }
  .tk-icon-stat-card { padding: 14px; }
  .tk-icon-stat-value { font-size: 1.1rem; }
  .tk-icon-stat-icon { width: 38px; height: 38px; }

  /* Modal bottom sheet on small screens */
  .tk-modal {
    border-radius: 20px 20px 0 0;
    max-height: 85vh;
    padding: 20px 16px;
  }

  /* Table cells compact */
  .tk-table th { padding: 10px 8px !important; font-size: 0.62rem !important; }
  .tk-table td { padding: 10px 8px !important; font-size: 0.78rem !important; }

  /* Badge sizing */
  .tk-badge { font-size: 0.62rem; padding: 3px 8px; }

  /* Action buttons in tables */
  .tk-btn { padding: 7px 12px; font-size: 0.75rem; }
}

@media (max-width: 380px) {
  .tk-stat-grid { grid-template-columns: 1fr; }
  .tk-topbar-right { gap: 1px; }
  .tk-topbar-icon-btn { padding: 5px; }
  .tk-content { padding: 8px; }
  .tk-mobile-bar { padding: 0 8px; }

  /* Hero KPI tighter */
  .tk-hero-kpi { padding: 14px 12px; }
  .tk-hero-kpi-amount { font-size: 1.3rem; }

  /* Cards even tighter */
  .tk-card { padding: 12px; border-radius: 12px; }
}
