/* ═══════════════════════════════════════════════════
   JDRepair System — Apple-inspired CSS
═══════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ─── VARIABLES ──────────────────────────────────────── */
:root {
  --accent:           #0071e3;
  --accent-hover:     #0077ed;
  --accent-light:     #e8f0fb;
  --bg-primary:       #f5f5f7;
  --bg-secondary:     #ffffff;
  --text-primary:     #1d1d1f;
  --text-secondary:   #6e6e73;
  --text-tertiary:    #86868b;
  --border:           rgba(0,0,0,0.10);
  --border-strong:    rgba(0,0,0,0.18);
  --green:            #34c759;
  --orange:           #ff9500;
  --yellow:           #ffd60a;
  --red:              #ff3b30;
  --green-bg:         #f0faf3;
  --orange-bg:        #fff5e6;
  --yellow-bg:        #fffbe6;
  --red-bg:           #fff0ef;
  --blue:             #0071e3;
  --blue-bg:          #e8f0fb;
  --shadow-sm:  0 1px 6px  rgba(0,0,0,0.06);
  --shadow-md:  0 4px 20px rgba(0,0,0,0.09);
  --shadow-lg:  0 8px 40px rgba(0,0,0,0.13);
  --shadow-xl:  0 20px 60px rgba(0,0,0,0.16);
  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  18px;
  --radius-xl:  24px;
  --sidebar-width:  220px;
  --topbar-height:  58px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ─── RESET ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: var(--accent); }

/* ═══════════════════════════════════════════════════
   PUBLIC PAGES
═══════════════════════════════════════════════════ */
.public-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #f5f5f7 0%, #e8eaf0 100%);
  display: flex; flex-direction: column;
}
.public-nav {
  background: rgba(255,255,255,0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 40px; height: 52px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
}
.nav-logo {
  font-size: 17px; font-weight: 600; color: var(--text-primary);
  display: flex; align-items: center; gap: 8px;
}
.nav-links { display: flex; align-items: center; gap: 22px; }
/* Login / Register links — colore scuro e ben leggibile */
.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);   /* #1d1d1f — scuro */
  transition: color .2s;
}
.nav-links a:hover { color: var(--accent); }
.hero-section {
  flex: 1; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 80px 24px;
  position: relative;
  overflow: hidden;
  background: transparent; /* Rimuovo il background diretto */
}
/* Il vero sfondo con pattern e parallax */
.hero-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 120%; /* Un po' più alto per permettere il movimento */
  /* Pattern: Smartphone + Chiave inglese (riparazione) */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120' width='120' height='120'%3E%3Crect x='25' y='10' width='70' height='100' rx='8' ry='8' fill='none' stroke='%236e6e73' stroke-width='2'/%3E%3Ccircle cx='60' cy='100' r='4' fill='%236e6e73'/%3E%3Cline x1='40' y1='20' x2='80' y2='20' stroke='%236e6e73' stroke-width='2'/%3E%3Cpath d='M90 25 l12 12 a4 4 0 0 1 0 6 l-4 4 l-12-12 l4-4 a4 4 0 0 1 0-6 z' fill='none' stroke='%230071e3' stroke-width='2' transform='rotate(45 96 31)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 180px 180px;
  opacity: 0.2; /* Visibilità bilanciata */
  pointer-events: none;
  z-index: -1;
  /* Effetto Parallax base (senza JS) */
  background-attachment: fixed;
  transition: transform 0.3s ease-out;
}
/* Overlay bianco semi-trasparente per leggibilità */
.hero-section::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(245, 245, 247, 0.85); /* Sfondo originale visibile ma con pattern sotto */
  z-index: -1;
  pointer-events: none;
}

