/* ── DESIGN SYSTEM VARIABLES (MATCHING AVALONIA THEME) ── */
:root {
  --bg-app: #0D1117;
  --bg-sidebar: #010409;
  --bg-header: #010409;
  --bg-card: #161B22;
  --bg-card-hover: #1C2128;
  --border-color: #21262D;
  
  --color-primary: #2563EB;
  --color-accent: #60A5FA;
  --color-success: #3FB950;
  --color-success-bg: #0a3622;
  --color-success-bg-dark: #0a2a1a;
  --color-warning: #FBBF24;
  --color-warning-bg: #1f3a5f;
  --color-danger: #F85149;
  --color-danger-bg: #3b1219;
  
  --text-main: #F0F6FC;
  --text-muted: #8B949E;
  --text-link: #58A6FF;
  --text-light-blue: #83b2f0;
  --text-item-blue: #b7c6da;
  
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'Source Code Pro', 'Cascadia Mono', Consolas, monospace;
  
  --border-radius-lg: 8px;
  --border-radius-md: 6px;
  --border-radius-sm: 4px;
  
  --header-height: 40px;
}

/* ── ROOT RESET & BASE STYLING ── */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

body {
  background-color: var(--bg-app);
  color: var(--text-main);
  font-family: var(--font-ui);
  font-size: 13px;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-app);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ── HEADER PANEL ── */
.app-header {
  background-color: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-logo-img {
  height: 24px;
  width: auto;
  border-radius: var(--border-radius-sm);
}

.app-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-main);
}

.header-center {
  display: flex;
  align-items: center;
  gap: 10px;
}

.connection-status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: rgba(255,255,255,0.03);
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.05);
}

.status-bulb {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 5px currentColor;
  transition: background-color 0.3s;
}
.status-bulb.offline { background-color: var(--color-danger); color: var(--color-danger); }
.status-bulb.online { background-color: var(--color-success); color: var(--color-success); }
.status-bulb.loading { background-color: var(--color-warning); color: var(--color-warning); }

.status-text {
  font-size: 10px;
  color: var(--text-item-blue);
  font-weight: 500;
}

.mode-text {
  font-size: 11px;
  color: var(--text-link);
  font-weight: 500;
}

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

/* ── LAYOUT & PANELS ── */
.app-layout {
  display: flex;
  flex: 1;
  height: calc(100vh - var(--header-height));
  position: relative;
}

/* Sidebar Panel */
.sidebar-panel {
  width: 220px;
  min-width: 220px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

.panel-header {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255,255,255,0.02);
}

.panel-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-light-blue);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.profile-scroll-container {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.profile-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 8px;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border-color);
  background-color: rgba(0,0,0,0.1);
}

/* Main Content Panel */
.main-content-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 16px;
  gap: 16px;
}

/* Cards Base */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  transition: background-color 0.15s ease;
}

.explorer-card {
  flex: 5 1 350px;
  min-height: 250px;
}

.queue-card {
  flex: 2 1 120px;
  min-height: 100px;
}

.logs-card {
  flex: 2 1 120px;
  min-height: 120px;
}

/* ── BUTTONS ── */
button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font-ui);
  text-align: center;
  transition: all 0.12s ease;
}

.icon-btn {
  background: transparent;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--border-radius-sm);
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.icon-btn:hover {
  background-color: rgba(255,255,255,0.06);
  color: var(--text-main);
}
.icon-btn:active {
  background-color: rgba(255,255,255,0.12);
}

.glyph-btn {
  font-size: 14px;
  padding: 6px;
  width: 28px;
  height: 28px;
}

.small-btn {
  padding: 4px 8px;
  font-size: 11px;
}

.add-btn {
  color: var(--text-item-blue);
  font-size: 14px;
}

.text-btn {
  color: var(--text-light-blue);
  font-size: 11px;
  padding: 4px 8px;
}
.text-btn:hover {
  color: #fff;
  text-decoration: underline;
  background: none;
}

