/* ==========================================================================
   MTech File Hub — Redesign (identity synced with login page)
   ========================================================================== */

:root {
  /* ── Palette (synced with login) ──────────────────────────── */
  --bg:           #0B0D12;
  --surface:      #11141B;
  --surface-elev: #171A23;
  --surface-hover:#1C202B;
  --border:       rgba(255,255,255,0.07);
  --border-strong:rgba(255,255,255,0.12);
  --text:         #F5F7FA;
  --text-sec:     #8B93A7;
  --text-muted:   #4A5064;
  --primary:      #4F7CFF;
  --primary-h:    #638CFF;
  --primary-glow: rgba(79,124,255,0.18);
  --primary-bg:   rgba(79,124,255,0.14);
  --success:      #38C976;
  --warning:      #F5B84B;
  --danger:       #EF5A67;
  --radius:       10px;
  --radius-sm:    6px;
  --radius-lg:    14px;
  --font:         'Inter', system-ui, -apple-system, sans-serif;
  --transition:   180ms ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%; width: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }

.hidden { display: none !important; }

/* ── App Shell ──────────────────────────────────────────────── */
.app-shell {
  display: flex; flex-direction: column;
  height: 100vh; width: 100vw;
  background: var(--bg);
}

/* ── Header ─────────────────────────────────────────────────── */
.app-header {
  display: flex; align-items: center;
  height: 50px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  gap: 10px;
  flex-shrink: 0;
}

.app-logo {
  display: flex; align-items: center; gap: 9px;
  font-weight: 700; font-size: 14px;
  color: var(--text); letter-spacing: -0.01em;
  padding-right: 14px;
  border-right: 1px solid var(--border);
  text-decoration: none;
  flex-shrink: 0;
}
.app-logo svg { width: 20px; height: 20px; }
.app-logo span { opacity: 0.5; font-weight: 400; }

.app-tabs {
  display: flex; align-items: flex-end;
  height: 100%; gap: 2px;
  flex: 1; min-width: 0; overflow-x: auto;
}
.app-tab {
  display: flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 12px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: transparent; color: var(--text-sec);
  font-size: 12px; cursor: pointer;
  border: 1px solid transparent; border-bottom: 0;
  max-width: 190px; transition: background var(--transition), color var(--transition);
  white-space: nowrap; flex-shrink: 0;
}
.app-tab:hover { background: var(--surface-hover); color: var(--text); }
.app-tab.active {
  background: var(--bg); color: var(--text);
  border-color: var(--border); font-weight: 500;
}
.app-tab.active::after {
  content: ''; position: absolute;
  bottom: -1px; left: 0; right: 0; height: 1px; background: var(--bg);
}
.app-tab-icon { width: 14px; height: 14px; opacity: 0.7; flex-shrink: 0; }
.app-tab-title { overflow: hidden; text-overflow: ellipsis; flex: 1; }
.app-tab-close {
  display: flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: var(--radius-sm);
  font-size: 10px; color: var(--text-muted); opacity: 0;
  transition: opacity var(--transition);
}
.app-tab:hover .app-tab-close { opacity: 1; }
.app-tab-close:hover { background: rgba(255,255,255,0.1); color: #fff; }

.btn-tab-add {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: var(--radius);
  background: transparent; border: 0; color: var(--text-muted);
  font-size: 20px; cursor: pointer; transition: background var(--transition);
  flex-shrink: 0;
}
.btn-tab-add:hover { background: var(--surface-hover); color: var(--text); }

.header-spacer { flex: 1; }

.user-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px; border-radius: var(--radius);
  background: var(--surface-elev); border: 1px solid var(--border);
  font-size: 12px; color: var(--text-sec); cursor: default;
}
.user-pill strong { color: var(--text); font-weight: 600; }

.btn-ghost {
  display: flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px;
  border-radius: var(--radius);
  background: transparent; border: 1px solid var(--border);
  color: var(--text-sec);
  font-size: 12.5px; font-family: inherit; font-weight: 500;
  cursor: pointer; transition: all var(--transition);
}
.btn-ghost:hover { background: var(--surface-hover); color: var(--text); border-color: var(--border-strong); }

