/* ═══════════════════════════════════════════════════════════════
   MachinaCAM Web — Design System
   Dark Glassmorphism / Industrial CNC Theme
═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Tokens ──────────────────────────────────────────────────── */
:root {
  --bg-900:      #f4f6fb;
  --bg-800:      #ffffff;
  --bg-700:      #f8fafc;
  --bg-600:      #e2e8f0;
  --bg-500:      #cbd5e1;

  --accent:      #0e5ffd;
  --accent-dim:  #0043ce;
  --accent-glow: rgba(14, 95, 253, 0.08);
  --green:       #10b981;
  --green-dim:   #047857;
  --yellow:      #d97706;
  --red:         #ef4444;
  --orange:      #f97316;

  --text-100:    #0f172a;
  --text-200:    #334155;
  --text-300:    #64748b;
  --text-400:    #94a3b8;

  --border:      rgba(15, 23, 42, 0.08);
  --border-hl:   rgba(14, 95, 253, 0.25);

  --glass:       rgba(255, 255, 255, 0.75);
  --glass-hover: rgba(255, 255, 255, 0.9);

  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   18px;
  --radius-xl:   24px;

  --shadow-sm:   0 2px 8px rgba(15,23,42,0.03);
  --shadow-md:   0 4px 20px rgba(15,23,42,0.05);
  --shadow-lg:   0 10px 30px rgba(15,23,42,0.08);
  --shadow-glow: 0 0 20px rgba(14,95,253,0.08);

  --trans:       0.2s ease;
  --trans-fast:  0.12s ease;

  --sidebar-w:   260px;
  --topbar-h:    60px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-900);
  color: var(--text-100);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: opacity var(--trans); }
a:hover { opacity: 0.8; }

/* ── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-800); }
::-webkit-scrollbar-thumb { background: var(--bg-500); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-dim); }

/* ── Typography ──────────────────────────────────────────────── */
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; line-height: 1.2; color: var(--text-100); }
h2 { font-size: clamp(1.3rem, 3vw, 1.8rem); font-weight: 700; color: var(--text-100); }
h3 { font-size: 1.1rem; font-weight: 600; color: var(--text-100); }
h4 { font-size: 0.95rem; font-weight: 600; color: var(--text-200); }
p  { color: var(--text-200); }

.mono { font-family: 'JetBrains Mono', monospace; }

/* ── Glass Card ──────────────────────────────────────────────── */
.card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  backdrop-filter: blur(12px);
  transition: border-color var(--trans), box-shadow var(--trans);
}
.card:hover { border-color: var(--border-hl); box-shadow: var(--shadow-glow); }
.card-sm { padding: 0.75rem; border-radius: var(--radius-md); }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border: none; border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif; font-size: 0.875rem; font-weight: 600;
  cursor: pointer; transition: all var(--trans); white-space: nowrap;
  text-decoration: none;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  color: #000;
  box-shadow: 0 0 16px rgba(0,212,255,0.35);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 0 28px rgba(0,212,255,0.5);
}

.btn-success {
  background: linear-gradient(135deg, var(--green), var(--green-dim));
  color: #000;
  box-shadow: 0 0 16px rgba(0,230,118,0.3);
}
.btn-success:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 0 28px rgba(0,230,118,0.45); }

.btn-danger {
  background: rgba(255,82,82,0.12);
  color: var(--red);
  border: 1px solid rgba(255,82,82,0.3);
}
.btn-danger:hover:not(:disabled) { background: rgba(255,82,82,0.2); }

.btn-ghost {
  background: var(--glass);
  color: var(--text-200);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) { background: var(--glass-hover); color: var(--text-100); border-color: var(--border-hl); }

.btn-icon {
  padding: 0.5rem; aspect-ratio: 1;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-200);
  font-size: 1rem;
}
.btn-icon:hover { background: var(--glass-hover); color: var(--accent); border-color: var(--border-hl); }

.btn-lg { padding: 0.85rem 1.8rem; font-size: 1rem; border-radius: var(--radius-md); }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }

/* ── Forms ───────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group label { font-size: 0.8rem; font-weight: 600; color: var(--text-200); text-transform: uppercase; letter-spacing: 0.05em; }

.form-control {
  background: var(--bg-700);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-100);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  padding: 0.65rem 0.9rem;
  transition: border-color var(--trans), box-shadow var(--trans);
  width: 100%;
}
.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,212,255,0.12);
}
.form-control::placeholder { color: var(--text-400); }

textarea.form-control {
  resize: vertical;
  min-height: 80px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237a859e' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.2rem;
}

.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; }
.form-2col { grid-template-columns: 1fr 1fr; }

/* ── Badges ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.badge-cyan   { background: rgba(14,95,253,0.08); color: var(--accent); }
.badge-green  { background: rgba(16,185,129,0.08); color: var(--green-dim); }
.badge-yellow { background: rgba(217,119,6,0.08); color: var(--yellow); }
.badge-red    { background: rgba(239,68,68,0.08); color: var(--red); }
.badge-grey   { background: rgba(15,23,42,0.05); color: var(--text-300); }

/* ── Topbar ──────────────────────────────────────────────────── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--topbar-h);
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 1rem;
  padding: 0 1.5rem;
}
.topbar-logo {
  display: flex; align-items: center; gap: 0.6rem;
  font-weight: 800; font-size: 1.1rem; color: var(--text-100);
  white-space: nowrap;
}
.topbar-logo span { color: var(--accent); }
.topbar-logo svg { color: var(--accent); }

.topbar-nav {
  display: flex; align-items: center; gap: 0.3rem;
  flex: 1; overflow-x: auto; -ms-overflow-style: none; scrollbar-width: none;
}
.topbar-nav::-webkit-scrollbar { display: none; }

.nav-link {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem; font-weight: 500;
  color: var(--text-300);
  transition: all var(--trans);
  white-space: nowrap;
}
.nav-link:hover { background: var(--glass-hover); color: var(--text-100); }
.nav-link.active { background: rgba(0,212,255,0.12); color: var(--accent); }

.topbar-right { display: flex; align-items: center; gap: 0.75rem; margin-left: auto; }

/* ── Mobile Bottom Navigation ────────────────────────────────── */
.mobile-bottom-nav {
  display: none;
}

/* ── Main Layout ─────────────────────────────────────────────── */
.page-main {
  padding-top: var(--topbar-h);
  min-height: 100vh;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.25rem 1rem;
}

.container-wide {
  max-width: 1600px;
  margin: 0 auto;
  padding: 1.25rem 1rem;
}

/* ── Dashboard Grid ──────────────────────────────────────────── */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}

.stat-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex; align-items: center; gap: 0.75rem;
  transition: all var(--trans);
}
.stat-card:hover { border-color: var(--border-hl); transform: translateY(-2px); }
.stat-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}
.stat-icon.cyan   { background: rgba(0,212,255,0.12); color: var(--accent); }
.stat-icon.green  { background: rgba(0,230,118,0.12); color: var(--green); }
.stat-icon.yellow { background: rgba(255,215,64,0.12); color: var(--yellow); }
.stat-icon.orange { background: rgba(255,145,0,0.12); color: var(--orange); }
.stat-val { font-size: 1.4rem; font-weight: 800; line-height: 1; }
.stat-lbl { font-size: 0.78rem; color: var(--text-300); margin-top: 0.2rem; }

/* ── File Card ───────────────────────────────────────────────── */
.file-card {
  display: flex;
  flex-direction: column;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  cursor: pointer;
  transition: all var(--trans);
  position: relative;
  overflow: hidden;
}
.file-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0; transition: opacity var(--trans);
}
.file-card:hover { border-color: var(--border-hl); transform: translateY(-3px); box-shadow: var(--shadow-glow); }
.file-card:hover::before { opacity: 1; }
.file-card-icon { font-size: 1.6rem; margin-bottom: 0.4rem; }
.file-card-info { margin-bottom: 0.4rem; min-width: 0; }
.file-card-name { font-weight: 600; font-size: 0.95rem; color: var(--text-100); margin-bottom: 0.25rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-card-meta { font-size: 0.75rem; color: var(--text-300); }
.file-card-actions { display: flex; gap: 0.4rem; }

/* ── File Grid ───────────────────────────────────────────────── */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.65rem;
}