.footer-btn {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--border-radius-sm);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.action-connect-btn {
  background-color: #1F2937;
  color: var(--color-accent);
}
.action-connect-btn:hover:not(:disabled) {
  background-color: #374151;
}
.action-connect-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.upload-action-btn {
  background-color: var(--color-success-bg-dark);
  color: var(--color-success);
  border: 1px solid rgba(63, 185, 80, 0.15);
}
.upload-action-btn:hover:not(:disabled) {
  background-color: var(--color-success-bg);
}
.upload-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Filter Pills */
.filter-pill {
  background-color: #21262D;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}
.filter-pill:hover {
  background-color: #30363D;
  color: var(--text-main);
}
.filter-pill.active {
  background-color: rgba(37, 99, 235, 0.15);
  color: var(--color-accent);
  border: 1px solid rgba(37, 99, 235, 0.3);
}

/* ── PROFILE ROW ITEMS ── */
.profile-item {
  background-color: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}
.profile-item:hover {
  border-color: var(--color-primary);
  background-color: rgba(255, 255, 255, 0.01);
}
.profile-item.active {
  border-color: var(--color-primary);
  background-color: rgba(37, 99, 235, 0.08);
}
.profile-item.active-connected {
  border-color: #3FB950 !important;
  background-color: rgba(63, 185, 80, 0.08) !important;
  box-shadow: 0 0 10px rgba(63, 185, 80, 0.15);
}

.profile-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
  flex: 1;
}

.profile-top-line {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
}

.profile-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-status-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 10px;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.profile-status-badge.connected {
  background: rgba(63, 185, 80, 0.2);
  color: #3FB950;
  border: 1px solid rgba(63, 185, 80, 0.4);
}

.profile-status-badge.selected {
  background: rgba(37, 99, 235, 0.15);
  color: #60A5FA;
  border: 1px solid rgba(37, 99, 235, 0.3);
}

.profile-status-badge.idle {
  background: rgba(139, 148, 158, 0.1);
  color: #8B949E;
  border: 1px solid rgba(139, 148, 158, 0.2);
}

.pulse-dot {
  width: 6px;
  height: 6px;
  background-color: #3FB950;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 rgba(63, 185, 80, 0.7);
  animation: pulseGreen 1.8s infinite;
}

@keyframes pulseGreen {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(63, 185, 80, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(63, 185, 80, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(63, 185, 80, 0);
  }
}

.profile-host {
  font-size: 10px;
  color: var(--text-light-blue);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-item-actions {
  display: flex;
  align-items: center;
  margin-left: 8px;
}

/* ── REMOTE BROWSER VIEW ── */
.explorer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.explorer-title-box {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.current-path-breadcrumbs {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-light-blue);
}

.explorer-actions {
  display: flex;
  gap: 6px;
}

.ctrl-btn {
  background-color: var(--bg-app);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  font-size: 11px;
}
.ctrl-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.explorer-list-container {
  flex: 1;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  background-color: var(--bg-sidebar);
  overflow-y: auto;
  position: relative;
  min-height: 120px;
}

/* Drag overlay */
.drag-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(13, 17, 23, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.2s ease;
  border: 2px dashed var(--color-accent);
  border-radius: var(--border-radius-md);
}
.explorer-list-container.dragover .drag-overlay {
  opacity: 1;
}

.drag-message {
  text-align: center;
  color: var(--color-accent);
  font-weight: 500;
}
.drag-message span {
  display: block;
  font-size: 24px;
  margin-bottom: 8px;
}

.file-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.file-table th {
  background-color: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 12px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.file-table td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.02);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-table tr {
  cursor: pointer;
  transition: background-color 0.1s;
}
.file-table tr:hover:not(.info-row) {
  background-color: rgba(255,255,255,0.03);
}

.file-name-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
  font-weight: 500;
}

.file-icon {
  font-size: 14px;
  color: var(--color-accent);
}
.file-icon.folder {
  color: #F8D77F;
}

.centered-cell {
  text-align: center;
  padding: 32px !important;
}

.explorer-footer {
  margin-top: 12px;
}

/* ── LIVE TRANSFER QUEUE ── */
.queue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.queue-title-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 700;
}
.badge-active {
  background-color: var(--color-warning-bg);
  color: var(--color-accent);
}