/* ── Toolbar ────────────────────────────────────────────────── */
.app-toolbar {
  display: flex; align-items: center;
  height: 44px;
  background: var(--surface);
  padding: 0 12px;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.toolbar-group { display: flex; align-items: center; gap: 3px; }
.toolbar-sep { width: 1px; height: 20px; background: var(--border); margin: 0 8px; }
.toolbar-spacer { flex: 1; }

.btn-tool {
  display: flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 11px;
  border-radius: var(--radius-sm);
  background: transparent; border: 0;
  color: var(--text); font-size: 12.5px; font-family: inherit; font-weight: 500;
  cursor: pointer; transition: background var(--transition);
  white-space: nowrap;
}
.btn-tool:hover { background: var(--surface-hover); }
.btn-tool:active { background: rgba(255,255,255,0.05); }
.btn-tool.primary {
  background: var(--primary); color: #fff;
  box-shadow: 0 2px 8px var(--primary-glow);
}
.btn-tool.primary:hover { background: var(--primary-h); }
.btn-tool.icon-only { padding: 0 8px; min-width: 32px; justify-content: center; }
.btn-tool:disabled, .btn-tool.disabled { opacity: 0.25; cursor: default; pointer-events: none; }
.btn-tool svg { width: 15px; height: 15px; stroke: currentColor; flex-shrink: 0; }
.btn-arrow { width: 10px; height: 10px; margin-left: -1px; stroke: var(--text-muted); flex-shrink: 0; }

/* Dropdowns */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 5px); left: 0;
  background: var(--surface-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 5px;
  min-width: 190px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  z-index: 100; display: none;
}
.dropdown.open .dropdown-menu { display: block; animation: fhFade 0.12s ease-out; }
.dropdown-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  font-size: 12.5px; color: var(--text);
  cursor: pointer; transition: background var(--transition);
}
.dropdown-item:hover { background: var(--surface-hover); }
.dropdown-item.active { background: var(--primary-bg); color: var(--primary); font-weight: 500; }
.dropdown-item .di-icon { width: 15px; height: 15px; flex-shrink: 0; }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ── Address / Breadcrumb Bar ───────────────────────────────── */
.app-address-row {
  display: flex; align-items: center;
  height: 42px;
  background: var(--bg);
  padding: 0 12px;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.nav-arrows { display: flex; align-items: center; gap: 2px; }
.btn-nav {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  background: transparent; border: 0; color: var(--text-sec);
  cursor: pointer; transition: background var(--transition);
}
.btn-nav:hover { background: var(--surface-hover); color: var(--text); }
.btn-nav:disabled, .btn-nav.disabled { opacity: 0.2; cursor: default; pointer-events: none; }
.btn-nav svg { width: 14px; height: 14px; stroke: currentColor; }

.address-bar {
  display: flex; align-items: center;
  flex: 1; height: 32px;
  background: var(--surface-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 10px; gap: 7px;
  transition: border-color var(--transition);
  overflow: hidden;
}
.address-bar:focus-within { border-color: var(--primary); }

.addr-icon { width: 14px; height: 14px; flex-shrink: 0; opacity: 0.5; }

.breadcrumbs {
  display: flex; align-items: center; gap: 2px;
  flex: 1; overflow-x: auto; white-space: nowrap; font-size: 12.5px;
}
.crumb {
  display: flex; align-items: center; gap: 3px;
  padding: 2px 7px; border-radius: var(--radius-sm);
  color: var(--text); cursor: pointer;
  transition: background var(--transition);
}
.crumb:hover { background: var(--surface-hover); }
.crumb.current { font-weight: 600; }
.crumb-device { color: var(--primary); }
.crumb-sep { color: var(--text-muted); font-size: 10px; padding: 0 1px; }

.addr-input {
  flex: 1; height: 100%; background: transparent;
  border: 0; color: var(--text);
  font-family: 'JetBrains Mono', 'Cascadia Code', monospace;
  font-size: 12px; outline: none; padding: 0 2px;
}

.addr-copy-btn {
  display: flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: var(--radius-sm);
  background: transparent; border: 0;
  color: var(--text-muted); cursor: pointer; flex-shrink: 0;
  transition: background var(--transition), color var(--transition);
}
.addr-copy-btn:hover { background: var(--surface-hover); color: var(--text); }

.search-box {
  display: flex; align-items: center;
  width: 260px; height: 32px;
  background: var(--surface-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 10px; gap: 7px;
  transition: border-color var(--transition);
  flex-shrink: 0;
}
.search-box:focus-within { border-color: var(--primary); }
.search-icon { width: 13px; height: 13px; stroke: var(--text-muted); flex-shrink: 0; }
.search-input {
  flex: 1; background: transparent; border: 0;
  color: var(--text); font-family: inherit;
  font-size: 12.5px; outline: none;
}
.search-input::placeholder { color: var(--text-muted); }
.search-clear {
  background: transparent; border: 0; color: var(--text-muted);
  font-size: 11px; cursor: pointer; padding: 1px 4px; border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}
.search-clear:hover { background: var(--surface-hover); color: var(--text); }

/* ── Body: sidebar + content ────────────────────────────────── */
.app-body {
  display: flex; flex: 1; min-height: 0; overflow: hidden;
}

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  width: 230px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 12px 8px;
  gap: 4px;
  overflow-y: auto;
  flex-shrink: 0;
}

.sidebar-section-title {
  padding: 8px 10px 5px;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: space-between;
}

.sidebar-refresh {
  background: transparent; border: 0;
  color: var(--text-muted); font-size: 13px;
  cursor: pointer; padding: 2px 5px; border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}
.sidebar-refresh:hover { background: var(--surface-hover); color: var(--text); }

.sidebar-group { display: flex; flex-direction: column; gap: 1px; }

.sidebar-item {
  display: flex; align-items: center; gap: 10px;
  height: 34px; padding: 0 10px;
  border-radius: var(--radius-sm);
  color: var(--text-sec); font-size: 12.5px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  position: relative;
}
.sidebar-item:hover { background: var(--surface-hover); color: var(--text); }
.sidebar-item.active { background: var(--primary-bg); color: var(--primary); font-weight: 500; }
.sidebar-item.active::before {
  content: ''; position: absolute; left: 0;
  top: 7px; bottom: 7px; width: 2px;
  border-radius: 1px; background: var(--primary);
}
.sidebar-icon { width: 16px; height: 16px; flex-shrink: 0; }
.sidebar-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success); margin-left: auto; flex-shrink: 0;
}
.sidebar-dot.offline { background: var(--text-muted); }