.hero-content { max-width: 680px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-light); color: var(--accent);
  font-size: 12px; font-weight: 600;
  padding: 6px 14px; border-radius: 100px; margin-bottom: 24px;
}
.hero-title {
  font-size: clamp(40px, 6vw, 70px);
  font-weight: 700; letter-spacing: -2px; line-height: 1.05;
  color: var(--text-primary); margin-bottom: 18px;
}
.hero-title span { color: var(--accent); }
.hero-subtitle { font-size: 19px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 40px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ═══════════════════════════════════════════════════
   AUTH PAGES
═══════════════════════════════════════════════════ */
.auth-container {
  min-height: 100vh; display: flex;
  align-items: center; justify-content: center;
  background: linear-gradient(135deg, #f5f5f7 0%, #e8eaf0 100%);
  padding: 24px;
}
.auth-box {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(30px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 44px 48px;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-xl);
}
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo-icon {
  width: 60px; height: 60px;
  background: none;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px; font-size: 28px;
  overflow: hidden;
}
.auth-logo-icon img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  border-radius: 12px;
}
.auth-logo h1 { font-size: 22px; font-weight: 700; color: var(--text-primary); }
.auth-logo p  { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.auth-title   { font-size: 26px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; letter-spacing: -0.5px; }
.auth-subtitle{ font-size: 15px; color: var(--text-secondary); margin-bottom: 24px; }
.auth-footer  { text-align: center; margin-top: 18px; font-size: 14px; color: var(--text-secondary); }
.auth-footer a{ color: var(--accent); font-weight: 500; }

/* ═══════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 22px; border-radius: 980px;
  font-size: 14px; font-weight: 500; font-family: var(--font);
  cursor: pointer; border: none; white-space: nowrap;
  transition: all .2s cubic-bezier(.4,0,.2,1);
  text-decoration: none;
}
.btn-primary   { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; transform: scale(1.02); box-shadow: 0 4px 14px rgba(0,113,227,.35); }
.btn-secondary { background: rgba(0,0,0,.06); color: var(--text-primary); }
.btn-secondary:hover { background: rgba(0,0,0,.11); color: var(--text-primary); }
.btn-danger    { background: var(--red); color: #fff; }
.btn-danger:hover  { background: #d63529; }
.btn-success   { background: var(--green); color: #fff; }
.btn-success:hover { background: #2dab4f; }
.btn-sm  { padding: 6px 14px; font-size: 13px; }
.btn-xs  { padding: 4px 10px; font-size: 12px; }
.btn-icon{ padding: 8px; border-radius: 50%; }

/* ═══════════════════════════════════════════════════
   FORMS
═══════════════════════════════════════════════════ */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }
.form-control {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 15px; font-family: var(--font);
  color: var(--text-primary); background: #fff;
  transition: border-color .2s, box-shadow .2s; outline: none;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,113,227,.13); }
.form-control::placeholder { color: #b0b0b7; }
select.form-control { cursor: pointer; appearance: none; }
textarea.form-control { resize: vertical; min-height: 88px; }

/* ═══════════════════════════════════════════════════
   APP LAYOUT
═══════════════════════════════════════════════════ */
.app-layout { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width);
  background: #fff;
  border-right: 1px solid #e2e8f0;
  box-shadow: 2px 0 16px -6px rgba(0,0,0,.08);
  position: fixed; top: 0; left: 0; bottom: 0;
  display: flex; flex-direction: column;
  z-index: 1000;
}
.sidebar.open { transform: translateX(0); }

/* Logo area */
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 16px 14px;
  border-bottom: 1px solid #e2e8f0;
}
.sidebar-logo img {
  width: 28px; height: 28px; border-radius: 6px;
}
.sidebar-logo span {
  font-size: 16px; font-weight: 700;
  color: #0f172a;
  letter-spacing: -.01em;
}

/* User section at top (unused now, kept for compat) */
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
}
.sidebar-user .user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #4f7df3, #6bc5f7);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(79,125,243,.25);
}
.sidebar-user .user-avatar span {
  font-size: 14px; font-weight: 600; color: #fff;
}
.sidebar-user .user-info { flex: 1; min-width: 0; }
.sidebar-user .user-name {
  font-size: 14px; font-weight: 600;
  color: #0f172a;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user .sub-badge {
  font-size: 12px; color: #64748b;
  display: block;
}

/* Navigation */
.sidebar-nav {
  flex: 1; padding: 6px 8px;
  overflow-y: auto;
}
.nav-section-title {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #64748b;
  padding: 16px 12px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 8px;
  color: #334155;
  font-size: 15px; font-weight: 400;
  transition: all .12s;
  text-decoration: none;
  position: relative;
}
.nav-item:hover {
  color: #0f172a;
  background: #f1f5f9;
}
.nav-item.active {
  color: #0f172a;
  background: #f1f5f9;
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -8px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 22px;
  border-radius: 0 2px 2px 0;
  background: var(--accent);
  box-shadow: 0 0 6px rgba(0,113,227,.4);
}
.nav-item svg,
.nav-item i {
  width: 20px; height: 20px; flex-shrink: 0;
  opacity: .6;
  font-size: 17px;
  display: flex; align-items: center; justify-content: center;
}
.nav-item:hover svg,
.nav-item:hover i { opacity: 1; }
.nav-item.active svg,
.nav-item.active i { opacity: 1; }