.queue-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Queue Card Items */
.queue-item {
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.queue-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.queue-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.direction-indicator {
  font-size: 12px;
  font-weight: bold;
}
.direction-indicator.upload { color: var(--color-success); }
.direction-indicator.download { color: var(--color-accent); }

.queue-file-name {
  font-weight: 600;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.queue-item-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
}

.speed-txt { color: var(--color-success); }
.size-txt { color: var(--text-muted); }
.eta-txt { color: var(--text-muted); }

.queue-item-progress-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.progress-bar-container {
  height: 5px;
  background-color: var(--border-color);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background-color: var(--color-primary);
  width: 0%;
  transition: width 0.3s;
}

.pct-txt {
  align-self: flex-end;
  font-size: 10px;
  color: var(--text-light-blue);
  font-weight: 500;
}

.cancel-transfer-btn {
  color: var(--color-danger);
  padding: 4px;
  font-size: 11px;
  font-weight: bold;
}
.cancel-transfer-btn:hover {
  background-color: rgba(248, 81, 73, 0.15);
}

/* ── LOGS CONSOLE ── */
.logs-card {
  gap: 10px;
}

.logs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logs-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logs-filters {
  display: flex;
  gap: 6px;
}

.logs-console {
  flex: 1;
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.log-row {
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-all;
}
.log-row.success-text { color: var(--color-success); }
.log-row.warning-text { color: var(--color-warning); }
.log-row.error-text { color: var(--color-danger); }
.log-row.info-row { color: var(--text-light-blue); }

/* empty states */
.empty-state {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 12px;
}

.muted {
  color: var(--text-muted) !important;
}

/* ── LAYERED HISTORY COLLAPSIBLE SIDE PANELS ── */
.history-panel {
  width: 380px;
  min-width: 380px;
  background-color: var(--bg-sidebar);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.1, 0.9, 0.2, 1);
  transform: translateX(0);
}
.history-panel.collapsed {
  transform: translateX(100%);
  width: 0px;
  min-width: 0px;
  border-left: none;
  overflow: hidden;
}

.history-title-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.history-date {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-top: 2px;
}

.history-controls {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
}

.history-date-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.history-datepicker {
  flex: 1;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: var(--border-radius-sm);
  padding: 4px 6px;
  font-size: 11px;
  height: 28px;
}

.history-search-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.history-search {
  width: 100%;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: var(--border-radius-sm);
  padding: 6px 10px;
  font-size: 11px;
}
.history-search::placeholder {
  color: var(--text-muted);
}

.history-filters {
  display: flex;
  gap: 6px;
}

.history-scroll-container {
  flex: 1;
  overflow-y: auto;
  padding: 12px 8px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* History Card */
.history-item {
  background-color: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 10px;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}
.history-item:hover {
  border-color: var(--color-accent);
}

.history-card-header {
  display: flex;
  gap: 8px;
}

.history-thumb {
  width: 40px;
  height: 40px;
  border-radius: var(--border-radius-sm);
  background-color: rgba(255,255,255,0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 10px;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  flex-shrink: 0;
  overflow: hidden;
}

.history-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.history-item-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.history-item-title {
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-main);
}

.history-item-size {
  font-size: 10px;
  color: var(--text-muted);
}

.history-status-row {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.playback-status {
  font-size: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.playback-status.active { color: var(--color-success); }
.playback-status.inactive { color: var(--text-muted); }

.history-time {
  font-size: 10px;
  color: var(--text-item-blue);
}

.history-download-row {
  margin-top: 6px;
}

.history-dll-btn {
  background-color: var(--color-success-bg-dark);
  color: var(--color-success);
  font-size: 10px;
  padding: 4px 8px;
  border-radius: var(--border-radius-sm);
  width: auto;
}
.history-dll-btn:hover {
  background-color: var(--color-success-bg);
}

/* Preview Drawer (Inside History Panel) */
.media-preview-drawer {
  height: 250px;
  background-color: #000;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 10;
  transition: height 0.3s;
}
.media-preview-drawer.collapsed {
  height: 0px;
  overflow: hidden;
  border-top: none;
}

.preview-header {
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  background-color: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-color);
}

.preview-file-name {
  font-size: 10px;
  font-weight: bold;
  max-width: 250px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-main);
}

.preview-viewport {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: #050505;
  position: relative;
}

.preview-viewport video {
  width: 100%;
  height: 100%;
  max-height: 220px;
  background: black;
  object-fit: contain;
}

.preview-viewport img {
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: 4px;
}

.preview-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 11px;
}

.audio-player-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 90%;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.audio-icon-lg {
  font-size: 32px;
}

.audio-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-main);
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-audio-element {
  width: 100%;
  height: 36px;
}