.sidebar-empty {
  padding: 8px 10px; font-size: 11.5px; color: var(--text-muted);
  font-style: italic;
}

/* ── Content pane ───────────────────────────────────────────── */
.content-pane {
  flex: 1; display: flex; flex-direction: column;
  background: var(--bg);
  position: relative; overflow: hidden; min-width: 0;
}

/* ── Details View (Table) ───────────────────────────────────── */
.view-details { flex: 1; overflow-y: auto; padding: 2px 0; }

.file-table { width: 100%; border-collapse: collapse; table-layout: fixed; }

.file-table thead th {
  text-align: left; padding: 8px 14px;
  font-size: 11px; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky; top: 0; z-index: 10;
  cursor: pointer; user-select: none;
  transition: color var(--transition);
}
.file-table thead th:hover { color: var(--text-sec); }
.file-table thead th .sort-indicator { font-size: 8px; margin-left: 3px; }

.file-table .col-name  { width: auto; min-width: 200px; }
.file-table .col-date  { width: 150px; }
.file-table .col-type  { width: 150px; }
.file-table .col-size  { width: 90px; text-align: right; padding-right: 18px; }

.file-row {
  height: 36px; cursor: pointer;
  transition: background var(--transition);
}
.file-row:hover { background: rgba(255,255,255,0.025); }
.file-row.selected { background: var(--primary-bg); }
.file-row.selected td:first-child { border-left: 2px solid var(--primary); padding-left: 12px; }