.nav-badge {
  margin-left: auto;
  background: #ef4444;
  color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 1px 6px;
  border-radius: 100px;
  min-width: 18px;
  text-align: center;
}

/* Bottom section (user chip + settings + logout) */
.sidebar-bottom {
  padding: 10px;
  border-top: 1px solid #e2e8f0;
}
.sidebar-bottom .nav-item {
  color: #475569;
}
.sidebar-bottom .nav-item:hover {
  color: #ef4444;
  background: #fef2f2;
}

/* Keep old .user-chip for admin backward compat */
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #4f7df3, #6bc5f7);
  display: flex; align-items: center; justify-content: center;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 14px; font-weight: 600; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: 12px; color: #475569; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* User chip in sidebar bottom */
.sidebar-bottom .user-chip {
  display: flex; align-items: center; gap: 12px;
  padding: 0 6px 12px;
  margin-bottom: 6px;
  border-bottom: 1px solid #e2e8f0;
}
.sidebar-bottom .user-chip .sub-badge {
  font-size: 11px; color: #475569;
  display: block;
  margin-top: 2px;
}

/* Subscription progress bar */
.sub-progress {
  height: 5px;
  border-radius: 100px;
  background: #e2e8f0;
  overflow: hidden;
  margin-top: 8px;
}
.sub-progress-bar {
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, #8b5cf6, #a78bfa);
  transition: width .4s ease;
}

/* ── JDB Connect (Forum) ─────────────────────────────*/
.topbar-connect-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; color: #fff; flex-shrink: 0;
}
.topbar-connect-title {
  font-size: 15px; font-weight: 700; color: #0f172a;
  line-height: 1.2;
}
.topbar-connect-sub {
  font-size: 11px; color: #64748b;
  line-height: 1.2;
}

/* Forum search input */
.forum-search-input {
  width: 180px; padding: 6px 10px; border: 1px solid #e2e8f0;
  border-radius: 8px; font-size: 13px; font-family: inherit;
  background: #f8fafc; transition: all .2s; outline: none;
}
.forum-search-input:focus {
  width: 240px; border-color: #7c3aed;
  background: #fff; box-shadow: 0 0 0 3px rgba(124,58,237,.1);
}