.preview-pdf-element {
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
}

.preview-txt-container {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 12px;
}

.preview-txt {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #85e89d;
  white-space: pre-wrap;
  word-break: break-all;
}

.unsupported-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}

.unsupported-preview span {
  font-size: 32px;
}

/* ── MODALS DIALOGS ── */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 8, 15, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 1;
  pointer-events: auto;
}
.modal.open {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.modal-content {
  background: #161B22;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  width: 520px;
  max-width: 92vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85);
  overflow: hidden;
  position: relative;
  z-index: 100000;
  animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalPop {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding-bottom: 10px;
}

.modal-header h3 {
  font-size: 14px;
  font-weight: 600;
}

/* Forms */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.form-row {
  display: flex;
  gap: 12px;
}

.flex-3 { flex: 3 !important; }
.flex-1 { flex: 1 !important; }

form label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

form input[type="text"],
form input[type="password"],
form input[type="number"],
form select {
  background-color: var(--bg-app);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: var(--border-radius-sm);
  padding: 8px 10px;
  font-size: 12px;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}
form input:focus,
form select:focus {
  border-color: var(--color-primary);
}

.modal-footer {
  display: flex;
  margin-top: 10px;
  gap: 12px;
  align-items: center;
}

.spacer {
  flex: 1;
}

.test-btn {
  background-color: var(--color-warning-bg);
  color: var(--color-accent);
  border: 1px solid rgba(37, 99, 235, 0.2);
  width: auto;
}
.test-btn:hover {
  background-color: rgba(37, 99, 235, 0.25);
}

.sec-btn {
  background-color: transparent;
  color: var(--text-muted);
  width: auto;
}
.sec-btn:hover {
  background-color: rgba(255,255,255,0.05);
  color: var(--text-main);
}

.action-save-btn {
  background-color: var(--color-primary);
  color: #fff;
  width: auto;
}
.action-save-btn:hover {
  background-color: #1d4ed8;
}

/* Dropdown Menu Items */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  background-color: var(--bg-card);
  min-width: 180px;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.5);
  z-index: 1;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-color);
  margin-top: 4px;
}

.dropdown-content a {
  color: var(--text-main);
  padding: 10px 14px;
  text-decoration: none;
  display: block;
  font-size: 11px;
}

.dropdown-content a:hover {
  background-color: rgba(255,255,255,0.05);
}

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

.show {
  display: block !important;
}

/* Download action button style */
.download-action-btn {
  background-color: var(--color-warning-bg) !important;
  color: var(--color-accent) !important;
  border: 1px solid rgba(37, 99, 235, 0.25) !important;
}
.download-action-btn:hover:not(:disabled) {
  background-color: rgba(37, 99, 235, 0.35) !important;
}