.file-row td {
  padding: 6px 14px;
  font-size: 12.5px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.file-row td.col-date,
.file-row td.col-type { color: var(--text-sec); }
.file-row td.col-size { text-align: right; padding-right: 18px; color: var(--text-sec); }

.file-name-cell { display: flex; align-items: center; gap: 9px; }
.file-row-icon { width: 16px; height: 16px; flex-shrink: 0; }
.file-row-name { overflow: hidden; text-overflow: ellipsis; }

/* Skeleton loading rows */
.skeleton-row td { padding: 6px 14px; }
.skeleton-cell {
  height: 12px; border-radius: 3px;
  background: linear-gradient(90deg, var(--surface-elev) 25%, var(--surface-hover) 50%, var(--surface-elev) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.4s ease-in-out infinite;
}
.skeleton-cell.wide { width: 60%; }
.skeleton-cell.mid  { width: 40%; }
.skeleton-cell.short{ width: 20%; }
@keyframes skeleton { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ── Grid View ──────────────────────────────────────────────── */
.view-grid { flex: 1; overflow-y: auto; padding: 16px; }
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}
.grid-item {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  height: 110px; padding: 12px 8px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer; text-align: center;
  transition: all var(--transition);
}
.grid-item:hover { background: var(--surface-hover); border-color: var(--border-strong); transform: translateY(-1px); }
.grid-item.selected { background: var(--primary-bg); border-color: rgba(79,124,255,0.35); }
.grid-icon { width: 42px; height: 42px; margin-bottom: 8px; }
.grid-name {
  font-size: 11.5px; color: var(--text);
  word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.grid-meta {
  font-size: 10px; color: var(--text-muted); margin-top: 3px;
}

/* ── Drives View ────────────────────────────────────────────── */
/* ── Drives View ────────────────────────────────────────────── */
.view-drives { flex: 1; overflow-y: auto; padding: 20px; }
.drives-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
}
.drive-card {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-hover) 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 14px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex; flex-direction: column;
  align-items: center; text-align: center; gap: 6px;
  position: relative; overflow: hidden;
}
.drive-card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(79,124,255,0.05), transparent);
  opacity: 0; transition: opacity 0.2s;
}
.drive-card:hover { background: var(--surface-hover); border-color: var(--border-strong); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
.drive-card:hover::before { opacity: 1; }
.drive-card-icon { width: 44px; height: 44px; flex-shrink: 0; position: relative; z-index: 1; }
.drive-card-name { font-size: 14px; font-weight: 700; color: var(--text); position: relative; z-index: 1; }
.drive-card-label { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; max-width: 100%; }
.drive-card-fs { font-size: 10px; color: var(--primary); background: var(--primary-bg); border: 1px solid rgba(79,124,255,0.2); border-radius: var(--radius-sm); padding: 1px 6px; position: relative; z-index: 1; }
.drive-card-space { font-size: 10.5px; color: var(--text-muted); position: relative; z-index: 1; }
.drive-card-bar-track {
  width: 100%; height: 4px;
  background: var(--border); border-radius: 2px;
  overflow: hidden; margin-top: 4px;
  position: relative; z-index: 1;
}
.drive-card-bar-fill { height: 100%; border-radius: 2px; transition: width 0.4s ease; }

/* ── Empty State ────────────────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  height: 100%; padding: 40px;
  color: var(--text-muted);
}
.empty-icon { width: 56px; height: 56px; margin-bottom: 14px; opacity: 0.3; }
.empty-text { font-size: 14px; font-weight: 500; color: var(--text-sec); margin-bottom: 5px; }
.empty-sub  { font-size: 12px; color: var(--text-muted); margin-bottom: 20px; }
.empty-actions { display: flex; gap: 10px; }
.empty-actions .btn-tool { height: 34px; }

/* ── Drop Overlay ───────────────────────────────────────────── */
.drop-overlay {
  position: absolute; inset: 10px;
  background: rgba(11,13,18,0.92);
  border: 2px dashed var(--primary);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  z-index: 50; backdrop-filter: blur(6px);
  animation: fhFade 0.15s ease-out;
}
.drop-card {
  display: flex; flex-direction: column;
  align-items: center; gap: 10px;
  padding: 28px 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.drop-icon { width: 32px; height: 32px; stroke: var(--primary); }
.drop-title { font-size: 14px; font-weight: 600; color: var(--text); }
.drop-dest  { font-size: 12px; color: var(--primary); }

/* ── Status Bar ─────────────────────────────────────────────── */
.status-bar {
  display: flex; align-items: center;
  justify-content: space-between;
  height: 28px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 0 14px;
  font-size: 11px; color: var(--text-muted);
  flex-shrink: 0;
}
.status-left { display: flex; align-items: center; gap: 10px; }
.status-sep { color: var(--border); }
.status-right { display: flex; align-items: center; gap: 3px; }
.btn-view-mode {
  display: flex; align-items: center; justify-content: center;
  width: 22px; height: 20px;
  background: transparent; border: 0;
  color: var(--text-muted); border-radius: var(--radius-sm); cursor: pointer;
  transition: all var(--transition);
}
.btn-view-mode:hover { background: var(--surface-hover); color: var(--text); }
.btn-view-mode.active { background: var(--primary-bg); color: var(--primary); }
.btn-view-mode svg { width: 12px; height: 12px; }

/* ── Context Menu ───────────────────────────────────────────── */
.ctx-menu {
  position: fixed;
  background: var(--surface-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 5px;
  min-width: 200px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  z-index: 200;
  animation: fhFade 0.1s ease-out;
}
.ctx-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  font-size: 12.5px; color: var(--text);
  cursor: pointer; transition: background var(--transition);
}
.ctx-item:hover { background: var(--surface-hover); }
.ctx-item.danger:hover { background: rgba(239,90,103,0.12); color: var(--danger); }
.ctx-item:disabled { opacity: 0.25; cursor: default; }
.ctx-icon { width: 14px; height: 14px; stroke: currentColor; flex-shrink: 0; }
.ctx-shortcut { margin-left: auto; font-size: 10.5px; color: var(--text-muted); }
.ctx-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ── Transfer Widget ────────────────────────────────────────── */
.transfer-widget {
  position: fixed; bottom: 36px; right: 16px;
  width: 330px;
  background: var(--surface-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
  z-index: 150; overflow: hidden;
  animation: fhSlideUp 0.2s ease-out;
}
.transfer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.transfer-title { font-size: 12px; font-weight: 600; }
.transfer-close {
  background: transparent; border: 0;
  color: var(--text-muted); cursor: pointer;
  font-size: 12px; padding: 2px 6px; border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}
.transfer-close:hover { background: var(--surface-hover); color: var(--text); }
.transfer-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.transfer-filename {
  font-size: 11.5px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.transfer-bar-track {
  height: 4px; background: var(--bg);
  border-radius: 2px; overflow: hidden;
}
.transfer-bar-fill {
  height: 100%; background: var(--primary);
  border-radius: 2px; transition: width 0.2s ease-out;
}
.transfer-meta {
  display: flex; justify-content: space-between;
  font-size: 10.5px; color: var(--text-muted);
}

/* ── Modals ─────────────────────────────────────────────────── */
.modal-back {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  display: grid; place-items: center;
  z-index: 300; padding: 20px;
  animation: fhFade 0.12s ease-out;
}
.modal {
  width: 100%; max-width: 620px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 22px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 28px 70px rgba(0,0,0,0.6);
  display: flex; flex-direction: column; gap: 14px;
}
.modal h2 { font-size: 15px; font-weight: 600; color: var(--text); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

.props-dialog { max-width: 370px; }
.props-header {
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.props-icon { width: 40px; height: 40px; }
.props-name-input {
  flex: 1; font-size: 13px; font-weight: 600;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 6px 10px; color: var(--text);
  outline: none; transition: border-color var(--transition);
}
.props-name-input:focus { border-color: var(--primary); }
.props-grid {
  display: grid; grid-template-columns: 90px 1fr;
  gap: 8px 12px; font-size: 12px; padding: 8px 0;
}
.props-label { color: var(--text-muted); }
.props-val { color: var(--text); word-break: break-all; }

.modal-tabs {
  display: flex; gap: 2px;
  border-bottom: 1px solid var(--border); padding-bottom: 0;
}
.modal-tabs button {
  background: transparent; color: var(--text-muted);
  border: 0; border-bottom: 2px solid transparent;
  border-radius: 0; padding: 9px 15px;
  font-size: 12.5px; cursor: pointer; font-family: inherit;
  transition: color var(--transition), border-color var(--transition);
}
.modal-tabs button:hover { color: var(--text); }
.modal-tabs button.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.field label { font-size: 11.5px; color: var(--text-muted); }
input, select, textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  color: var(--text); font-family: inherit; font-size: 12.5px;
  outline: none; transition: border-color var(--transition);
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); }

.btn-primary {
  background: var(--primary); color: #fff;
  font-weight: 600; border: 0;
  border-radius: var(--radius-sm); padding: 8px 16px;
  font-size: 12.5px; cursor: pointer; font-family: inherit;
  transition: background var(--transition);
}
.btn-primary:hover { background: var(--primary-h); }
.btn-secondary {
  background: transparent; border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius-sm);
  padding: 8px 16px; font-size: 12.5px; cursor: pointer; font-family: inherit;
  transition: all var(--transition);
}
.btn-secondary:hover { background: var(--surface-hover); }
.btn-danger {
  background: transparent;
  border: 1px solid rgba(239,90,103,0.35);
  color: var(--danger); border-radius: var(--radius-sm);
  padding: 8px 16px; font-size: 12.5px; cursor: pointer; font-family: inherit;
  transition: all var(--transition);
}
.btn-danger:hover { background: rgba(239,90,103,0.1); }

.list-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 12px; border-radius: var(--radius);
  background: var(--surface-elev);
  margin-bottom: 7px; border: 1px solid var(--border);
}
.list-row .meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.list-row .actions { display: flex; gap: 6px; }
.list-row .actions button { padding: 5px 11px; font-size: 11px; }

/* ── Animations ─────────────────────────────────────────────── */
@keyframes fhFade {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes fhSlideUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .search-box { width: 160px; }
  .app-header { padding: 0 10px; gap: 6px; }
  .app-toolbar { padding: 0 8px; }
}