/* ── Tables ──────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-md); }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--bg-700);
  padding: 0.5rem 0.75rem;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-300);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 0.6rem 0.75rem;
  font-size: 0.875rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text-200);
}
tbody tr { transition: background var(--trans-fast); }
tbody tr:hover { background: var(--glass-hover); }
tbody tr:last-child td { border-bottom: none; }

/* ── 3-Panel Layout (file detail) ───────────────────────────── */
.panel-layout {
  display: grid;
  grid-template-columns: 320px 1fr 400px;
  gap: 0.75rem;
  height: calc(100vh - var(--topbar-h) - 2rem);
  overflow: hidden;
}
.panel { overflow-y: auto; }
.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.75rem;
}
.panel-title { font-weight: 700; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-300); }

/* ── DXF Preview ─────────────────────────────────────────────── */
.dxf-canvas-wrap {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  aspect-ratio: 16/9;
}
.dxf-canvas-wrap svg { width: 100%; height: 100%; }

/* ── G-code Viewer ───────────────────────────────────────────── */
.gcode-editor {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-100);
  padding: 1rem;
  overflow: auto;
  white-space: pre;
  line-height: 1.7;
  height: 100%;
  min-height: 300px;
  resize: none;
  width: 100%;
  outline: none;
}

.gcode-line-number { color: var(--text-400); user-select: none; margin-right: 1rem; }
.gcode-rapid  { color: #0e5ffd; font-weight: 600; }
.gcode-feed   { color: #059669; font-weight: 600; }
.gcode-arc    { color: #7c3aed; font-weight: 600; }
.gcode-comment { color: #64748b; font-style: italic; }
.gcode-spindle { color: #d97706; font-weight: 600; }

/* ── Tool Sequence Builder ───────────────────────────────────── */
.sequence-item {
  background: var(--bg-700);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  position: relative;
}
.sequence-handle {
  cursor: grab;
  color: var(--text-400);
  font-size: 1.1rem;
  margin-right: 0.5rem;
}
.sequence-number {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  background: var(--accent-dim);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  color: #000;
  flex-shrink: 0;
}

/* ── Section Headers ─────────────────────────────────────────── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap; gap: 0.5rem;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1rem 0;
}

/* ── Upload Zone ─────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--trans);
  position: relative;
}
.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-glow);
}
.upload-zone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-icon { font-size: 2.5rem; margin-bottom: 0.75rem; color: var(--accent); }
.upload-text { font-weight: 600; color: var(--text-100); margin-bottom: 0.3rem; }
.upload-hint { font-size: 0.8rem; color: var(--text-300); }

/* ── Progress / Loading ──────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.progress-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--green));
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* ── Toast ───────────────────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999;
  display: flex; flex-direction: column; gap: 0.6rem;
  pointer-events: none;
}
.toast {
  background: var(--bg-600);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.2rem;
  display: flex; align-items: center; gap: 0.75rem;
  font-size: 0.875rem; font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
  max-width: 360px;
  pointer-events: all;
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid var(--accent); }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── Modal ───────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: grid; place-items: center;
  padding: 1rem;
  animation: fadeIn 0.15s ease;
}
.modal-overlay.hidden { display: none; }
@keyframes fadeIn { from { opacity: 0; } }

.modal {
  background: var(--bg-700);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  animation: scaleIn 0.2s ease;
}
@keyframes scaleIn { from { transform: scale(0.95); opacity: 0; } }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem;
}
.modal-close {
  background: none; border: none; color: var(--text-300); font-size: 1.2rem;
  cursor: pointer; padding: 0.3rem; border-radius: var(--radius-sm);
  transition: color var(--trans);
}
.modal-close:hover { color: var(--red); }

/* ── Landing Page ────────────────────────────────────────────── */
.hero {
  padding: 0.5rem 0.5rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background:
  radial-gradient(ellipse 80% 60% at 50% -10%, rgba(0,212,255,0.12) 0%, transparent 60%),
  radial-gradient(ellipse 50% 40% at 80% 80%, rgba(0,230,118,0.06) 0%, transparent 50%);
}
.hero > * { position: relative; z-index: 1; }
.hero-badge { display: inline-flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; }
.hero-title { margin-bottom: 0.75rem; }
.hero-title span { color: var(--accent); }
.hero-sub { font-size: 1.1rem; color: var(--text-200); max-width: 580px; margin: 0 auto 1.5rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.features-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.4rem;
  padding: 1.25rem 1rem;
  max-width: 1400px; margin: 0 auto;
}
.feature-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  text-align: center;
  transition: all var(--trans);
}
.feature-card:hover { border-color: var(--border-hl); transform: translateY(-4px); }
.feature-icon { font-size: 1.4rem; margin-bottom: 0.3rem; }
.feature-title { font-weight: 700; font-size: 0.95rem; margin-bottom: 0.25rem; }
.feature-desc { font-size: 0.78rem; line-height: 1.4; color: var(--text-200); }

/* ── Auth Pages ──────────────────────────────────────────────── */
.auth-wrap {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 2rem;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(0,212,255,0.08) 0%, transparent 60%),
    var(--bg-900);
}
.auth-card {
  width: 100%; max-width: 440px;
  background: var(--bg-700);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
}
.auth-logo { text-align: center; margin-bottom: 2rem; }
.auth-logo h1 { font-size: 1.5rem; }
.auth-logo h1 span { color: var(--accent); }
.auth-subtitle { color: var(--text-300); font-size: 0.875rem; text-align: center; margin-bottom: 2rem; }
.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.auth-footer { text-align: center; margin-top: 1.5rem; font-size: 0.875rem; color: var(--text-300); }

/* ── Inline Loader ───────────────────────────────────────────── */
.loading-overlay {
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(4px);
  display: grid; place-items: center;
  border-radius: inherit;
  z-index: 10;
}
.loading-overlay.hidden { display: none; }

.admin-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.5rem;
  align-items: start;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .panel-layout { grid-template-columns: 1fr; height: auto; }
  .topbar-nav .nav-link span:not(.icon) { display: inline; font-size: 0.78rem; }
  .admin-grid { grid-template-columns: 1fr !important; }
  .features-grid { grid-template-columns: repeat(3, 1fr) !important; }
}

@media (max-width: 640px) {
  :root { --topbar-h: 50px; }
  .container, .container-wide { padding: 0.75rem; }
  .auth-card { padding: 1.75rem; }
  .form-row { grid-template-columns: 1fr; }
  .hero { padding: 4rem 1rem 2.25rem; }
  .features-grid { grid-template-columns: 1fr !important; padding: 1.25rem 1rem !important; }
  
  /* Topbar Mobile Adjustments */
  .topbar {
    padding: 0 0.5rem !important;
    gap: 0.25rem !important;
    height: var(--topbar-h) !important;
  }
  .topbar-logo {
    font-size: 0.9rem !important;
    gap: 0.25rem !important;
  }
  .topbar-logo svg {
    width: 16px;
    height: 16px;
  }
  /* Hide the topbar navigation links on mobile */
  .topbar-nav {
    display: none !important;
  }
  
  /* Add padding-bottom to page-main on mobile to not clip content behind the bottom bar */
  .page-main {
    padding-bottom: 70px !important;
  }

  /* Mobile Bottom Navigation Bar */
  .mobile-bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px) saturate(180%);
    border-top: 1px solid var(--border);
    z-index: 9999;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    justify-content: space-around;
    align-items: center;
    padding: 0 0.5rem;
  }
  .mobile-bottom-nav .nav-link {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.15rem !important;
    font-size: 0.65rem !important;
    color: var(--text-300) !important;
    background: none !important;
    border-radius: 0 !important;
    padding: 0.25rem 0 !important;
    flex: 1;
    height: 100%;
    box-shadow: none !important;
    transform: none !important;
  }
  .mobile-bottom-nav .nav-link.active {
    color: var(--accent) !important;
  }
  .mobile-bottom-nav .nav-link svg {
    margin: 0 !important;
  }
  .topbar-right {
    gap: 0.3rem !important;
  }
  .topbar-right .text-sm {
    display: none !important; /* Hide username string to save space */
  }
  .topbar-right .user-avatar {
    width: 24px !important;
    height: 24px !important;
    font-size: 0.7rem !important;
  }
  .topbar-right .admin-badge {
    font-size: 0.6rem !important;
    padding: 0.1rem 0.3rem !important;
  }
  #btn-login-top, #btn-register-top {
    padding: 0.25rem 0.5rem !important;
    font-size: 0.72rem !important;
  }

  /* Compact Dashboard Stats (Card-Visit Style) */
  .dash-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 0.5rem !important; }
  .dash-grid > .stat-card:nth-child(3) { grid-column: span 2; }
  .stat-card { padding: 0.6rem 0.75rem !important; gap: 0.6rem !important; }
  .stat-icon { width: 32px !important; height: 32px !important; font-size: 1rem !important; }
  .stat-val { font-size: 1.1rem !important; }
  .stat-lbl { font-size: 0.7rem !important; margin-top: 0.05rem !important; }

  /* Compact File Grid (Card-Visit / Business Card Style) */
  .file-grid { grid-template-columns: 1fr; gap: 0.6rem; }
  .file-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.85rem;
    gap: 0.6rem;
  }
  .file-card::before {
    height: 100%; width: 2px;
    background: linear-gradient(180deg, var(--accent), transparent);
  }
  .file-card-icon {
    font-size: 1.4rem;
    margin-bottom: 0;
    flex-shrink: 0;
  }
  .file-card-info {
    margin-bottom: 0;
    flex: 1;
    min-width: 0;
  }
  .file-card-name {
    font-size: 0.88rem;
    margin-bottom: 0.05rem;
  }
  .file-card-meta {
    font-size: 0.7rem;
  }
  .file-card-actions {
    margin-top: 0;
    flex-shrink: 0;
  }
  .file-card-actions .btn-sm {
    padding: 0.3rem 0.55rem;
    font-size: 0.7rem;
    border-radius: 4px;
  }

  /* Table Card Transformation on Mobile */
  .table-wrapper table, 
  .table-wrapper tbody, 
  .table-wrapper tr, 
  .table-wrapper td {
    display: block;
    width: 100%;
  }
  .table-wrapper thead {
    display: none;
  }
  .table-wrapper tr {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    margin-bottom: 0.6rem;
    position: relative;
    box-sizing: border-box;
  }
  .table-wrapper tr::before {
    content: '';
    position: absolute; top: 0; left: 0; bottom: 0; width: 2px;
    background: linear-gradient(180deg, var(--accent), transparent);
  }
  .table-wrapper td {
    border: none !important;
    padding: 0.35rem 0 !important;
    font-size: 0.78rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: right;
  }
  .table-wrapper td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-300);
    text-align: left;
    margin-right: 1rem;
  }

  /* User Table specific compact styling on mobile */
  .user-table tr {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0.5rem 0.75rem !important;
  }
  .user-table td {
    display: none !important;
  }
  .user-table td[data-label="Kullanıcı"],
  .user-table td[data-label="İşlem"],
  .user-table td[data-label="İşlemler"] {
    display: flex !important;
    width: auto !important;
    padding: 0 !important;
    border: none !important;
  }
  .user-table td[data-label="Kullanıcı"]::before,
  .user-table td[data-label="İşlem"]::before,
  .user-table td[data-label="İşlemler"]::before {
    display: none !important;
  }
  /* Hide all buttons (Sil, Admin Yap) except the "Detay" link */
  .user-table td[data-label="İşlem"] button,
  .user-table td[data-label="İşlemler"] button {
    display: none !important;
  }
  .user-table td[data-label="İşlem"] a,
  .user-table td[data-label="İşlemler"] a {
    display: inline-block !important;
  }
}