/* Highlight selected row */
.file-table tbody tr.selected {
  background-color: rgba(37, 99, 235, 0.15) !important;
  border-left: 3px solid var(--color-accent);
}

.history-item.selected {
  background-color: rgba(37, 99, 235, 0.15) !important;
  border-color: var(--color-accent) !important;
}

/* Explorer inline thumbnails */
.explorer-thumb {
  width: 24px;
  height: 24px;
  border-radius: var(--border-radius-sm);
  background-color: rgba(255,255,255,0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 8px;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  flex-shrink: 0;
  overflow: hidden;
}
.explorer-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.explorer-emoji {
  font-size: 14px;
}
.explorer-text-thumb {
  font-size: 7px;
  font-weight: 800;
  color: var(--text-light-blue);
  text-transform: uppercase;
}
.folder-thumb { border-color: rgba(248, 215, 127, 0.4); }
.image-thumb { border-color: rgba(74, 222, 128, 0.4); }
.video-thumb { border-color: rgba(96, 165, 250, 0.4); }
.audio-thumb { border-color: rgba(244, 63, 94, 0.4); }
.generic-thumb { border-color: var(--border-color); }

/* ── DESKTOP-STYLE SPLASH SCREEN OVERLAY ── */
.splash-screen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at center, #1e293b 0%, #0b0f19 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 1;
  transition: opacity 0.5s ease;
}
.splash-screen-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}
.splash-card {
  width: 440px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.splash-logo-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.splash-logo-img {
  width: 56px;
  height: 56px;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 12px rgba(37, 99, 235, 0.6));
  animation: pulse-glow 2s infinite ease-in-out;
}
@keyframes pulse-glow {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 12px rgba(37, 99, 235, 0.5)); }
  50% { transform: scale(1.05); filter: drop-shadow(0 0 20px rgba(96, 165, 250, 0.8)); }
}
.splash-title {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
}
.splash-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}
.splash-steps-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(0, 0, 0, 0.25);
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}
.splash-step-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
  transition: all 0.2s ease;
}
.splash-step-item.running {
  color: var(--color-accent);
  font-weight: 500;
}
.splash-step-item.completed {
  color: #3FB950;
}
.splash-step-item.failed {
  color: #F85149;
}
.splash-progress-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.splash-progress-bar {
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  overflow: hidden;
}
.splash-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2563EB, #60A5FA);
  border-radius: 4px;
  transition: width 0.3s ease;
}
.splash-status-text {
  font-size: 11px;
  color: var(--text-light-blue);
  text-align: center;
  font-family: var(--font-mono);
}