/* Category cards grid */
.forum-categories-grid {
  display: flex; flex-direction: column; gap: 12px;
}
.forum-cat-card {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 20px;
  background: #fff; border-radius: 12px;
  border: 1px solid #e2e8f0;
  text-decoration: none; transition: all .15s;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.forum-cat-card:hover {
  border-color: #c4b5fd; box-shadow: 0 2px 12px rgba(124,58,237,.1);
  transform: translateY(-1px);
}
.forum-cat-card-icon {
  width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff;
}
.forum-cat-card-body { flex: 1; min-width: 0; }
.forum-cat-card-name {
  font-size: 15px; font-weight: 700; color: #0f172a;
  margin-bottom: 2px;
}
.forum-cat-card-desc {
  font-size: 12px; color: #64748b;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.forum-cat-card-stats {
  display: flex; gap: 16px; flex-shrink: 0;
  font-size: 12px; color: #94a3b8;
}
.forum-cat-card-stats strong { color: #475569; }
.forum-cat-card-arrow { color: #cbd5e1; font-size: 14px; }

/* Topic list table-style */
.forum-topic-list {
  background: #fff; border-radius: 12px;
  border: 1px solid #e2e8f0; overflow: hidden;
}
.forum-topic-list-header {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 18px;
  background: #f8fafc; border-bottom: 1px solid #e2e8f0;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: #94a3b8;
}
.ftl-main { flex: 1; }
.ftl-stats { width: 80px; text-align: center; flex-shrink: 0; }
.ftl-last { width: 140px; text-align: right; flex-shrink: 0; }

.forum-topic-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid #f1f5f9;
  text-decoration: none; transition: background .1s;
}
.forum-topic-row:last-child { border-bottom: none; }
.forum-topic-row:hover { background: #f8fafc; }
.forum-topic-row .forum-topic-main { flex: 1; min-width: 0; }
.forum-topic-row .forum-topic-title {
  font-size: 14px; font-weight: 600; color: #0f172a;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center; gap: 6px;
}
.forum-topic-row .forum-topic-meta {
  font-size: 12px; color: #94a3b8; margin-top: 3px;
  display: flex; align-items: center; gap: 14px;
}
.forum-topic-row .forum-topic-meta i { width: 12px; font-size: 10px; margin-right: 3px; }
.forum-topic-row .forum-topic-stats {
  width: 80px; flex-shrink: 0; text-align: center;
  font-size: 12px; color: #94a3b8;
}
.ftl-reply-count {
  display: inline-block; min-width: 24px; padding: 1px 8px;
  background: #f1f5f9; border-radius: 100px;
  font-weight: 700; font-size: 12px; color: #475569;
}
.ftl-view-count { display: block; margin-top: 2px; font-size: 11px; }
.ftl-view-count i { margin-right: 2px; }
.forum-topic-row .forum-topic-last {
  width: 140px; flex-shrink: 0; text-align: right;
}
.ftl-last-user { font-size: 13px; font-weight: 600; color: #475569; }
.ftl-last-time { font-size: 11px; color: #94a3b8; margin-top: 1px; }

/* Discussions stile vBulletin (view.php) */
.forum-vb {
  max-width: 900px; margin: 0 auto;
}
.vb-post {
  background: #fff; border-radius: 10px;
  border: 1px solid #e2e8f0; overflow: hidden;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.vb-reply { border-top: none; border-radius: 0; margin-top: -1px; }
.vb-reply:first-of-type { border-radius: 10px 10px 0 0; }
.vb-reply:last-of-type { border-radius: 0 0 10px 10px; margin-bottom: 10px; }

.vb-postbar {
  display: flex; align-items: center; gap: 14px;
  padding: 7px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: 11px; color: #94a3b8;
}
.vb-postbar span:last-child {
  margin-left: auto; font-weight: 700; font-size: 11px;
  color: #cbd5e1;
}

.vb-postbody {
  display: flex;
}
.vb-user {
  width: 150px; flex-shrink: 0;
  padding: 16px; text-align: center;
  border-right: 1px solid #f1f5f9;
  background: #fafbfc;
}
.vb-user-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  margin: 0 auto 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 700; color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.12);
}
.vb-user-name { font-size: 13px; font-weight: 700; color: #0f172a; word-break: break-word; }
.vb-user-title { font-size: 11px; color: #64748b; margin-top: 2px; }
.vb-user-since,
.vb-user-posts { font-size: 11px; color: #94a3b8; margin-top: 4px; }
.vb-user-since i,
.vb-user-posts i { width: 13px; margin-right: 3px; }

.vb-content {
  flex: 1; min-width: 0; padding: 16px 20px;
}
.vb-content-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
}
.vb-content-title {
  font-size: 15px; font-weight: 700; color: #0f172a;
}
.vb-content-text {
  font-size: 14px; line-height: 1.75; color: #334155;
}

.vb-actions {
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid #f1f5f9;
  display: flex; gap: 8px;
}
.vb-btn {
  font-size: 12px; color: #94a3b8; text-decoration: none;
  padding: 4px 10px; border-radius: 6px;
  transition: all .15s;
}
.vb-btn:hover { background: #f1f5f9; color: #475569; }

/* Reply box fisso in basso */
.vb-replybox-fixed {
  position: fixed; bottom: 0; left: 220px; right: 0;
  background: #fff; border-top: 1px solid #e2e8f0;
  padding: 24px 32px;
  box-shadow: 0 -2px 8px rgba(0,0,0,.06);
  z-index: 100;
}
.vb-replybox-inner {
  max-width: 900px; margin: 0 auto;
  display: flex; gap: 14px; align-items: flex-end;
}
.vb-replybox-inner textarea {
  flex: 1; padding: 18px 20px; border: 1px solid #e2e8f0;
  border-radius: 10px; resize: none; font-family: inherit;
  font-size: 15px; line-height: 1.6; min-height: 80px; max-height: 260px;
  box-sizing: border-box; transition: border-color .2s;
}
.vb-replybox-inner textarea:focus {
  outline: none; border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124,58,237,.12);
}
.vb-replybox-inner .btn { white-space: nowrap; padding: 10px 20px; min-height: 44px; font-size: 14px; }

/* Locked */
.vb-locked {
  text-align: center; padding: 20px;
  background: #fef3c7; border-radius: 10px;
  border: 1px solid #fbbf24;
  font-size: 14px; color: #92400e;
}

/* Pagination */
.forum-pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; margin-top: 20px; padding: 8px 0;
}

/* ── Main content ── */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1; min-height: 100vh;
  display: flex; flex-direction: column;
  background: var(--bg-primary);
}
.topbar {
  height: var(--topbar-height);
  background: rgba(245,245,247,.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; position: sticky; top: 0; z-index: 40;
}
.topbar-title   { font-size: 17px; font-weight: 600; color: var(--text-primary); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
#sidebar-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; color: var(--text-primary); z-index: 50; position: relative; -webkit-tap-highlight-color: transparent; }
#sidebar-toggle:active { transform: scale(0.95); }
* { -webkit-tap-highlight-color: transparent; }
.content-area { padding: 28px; flex: 1; }
.page-content { padding: 28px; flex: 1; }

/* ═══════════════════════════════════════════════════
   CARDS
═══════════════════════════════════════════════════ */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.card-title { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.card-body  { padding: 20px; }

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px,1fr));
  gap: 16px; margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px; box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 12px;
  transition: transform .2s, box-shadow .2s;
  flex-wrap: wrap;
}
.stat-card > .stat-icon {
  flex-shrink: 0;
  width: 52px; height: 52px;
}
.stat-card > div:not(.stat-icon) {
  flex: 1;
  min-width: 100px;
  padding-right: 8px;
}
.stat-value { 
  font-size: 22px; 
  font-weight: 700; 
  letter-spacing: -1px; 
  line-height: 1; 
}
.stat-label { font-size: 13px; color: var(--text-secondary); margin-top: 3px; }

/* ═══════════════════════════════════════════════════
   TABLE
═══════════════════════════════════════════════════ */
.table-wrap {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  overflow-y: visible;
  box-shadow: var(--shadow-sm);
  isolation: isolate;
  -webkit-overflow-scrolling: touch;
}

.table-wrap::-webkit-scrollbar { height: 6px; }
.table-wrap::-webkit-scrollbar-track { background: transparent; }
.table-wrap::-webkit-scrollbar-thumb { background: rgba(0,0,0,.2); border-radius: 3px; }
.table-wrap thead tr:first-child th:first-child { border-radius: var(--radius-lg) 0 0 0; }
.table-wrap thead tr:first-child th:last-child  { border-radius: 0 var(--radius-lg) 0 0; }
.table-wrap tbody tr:last-child td:first-child   { border-radius: 0 0 0 var(--radius-lg); }
.table-wrap tbody tr:last-child td:last-child    { border-radius: 0 0 var(--radius-lg) 0; }
.table-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--bg-secondary);
}
.table-title { font-size: 15px; font-weight: 600; color: var(--text-primary); }

table { width: 100%; border-collapse: collapse; min-width: 0; }
table td.col-hide, table th.col-hide { display: none; }
thead th {
  padding: 8px 10px; font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-tertiary); text-align: left;
  background: rgba(0,0,0,.02); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td { padding: 8px 10px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(0,0,0,.015); }

@media (max-width: 1100px) {
  .table-wrap { overflow-x: hidden; }
  table, thead, tbody, th, td, tr { display: block; }
  thead tr { position: absolute; top: -9999px; left: -9999px; }
  tbody tr { border: 1px solid var(--border); border-radius: var(--radius-md); margin-bottom: 12px; background: var(--bg-secondary); }
  tbody td {
    border: none; border-bottom: 1px solid var(--border); position: relative;
    padding-left: 40%; text-align: right;
  }
  tbody td:before {
    position: absolute; top: 8px; left: 12px; width: 35%; padding-right: 12px;
    white-space: nowrap; font-weight: 600; font-size: 10px; text-transform: uppercase;
    letter-spacing: .05em; color: var(--text-tertiary); text-align: left;
    content: attr(data-label);
  }
  table tbody tr td.hide-mobile { display: none !important; }
  tbody td:last-child { border-bottom: none; text-align: left; padding-left: 12px; }
  tbody td:last-child > div { justify-content: flex-start; }
}

/* ═══════════════════════════════════════════════════
   STATUS DOTS / BADGES
═══════════════════════════════════════════════════ */
.status-dot {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 10px; border-radius: 100px;
  font-size: 12px; font-weight: 500;
}
.status-dot::before {
  content: ''; width: 8px; height: 8px;
  border-radius: 50%; flex-shrink: 0;
}
.status-green  { background: var(--green-bg);  color: #1a7a35; }
.status-green::before  { background: var(--green);  box-shadow: 0 0 0 2px rgba(52,199,89,.25); }
.status-orange { background: var(--orange-bg); color: #a05a00; }
.status-orange::before { background: var(--orange); box-shadow: 0 0 0 2px rgba(255,149,0,.25); }
.status-yellow { background: var(--yellow-bg); color: #7a6200; }
.status-yellow::before { background: var(--yellow); box-shadow: 0 0 0 2px rgba(255,214,10,.25); }
.status-red    { background: var(--red-bg);    color: #a02020; }
.status-red::before    { background: var(--red);    box-shadow: 0 0 0 2px rgba(255,59,48,.25); }
.status-blue   { background: var(--blue-bg);   color: #0060b3; }
.status-blue::before   { background: var(--blue);   box-shadow: 0 0 0 2px rgba(0,113,227,.25); }

.badge { display: inline-flex; padding: 3px 10px; border-radius: 100px; font-size: 11px; font-weight: 600; }
.badge-active   { background: var(--green-bg);  color: #1a7a35; }
.badge-expired  { background: var(--red-bg);    color: #a02020; }
.badge-pending  { background: var(--orange-bg); color: #a05a00; }
.badge-approved { background: var(--green-bg);  color: #1a7a35; }
.badge-rejected { background: var(--red-bg);    color: #a02020; }
.badge-blue     { background: var(--accent-light); color: var(--accent); }

/* ═══════════════════════════════════════════════════
   ALERTS
═══════════════════════════════════════════════════ */
.alert {
  padding: 11px 16px; border-radius: var(--radius-sm);
  font-size: 14px; margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.alert-success { background: var(--green-bg);  color: #1a7a35; border: 1px solid rgba(52,199,89,.25); }
.alert-error   { background: var(--red-bg);    color: #a02020; border: 1px solid rgba(255,59,48,.25); }
.alert-warning { background: var(--orange-bg); color: #a05a00; border: 1px solid rgba(255,149,0,.25); }
.alert-info    { background: var(--accent-light); color: var(--accent); border: 1px solid rgba(0,113,227,.25); }

/* ═══════════════════════════════════════════════════
   MODALS
═══════════════════════════════════════════════════ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: slideUp .25s cubic-bezier(.4,0,.2,1);
  position: relative;
  z-index: 10000;
}
.modal-header {
  padding: 22px 26px 0;
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.modal-close {
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(0,0,0,.06); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; color: var(--text-secondary); transition: background .15s;
  flex-shrink: 0;
}
.modal-close:hover { background: rgba(0,0,0,.12); }
.modal-body { padding: 18px 26px 26px; }

@keyframes slideUp {
  from { transform: translateY(24px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ═══════════════════════════════════════════════════
   LANGUAGE TOGGLE
═══════════════════════════════════════════════════ */
.lang-toggle { display: flex; background: rgba(0,0,0,.06); border-radius: 100px; padding: 3px; gap: 2px; }
.lang-btn {
  padding: 5px 12px; border-radius: 100px; border: none;
  font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: var(--font); background: transparent;
  color: var(--text-secondary); transition: all .2s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.lang-btn.active { background: #fff; color: var(--text-primary); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.lang-btn:active { transform: scale(0.96); }

@media (max-width: 768px) {
  .lang-toggle { padding: 4px; }
  .lang-btn { padding: 8px 16px; font-size: 14px; }
}

/* ═══════════════════════════════════════════════════
   SEARCH BAR
═══════════════════════════════════════════════════ */
.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: rgba(0,0,0,.05); border-radius: 100px;
  padding: 7px 16px; flex: 1; max-width: 280px;
}
.search-bar input {
  border: none; background: transparent; outline: none;
  font-size: 14px; font-family: var(--font);
  color: var(--text-primary); flex: 1;
}
.search-bar input::placeholder { color: var(--text-tertiary); }

/* ═══════════════════════════════════════════════════
   FILE LIBRARY
═══════════════════════════════════════════════════ */
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 16px; }
.file-card {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  transition: all .2s; cursor: pointer;
}
.file-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--accent); }
.file-icon {
  width: 48px; height: 48px; background: var(--accent-light);
  border-radius: 12px; display: flex; align-items: center;
  justify-content: center; font-size: 22px; margin-bottom: 12px;
}
.file-name { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.file-meta { font-size: 12px; color: var(--text-tertiary); }

/* ═══════════════════════════════════════════════════
   IMEI CHECK
═══════════════════════════════════════════════════ */
.imei-result {
  background: rgba(0,0,0,.025); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 18px; margin-top: 18px;
  font-family: 'SF Mono','Fira Code',monospace; font-size: 13px;
  white-space: pre-wrap; word-break: break-all;
  max-height: 420px; overflow-y: auto; color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════
   SETTINGS GRID
═══════════════════════════════════════════════════ */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px,1fr)); gap: 20px; }

/* ═══════════════════════════════════════════════════
   API BALANCE CARD
═══════════════════════════════════════════════════ */
.balance-card {
  background: linear-gradient(135deg, #1d1d1f, #3a3a3c);
  color: #fff; border-radius: var(--radius-xl); padding: 28px;
}
.balance-amount { font-size: 42px; font-weight: 700; letter-spacing: -2px; margin: 8px 0; }

/* ═══════════════════════════════════════════════════
   NOTIFICATION BELL
═══════════════════════════════════════════════════ */
.notif-btn {
  position: relative; width: 36px; height: 36px;
  border-radius: 50%; background: rgba(0,0,0,.06);
  border: none; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  font-size: 16px; color: var(--text-secondary);
  transition: background .2s; text-decoration: none;
}
.notif-btn:hover { background: rgba(0,0,0,.11); }
.notif-count {
  position: absolute; top: -2px; right: -2px;
  background: var(--red); color: #fff;
  font-size: 9px; font-weight: 700;
  width: 16px; height: 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-primary);
}

/* ═══════════════════════════════════════════════════
   SECTION HEADER
═══════════════════════════════════════════════════ */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.section-title { font-size: 22px; font-weight: 700; color: var(--text-primary); letter-spacing: -.5px; }

/* ═══════════════════════════════════════════════════
   TABS
═══════════════════════════════════════════════════ */
.tabs { display: flex; gap: 2px; background: rgba(0,0,0,.05); border-radius: var(--radius-sm); padding: 3px; margin-bottom: 20px; }
.tab-btn {
  flex: 1; padding: 8px 14px; border-radius: 6px; border: none;
  font-size: 13px; font-weight: 500; cursor: pointer;
  background: transparent; color: var(--text-secondary);
  font-family: var(--font); transition: all .2s;
}
.tab-btn.active { background: #fff; color: var(--text-primary); box-shadow: var(--shadow-sm); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ═══════════════════════════════════════════════════
   MISC UTILITIES
═══════════════════════════════════════════════════ */
.divider { height: 1px; background: var(--border); margin: 20px 0; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: fadeIn .4s ease forwards; }
.stagger > * { opacity: 0; animation: fadeIn .4s ease forwards; }
.stagger > *:nth-child(1) { animation-delay: .05s; }
.stagger > *:nth-child(2) { animation-delay: .10s; }
.stagger > *:nth-child(3) { animation-delay: .15s; }
.stagger > *:nth-child(4) { animation-delay: .20s; }
.stagger > *:nth-child(5) { animation-delay: .25s; }
.stagger > *:nth-child(6) { animation-delay: .30s; }

@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(0,113,227,.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: inline-block;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,.25); }

/* ═══════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════ */
.desktop-only { display: inline; }
.mobile-only { display: none; }
@media (max-width: 768px) {
  .desktop-only { display: none !important; }
  .mobile-only { display: inline; }
}

/* Sidebar toggle — nascosto su desktop, visibile su mobile */
@media (max-width: 768px) {
  #sidebar-toggle { display: inline-flex !important; }
  .sidebar { 
    position: fixed; top: 0; left: -85%; bottom: 0;
    width: 85%; background: #fff; z-index: 10000; 
    display: flex; flex-direction: column;
    transition: left 0.3s ease; box-shadow: 4px 0 24px -8px rgba(0,0,0,.2);
  }
  .sidebar.open { left: 0; }
  .sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 9999; display: none; }
  .sidebar-overlay.show { display: block; }
  .main-content { margin-left: 0; }
  .topbar { padding: 0 16px; }
  .content-area { padding: 16px; }
  .page-content { padding: 16px; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .auth-box { padding: 24px 18px; }
}