/* ── Utility ─────────────────────────────────────────────────── */
.flex      { display: flex; }
.flex-col  { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.mt-1  { margin-top: 0.5rem; }
.mt-2  { margin-top: 1rem; }
.mt-3  { margin-top: 1.5rem; }
.mb-1  { margin-bottom: 0.5rem; }
.mb-2  { margin-bottom: 1rem; }
.text-sm   { font-size: 0.875rem; }
.text-xs   { font-size: 0.78rem; }
.text-muted { color: var(--text-300); }
.text-accent { color: var(--accent); }
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.font-mono   { font-family: 'JetBrains Mono', monospace; }
.hidden { display: none !important; }
.w-full { width: 100%; }

/* ── Animated gradient border ────────────────────────────────── */
.glow-border {
  position: relative;
}
.glow-border::after {
  content: '';
  position: absolute; inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--accent), var(--green), var(--accent));
  background-size: 300%;
  z-index: -1;
  animation: gradientShift 4s ease infinite;
  opacity: 0.3;
}
@keyframes gradientShift { 0%,100% { background-position: 0% } 50% { background-position: 100% } }

/* ── Admin specific ──────────────────────────────────────────── */
.admin-badge {
  background: linear-gradient(135deg, var(--yellow), var(--orange));
  color: #000;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  letter-spacing: 0.08em;
}

.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-dim), var(--green-dim));
  display: grid; place-items: center;
  font-weight: 700; font-size: 0.9rem;
  color: #000;
  flex-shrink: 0;
}