/* ── PROFESSIONAL LOGIN MODAL OVERLAY ── */
.login-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 8, 15, 0.85);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.login-card {
  width: 420px;
  background: #161B22;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.7);
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.login-header {
  text-align: center;
}
.login-logo-img {
  width: 44px;
  height: auto;
  margin-bottom: 8px;
}
.login-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}
.login-header p {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}
.city-preset-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  background: rgba(0, 0, 0, 0.2);
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.03);
}
.preset-label {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  margin-right: 4px;
}
.preset-pill {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 12px;
  background: #21262D;
  color: var(--text-main);
  border: 1px solid transparent;
}
.preset-pill:hover {
  background: var(--color-primary);
  color: #fff;
}
.preset-pill.admin-pill {
  background: rgba(248, 81, 73, 0.15);
  color: #F85149;
  border-color: rgba(248, 81, 73, 0.3);
}
.preset-pill.admin-pill:hover {
  background: #F85149;
  color: #fff;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.form-group label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-light-blue);
}
.form-group input, .form-group select {
  background: #0D1117;
  border: 1px solid var(--border-color);
  color: #fff;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  font-family: var(--font-ui);
}
.form-group input:focus, .form-group select:focus {
  border-color: var(--color-accent);
  outline: none;
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.2);
}
.login-error-msg {
  background: rgba(248, 81, 73, 0.15);
  border: 1px solid rgba(248, 81, 73, 0.4);
  color: #F85149;
  font-size: 11px;
  padding: 8px 12px;
  border-radius: 6px;
}
.login-btn {
  background: linear-gradient(135deg, #2563EB, #1d4ed8) !important;
  color: #fff !important;
  padding: 10px !important;
  font-size: 13px !important;
  border-radius: 6px !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.login-btn:hover {
  background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
}

/* Password Input Wrapper & Eye Toggle */
.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.password-input-wrapper input {
  width: 100%;
  padding-right: 36px !important;
}
.eye-toggle-btn {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.eye-toggle-btn:hover {
  color: var(--color-accent);
}

/* Login Branding Footer */
.login-footer-branding {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
  line-height: 1.4;
}
.login-footer-branding strong {
  color: var(--text-main);
}
.login-footer-branding .brand-link {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 500;
}
.login-footer-branding .brand-link:hover {
  text-decoration: underline;
}

/* ── UNIVERSAL MODAL SYSTEM ── */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 8, 15, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 1;
  pointer-events: auto;
}
.modal.open {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}
.modal-content {
  background: #161B22;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  width: 520px;
  max-width: 92vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85);
  overflow: hidden;
  position: relative;
  z-index: 100000;
  animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalPop {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0D1117;
}
.modal-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}
.modal form {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.modal-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

/* ── HEADER USER BADGES & BUTTONS ── */
.user-badge-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(37, 99, 235, 0.3);
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
}
.user-city-tag {
  background: #2563EB;
  color: #fff;
  font-weight: 700;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 8px;
  text-transform: uppercase;
}
.user-name-txt {
  color: var(--text-main);
  font-weight: 600;
}
.admin-btn {
  background: rgba(248, 81, 73, 0.15) !important;
  color: #F85149 !important;
  border: 1px solid rgba(248, 81, 73, 0.3) !important;
}
.admin-btn:hover {
  background: rgba(248, 81, 73, 0.3) !important;
}
.danger-btn {
  color: #F85149 !important;
}

/* ── ADMIN DASHBOARD MODAL ── */
.admin-modal-content {
  width: 820px !important;
  max-width: 94vw !important;
}
.admin-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-height: 75vh;
  overflow-y: auto;
  padding-right: 4px;
}
.admin-card {
  background: #0D1117;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.admin-card h4 {
  font-size: 13px;
  color: var(--color-accent);
}
.admin-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.admin-form-actions {
  grid-column: span 2;
  display: flex;
  justify-content: flex-end;
}
.admin-table th, .admin-table td {
  padding: 8px 10px;
}

/* ── ENTERPRISE UI ADDITIONS ── */
.enterprise-badge {
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  color: #93c5fd;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(147, 197, 253, 0.3);
}

.header-stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #161B22;
  border: 1px solid var(--border-color);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  color: var(--text-muted);
}
.header-stat-pill .dot-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3FB950;
  box-shadow: 0 0 6px rgba(63, 185, 80, 0.6);
}

.badge-concurrency {
  background: rgba(37, 99, 235, 0.15);
  color: #60A5FA;
  border: 1px solid rgba(96, 165, 250, 0.3);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
}

/* Explorer Live Search & Counter */
.explorer-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 320px;
  margin: 0 12px;
}
.explorer-search-input {
  width: 100%;
  background: #0D1117;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-main);
  padding: 4px 8px;
  font-size: 12px;
}
.explorer-search-input:focus {
  outline: none;
  border-color: var(--color-accent);
}
.explorer-counter-badge {
  background: #161B22;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

/* Batch Actions */
.batch-actions-box {
  display: flex;
  align-items: center;
}
.batch-btn {
  background: rgba(96, 165, 250, 0.15) !important;
  color: #60A5FA !important;
  border: 1px solid rgba(96, 165, 250, 0.4) !important;
  padding: 5px 12px !important;
  font-size: 12px !important;
  font-weight: 600;
}
.batch-btn:hover {
  background: rgba(96, 165, 250, 0.3) !important;
}

/* Auth Buttons */
.auth-pwd-btn {
  background: rgba(251, 191, 36, 0.12) !important;
  color: #FBBF24 !important;
  border: 1px solid rgba(251, 191, 36, 0.3) !important;
}
.auth-pwd-btn:hover {
  background: rgba(251, 191, 36, 0.25) !important;
}

/* Password Modal */
.pwd-modal-content {
  width: 420px !important;
  max-width: 90vw !important;
}
.child-modal {
  z-index: 100010 !important;
}
.child-modal .modal-content {
  z-index: 100020 !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95) !important;
}
.pwd-feedback-msg {
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  margin-top: 4px;
}
.pwd-feedback-msg.error {
  background: var(--color-danger-bg);
  color: #ff7b72;
  border: 1px solid var(--color-danger);
}
.pwd-feedback-msg.success {
  background: var(--color-success-bg-dark);
  color: #7ee787;
  border: 1px solid var(--color-success);
}

/* Admin Health KPI Cards */
.admin-health-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.health-kpi-card {
  background: #0D1117;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.kpi-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}
.kpi-val {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-accent);
  font-family: var(--font-mono);
}
.kpi-sub {
  font-size: 11px;
  color: var(--text-muted);
}

/* Admin DB Action Bar */
.db-action-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* User Status Badges & Action Buttons */
.status-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
}
.status-badge.active {
  background: rgba(63, 185, 80, 0.15);
  color: #3FB950;
  border: 1px solid rgba(63, 185, 80, 0.3);
}
.status-badge.blocked {
  background: rgba(248, 81, 73, 0.15);
  color: #F85149;
  border: 1px solid rgba(248, 81, 73, 0.3);
}

.table-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  cursor: pointer;
  margin-right: 4px;
}
.table-btn:hover {
  background: #21262D;
}
.btn-block {
  color: #F85149;
  border-color: rgba(248, 81, 73, 0.3);
}
.btn-unblock {
  color: #3FB950;
  border-color: rgba(63, 185, 80, 0.3);
}
.btn-edit {
  color: #60A5FA;
  border-color: rgba(96, 165, 250, 0.4);
}
.btn-edit:hover {
  background: rgba(96, 165, 250, 0.15);
}
.btn-pwd {
  color: #FBBF24;
  border-color: rgba(251, 191, 36, 0.3);
}

/* Floating Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10000;
  pointer-events: none;
}
.toast-item {
  pointer-events: auto;
  min-width: 280px;
  max-width: 400px;
  background: #161B22;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 16px;
  color: var(--text-main);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: slideInToast 0.3s ease forwards;
}
@keyframes slideInToast {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.toast-item.toast-success {
  border-left: 4px solid #3FB950;
}
.toast-item.toast-error {
  border-left: 4px solid #F85149;
}
.toast-item.toast-warning {
  border-left: 4px solid #FBBF24;
}
.toast-item.toast-info {
  border-left: 4px solid #2563EB;
}
.toast-title {
  font-weight: 600;
  font-size: 12px;
  margin-bottom: 2px;
}
.toast-body {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── ROBUST MOBILE & TABLET RESPONSIVE SYSTEM ── */
@media (max-width: 900px) {
  body {
    height: auto !important;
    min-height: 100vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  .app-header {
    height: auto !important;
    min-height: 48px;
    padding: 8px 12px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .header-left {
    flex: 1;
    min-width: 130px;
  }

  .header-center {
    order: 3;
    width: 100%;
    justify-content: space-between;
    margin-top: 4px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
  }

  .header-right {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
  }

  .user-badge-pill {
    padding: 2px 6px;
    font-size: 11px;
  }

  .app-layout {
    flex-direction: column !important;
    height: auto !important;
    min-height: calc(100vh - 48px);
    overflow: visible !important;
  }

  .sidebar-panel {
    width: 100% !important;
    min-width: 100% !important;
    max-height: none !important;
    border-right: none !important;
    border-bottom: 1px solid var(--border-color);
  }

  .sidebar-panel .profile-scroll-container {
    max-height: 180px;
    overflow-y: auto;
    padding: 6px 12px;
  }

  .sidebar-panel .profile-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 6px;
    padding: 0;
  }

  .sidebar-footer {
    padding: 8px 12px;
  }

  .main-content-panel {
    padding: 10px !important;
    gap: 10px !important;
    overflow: visible !important;
    height: auto !important;
  }

  .card {
    padding: 12px;
  }

  .explorer-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .explorer-title-box {
    width: 100%;
    justify-content: space-between;
  }

  .explorer-search-box {
    width: 100%;
    margin: 0;
  }

  .explorer-search-input {
    width: 100%;
    height: 36px;
    font-size: 13px;
  }

  .explorer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    width: 100%;
  }

  .explorer-list-container {
    overflow-x: auto;
    max-height: 350px;
    -webkit-overflow-scrolling: touch;
  }

  .file-table {
    min-width: 480px;
  }

  .explorer-footer {
    flex-wrap: wrap;
    gap: 8px;
  }

  .upload-action-btn {
    width: 100%;
    min-height: 42px;
    font-size: 14px;
    justify-content: center;
  }

  .batch-actions-box {
    width: 100%;
  }

  .batch-btn {
    width: 100%;
    justify-content: center;
  }

  /* Modals on Tablet/Mobile */
  .modal {
    padding: 10px;
    align-items: center;
  }

  .modal-content, 
  .admin-modal-content, 
  .child-modal .modal-content {
    width: 96% !important;
    max-width: 96vw !important;
    min-width: unset !important;
    max-height: 90vh !important;
    padding: 14px !important;
    margin: auto !important;
    overflow-y: auto !important;
  }

  .admin-health-row {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)) !important;
    gap: 8px !important;
  }

  .admin-form-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .db-action-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  .db-action-bar button, 
  .db-action-bar a {
    width: 100% !important;
    text-align: center;
    justify-content: center;
  }

  .admin-table {
    min-width: 500px;
  }

  .login-card {
    width: 92%;
    max-width: 360px;
    padding: 20px 16px;
    margin: auto;
  }

  .splash-card {
    width: 92%;
    max-width: 380px;
    padding: 24px 16px;
  }

  /* History Drawer on Tablet/Mobile */
  .history-panel {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: 360px !important;
    min-width: unset !important;
    z-index: 1000 !important;
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.7) !important;
    height: 100vh !important;
    transition: transform 0.3s cubic-bezier(0.1, 0.9, 0.2, 1) !important;
  }

  .history-panel.collapsed {
    transform: translateX(100%) !important;
    width: 0 !important;
    max-width: 0 !important;
    display: none !important;
  }

  .toast-container {
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
  }

  .toast-item {
    width: 100%;
    min-width: unset;
  }
}

@media (max-width: 600px) {
  .app-header {
    padding: 6px 10px;
  }

  .app-title {
    font-size: 12px;
  }

  .enterprise-badge {
    font-size: 8px;
    padding: 1px 4px;
  }

  .header-right .icon-btn {
    padding: 4px 8px;
    font-size: 11px;
  }

  .header-stat-pill {
    font-size: 10px;
  }

  .connection-status-pill {
    padding: 2px 8px;
  }

  .profile-list {
    grid-template-columns: 1fr !important;
  }

  .queue-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 8px;
  }

  .queue-item-header {
    width: 100%;
    justify-content: space-between;
  }

  .log-console {
    height: 120px;
    max-height: 150px;
    font-size: 10px;
    padding: 6px;
  }

  .login-card h2 {
    font-size: 18px;
  }

  .form-group input, 
  .form-group select {
    font-size: 14px;
    min-height: 40px;
  }
}


