/* ============================================================
   CONFECPRO — Design System v2.0
   Moderno, limpo, consistente, com dark mode nativo via CSS vars
   ============================================================ */

/* ── Tokens ──────────────────────────────────────────────── */
:root {
  /* Brand */
  --brand-50:  #eef2ff;
  --brand-100: #e0e7ff;
  --brand-200: #c7d2fe;
  --brand-500: #6366f1;
  --brand-600: #4f46e5;
  --brand-700: #4338ca;
  --brand-800: #3730a3;

  /* Semantic */
  --primary:        var(--brand-600);
  --primary-dark:   var(--brand-700);
  --primary-light:  var(--brand-100);
  --primary-glow:   rgba(79, 70, 229, 0.25);

  --success:        #16a34a;
  --success-bg:     #dcfce7;
  --warning:        #d97706;
  --warning-bg:     #fef3c7;
  --danger:         #dc2626;
  --danger-bg:      #fee2e2;
  --danger-text:    #991b1b;
  --info:           #0284c7;
  --info-bg:        #e0f2fe;

  /* Neutral surface */
  --bg-base:        #f1f5f9;
  --bg-surface:     #ffffff;
  --bg-muted:       #f8fafc;
  --bg-hover:       #f0f4ff;

  /* Text */
  --text-base:      #1e293b;
  --text-secondary: #475569;
  --text-muted:     #94a3b8;
  --text-inverse:   #ffffff;

  /* Border */
  --border:         #e2e8f0;
  --border-focus:   var(--brand-500);

  /* Radius */
  --r-sm:   6px;
  --r-md:   10px;
  --r-lg:   14px;
  --r-xl:   20px;
  --r-full: 9999px;

  /* Shadow */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 28px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 48px rgba(0,0,0,0.14), 0 8px 16px rgba(0,0,0,0.06);

  /* Spacing scale */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;

  /* Typography */
  --font: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base-size: 0.9375rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;

  /* Input */
  --input-bg: var(--bg-surface);

  /* Legacy compat aliases */
  --white:        var(--bg-surface);
  --bg:           var(--bg-muted);
  --bg-unread:    var(--bg-hover);
  --border-color: var(--border);
  --text:         var(--text-base);
  --text-light:   var(--text-secondary);
  --dark:         var(--text-base);
  --shadow:       var(--shadow-md);
  --radius:       var(--r-lg);
  --bg-danger:    var(--danger-bg);
  --text-danger:  var(--danger-text);
  --secondary:    var(--text-secondary);
}

/* ── Dark Mode ───────────────────────────────────────────── */
[data-theme="dark"] {
  --primary:       #818cf8;
  --primary-dark:  #6366f1;
  --primary-light: #1e1b4b;
  --primary-glow:  rgba(129, 140, 248, 0.2);

  --success:       #4ade80;
  --success-bg:    #052e16;
  --warning:       #fbbf24;
  --warning-bg:    #1c1105;
  --danger:        #f87171;
  --danger-bg:     #1f0a0a;
  --danger-text:   #fca5a5;
  --info:          #38bdf8;
  --info-bg:       #0c1a2e;

  --bg-base:    #0f172a;
  --bg-surface: #1e293b;
  --bg-muted:   #0f172a;
  --bg-hover:   #1e293b;

  --text-base:      #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted:     #64748b;
  --text-inverse:   #0f172a;

  --border: #334155;
  --border-focus: #818cf8;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.25), 0 1px 2px rgba(0,0,0,0.15);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.3), 0 2px 4px rgba(0,0,0,0.15);
  --shadow-lg: 0 10px 28px rgba(0,0,0,0.4), 0 4px 8px rgba(0,0,0,0.2);
  --shadow-xl: 0 20px 48px rgba(0,0,0,0.5), 0 8px 16px rgba(0,0,0,0.25);

  --input-bg: #1e293b;

  /* Legacy compat */
  --white:        var(--bg-surface);
  --bg:           var(--bg-muted);
  --bg-unread:    var(--bg-hover);
  --border-color: var(--border);
  --text:         var(--text-base);
  --text-light:   var(--text-secondary);
  --dark:         var(--text-base);
  --shadow:       var(--shadow-md);
  --bg-danger:    var(--danger-bg);
  --text-danger:  var(--danger-text);
  --secondary:    var(--text-secondary);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-size: var(--text-base-size);
  color: var(--text-base);
  background-color: var(--bg-base);
  line-height: 1.6;
  min-height: 100vh;
  transition: background-color 0.3s, color 0.3s;
}

a {
  text-decoration: none;
  color: inherit;
}

::placeholder {
  color: var(--text-muted);
}

/* ── Loading Overlay ─────────────────────────────────────── */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(3px);
  align-items: center;
  justify-content: center;
}
.loading-overlay.active { display: flex; }

.spinner {
  width: 52px;
  height: 52px;
  border: 4px solid rgba(255,255,255,0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Header ──────────────────────────────────────────────── */
header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0 var(--sp-6);
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
  gap: var(--sp-4);
}

.header-top h1 {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  letter-spacing: -0.02em;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-weight: 500;
}

/* Icon Button (theme toggle, bell) */
.btn-icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  font-size: var(--text-base-size);
}
.btn-icon:hover {
  background: var(--bg-hover);
  color: var(--primary);
  border-color: var(--primary);
}

.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.btn-logout:hover {
  background: var(--bg-hover);
  color: var(--primary);
  border-color: var(--primary);
}
.btn-logout.btn-primary-outline {
  border-color: var(--primary);
  color: var(--primary);
}
.btn-logout.btn-primary-outline:hover {
  background: var(--primary);
  color: var(--text-inverse);
}

/* Navigation */
.nav-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
}
.nav-container::-webkit-scrollbar { height: 3px; }
.nav-container::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--r-full);
}

.nav-menu {
  display: flex;
  gap: var(--sp-1);
  min-width: max-content;
  justify-content: center;
  margin: 0 auto;
  padding: var(--sp-2) 0;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 7px var(--sp-3);
  border-radius: var(--r-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: all 0.15s;
  text-decoration: none;
}
.nav-btn:hover {
  background: var(--bg-hover);
  color: var(--primary);
}
.nav-btn.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}
[data-theme="dark"] .nav-btn.active {
  background: rgba(99,102,241,0.15);
}

/* ── Layout ──────────────────────────────────────────────── */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--sp-6) var(--sp-6);
}

.view-section {
  padding-bottom: var(--sp-12);
}

/* ── Card ────────────────────────────────────────────────── */
.card {
  background: var(--bg-surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-6);
  margin-bottom: var(--sp-6);
}

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

.card h2 {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-base);
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.card-compact { padding: var(--sp-4); }
.card-flush   { padding: 0; overflow: hidden; }

/* Report card with accent */
.report-card {
  border-left: 3px solid var(--primary);
}

/* ── Dashboard Stats Grid ────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sp-5);
  margin-bottom: var(--sp-6);
}

.card-dashboard {
  background: var(--bg-surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-5);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--sp-4);
  transition: box-shadow 0.2s, transform 0.2s;
}
.card-dashboard:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-dashboard .content {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  flex: 1;
}
.card-dashboard .label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-weight: 500;
}
.card-dashboard .value {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-base);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.card-dashboard .sub {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--sp-1);
}

.card-dashboard .icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.card-blue   .icon-box { background: #ede9fe; color: #7c3aed; }
.card-green  .icon-box { background: var(--success-bg); color: var(--success); }
.card-red    .icon-box { background: var(--danger-bg); color: var(--danger); }
.card-yellow .icon-box { background: var(--warning-bg); color: var(--warning); }
.card-purple .icon-box { background: var(--primary-light); color: var(--primary); }
.card-sky    .icon-box { background: var(--info-bg); color: var(--info); }

[data-theme="dark"] .card-blue   .icon-box { background: #1e1b4b; color: #a5b4fc; }
[data-theme="dark"] .card-green  .icon-box { background: #052e16; color: #4ade80; }
[data-theme="dark"] .card-red    .icon-box { background: #1f0a0a; color: #f87171; }
[data-theme="dark"] .card-yellow .icon-box { background: #1c1105; color: #fbbf24; }
[data-theme="dark"] .card-purple .icon-box { background: #1e1b4b; color: #818cf8; }
[data-theme="dark"] .card-sky    .icon-box { background: #0c1a2e; color: #38bdf8; }

/* ── Buttons ─────────────────────────────────────────────── */
button, [role="button"] {
  font-family: var(--font);
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 9px var(--sp-4);
  border-radius: var(--r-md);
  border: 1px solid transparent;
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* Sizes */
.btn-sm { padding: 6px var(--sp-3); font-size: var(--text-xs); border-radius: var(--r-sm); }
.btn-lg { padding: 12px var(--sp-6); font-size: var(--text-base-size); border-radius: var(--r-lg); }
.btn-block { width: 100%; }

/* Variants */
.btn-primary, .btn-submit {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 1px 3px var(--primary-glow);
}
.btn-primary:hover, .btn-submit:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  box-shadow: 0 4px 12px var(--primary-glow);
  transform: translateY(-1px);
}

/* keep legacy .btn-submit full-width override */
.btn-submit {
  width: 100%;
  padding: 11px var(--sp-4);
  font-size: var(--text-base-size);
}
/* but allow override with style="width:auto" or class */
.btn-submit.w-auto { width: auto; padding: 9px var(--sp-4); font-size: var(--text-sm); }

.btn-secondary {
  background: var(--bg-muted);
  color: var(--text-base);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.btn-danger:hover {
  filter: brightness(0.9);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--primary);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: #fff;
}

/* Legacy aliases */
.btn-report {
  flex: 1;
  min-width: 200px;
  padding: 12px var(--sp-5);
  border: none;
  border-radius: var(--r-md);
  color: #fff;
  font-weight: 600;
  font-size: var(--text-base-size);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  transition: filter 0.15s, transform 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow-sm);
}
.btn-report:hover { transform: translateY(-2px); filter: brightness(1.08); box-shadow: var(--shadow-md); }
.btn-report-blue   { background: #3b82f6; }
.btn-report-green  { background: #10b981; }
.btn-report-purple { background: #8b5cf6; }

.btn-report-submit {
  background: var(--primary);
  color: #fff;
  width: 100%;
  padding: 12px;
  font-size: var(--text-base-size);
  border-radius: var(--r-md);
  border: none;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  transition: background 0.15s;
  margin-top: var(--sp-2);
}
.btn-report-submit:hover { background: var(--primary-dark); }

/* ── Forms ───────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-4);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--sp-4);
}
.form-group:last-child { margin-bottom: 0; }

.form-group label,
.form-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea,
.form-input,
.login-input {
  width: 100%;
  padding: 9px var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-family: var(--font);
  font-size: var(--text-sm);
  background: var(--input-bg);
  color: var(--text-base);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.form-input:focus,
.login-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

.form-group textarea { resize: vertical; min-height: 90px; }

.form-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Tables ──────────────────────────────────────────────── */
.table-container { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
  font-size: var(--text-sm);
}

th, td {
  padding: 11px var(--sp-4);
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--bg-muted);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

thead th:first-child { border-radius: var(--r-sm) 0 0 0; }
thead th:last-child  { border-radius: 0 var(--r-sm) 0 0; }

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

tbody tr:hover td {
  background: var(--bg-hover);
}

/* ── Status Badges ───────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: var(--text-xs);
  font-weight: 600;
  gap: 5px;
  white-space: nowrap;
}

.status-criacao_arte  { background: #e0f2fe; color: #0369a1; }
.status-arte_aprovada { background: var(--success-bg); color: #15803d; }
.status-impressao     { background: #fef9c3; color: #a16207; }
.status-prensa        { background: #ffedd5; color: #c2410c; }
.status-costura       { background: #fce7f3; color: #be185d; }
.status-revisao       { background: #f3e8ff; color: #7e22ce; }
.status-pronto        { background: #ecfccb; color: #4d7c0f; }
.status-entregue      { background: var(--success-bg); color: #047857; }

[data-theme="dark"] .status-criacao_arte  { background: rgba(3,105,161,0.2); color: #38bdf8; }
[data-theme="dark"] .status-arte_aprovada { background: rgba(21,128,61,0.2); color: #4ade80; }
[data-theme="dark"] .status-impressao     { background: rgba(161,98,7,0.2); color: #fbbf24; }
[data-theme="dark"] .status-prensa        { background: rgba(194,65,12,0.2); color: #fb923c; }
[data-theme="dark"] .status-costura       { background: rgba(190,24,93,0.2); color: #f472b6; }
[data-theme="dark"] .status-revisao       { background: rgba(126,34,206,0.2); color: #c084fc; }
[data-theme="dark"] .status-pronto        { background: rgba(77,124,15,0.2); color: #a3e635; }
[data-theme="dark"] .status-entregue      { background: rgba(4,120,87,0.2); color: #34d399; }

/* Badge utilities */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--sp-2);
  border-radius: var(--r-full);
  font-size: var(--text-xs);
  font-weight: 600;
}
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger  { background: var(--danger-bg); color: var(--danger); }
.badge-muted   { background: var(--bg-muted); color: var(--text-muted); border: 1px solid var(--border); }

/* ── Alerts / Error ──────────────────────────────────────── */
.alert {
  padding: var(--sp-4);
  border-radius: var(--r-md);
  font-size: var(--text-sm);
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.alert-danger  { background: var(--danger-bg); color: var(--danger-text); border: 1px solid rgba(220,38,38,0.2); }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(22,163,74,0.2); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(217,119,6,0.2); }
.alert-info    { background: var(--info-bg); color: var(--info); border: 1px solid rgba(2,132,199,0.2); }

/* Legacy alias */
.error-text {
  background: var(--danger-bg);
  color: var(--danger-text);
  padding: var(--sp-4);
  border-radius: var(--r-md);
  border: 1px solid rgba(220,38,38,0.2);
  font-size: var(--text-sm);
  margin-bottom: var(--sp-4);
}

/* ── Modal ───────────────────────────────────────────────── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
}
.modal-backdrop.active { display: flex; }

.modal-custom {
  background: var(--bg-surface);
  border-radius: var(--r-xl);
  max-width: 460px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
  padding: var(--sp-6);
  text-align: center;
  animation: modalIn 0.2s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-custom h3 {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-base);
  margin-bottom: var(--sp-2);
}
.modal-custom p {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  margin-bottom: var(--sp-5);
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  gap: var(--sp-3);
  justify-content: center;
}
.modal-actions .btn {
  min-width: 110px;
  border-radius: var(--r-md);
}
.btn-cancel  { background: var(--bg-muted); color: var(--text-secondary); border: 1px solid var(--border); }
.btn-cancel:hover { background: var(--bg-hover); color: var(--text-base); }
.btn-confirm { background: var(--primary); color: #fff; border: 1px solid var(--primary); }
.btn-confirm:hover { background: var(--primary-dark); }

/* Generic modal containers used in views */
.modal-box,
.modal-content {
  background: var(--bg-surface);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xl);
  padding: var(--sp-6);
  color: var(--text-base);
}

/* ── Notifications ───────────────────────────────────────── */
.notification-icon {
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
}
.notification-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--bg-surface);
}

#notification-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  border-radius: var(--r-lg);
  z-index: 200;
  overflow: hidden;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Toast ───────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  padding: 14px 18px;
  font-size: var(--text-sm);
  font-weight: 500;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--text-base);
  min-width: 280px;
  max-width: 380px;
  pointer-events: all;
  cursor: pointer;
  animation: toastIn 0.35s cubic-bezier(0.21,1.02,0.73,1) forwards;
  position: relative;
  overflow: hidden;
}
.toast.toast-hide {
  animation: toastOut 0.3s ease forwards;
}
.toast-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-top: 1px;
}
.toast-body { flex: 1; }
.toast-title {
  font-weight: 700;
  font-size: 0.82rem;
  margin-bottom: 2px;
  color: var(--text-base);
}
.toast-msg {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  font-size: 0.9rem;
  align-self: flex-start;
  opacity: 0.6;
  flex-shrink: 0;
}
.toast-close:hover { opacity: 1; }
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  animation: toastProgress 6s linear forwards;
}
.toast-success { border-left: 4px solid var(--success); }
.toast-success .toast-progress { background: var(--success); }
.toast-danger  { border-left: 4px solid var(--danger); }
.toast-danger  .toast-progress { background: var(--danger); }
.toast-info    { border-left: 4px solid var(--primary); }
.toast-info    .toast-progress { background: var(--primary); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(60px) scale(0.95); }
  to   { opacity: 1; transform: translateX(0)   scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); max-height: 120px; margin-bottom: 0; }
  to   { opacity: 0; transform: translateX(60px); max-height: 0;   margin-bottom: -10px; }
}
@keyframes toastProgress {
  from { width: 100%; }
  to   { width: 0%; }
}

/* ── Chat da Equipe (widget tipo JivoChat) ─────────────── */
#team-chat {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9990;
  font-family: inherit;
}
#team-chat-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: #fff;
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45);
  cursor: pointer;
  font-size: 1.55rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}
#team-chat-toggle:hover {
  transform: scale(1.07);
  box-shadow: 0 8px 26px rgba(79, 70, 229, 0.55);
}
#team-chat-toggle:active { transform: scale(0.96); }

#team-chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: #ef4444;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-base, #fff);
  animation: chatBadgePulse 1.4s ease-in-out infinite;
}
@keyframes chatBadgePulse {
  0%,100% { transform: scale(1); }
  50%      { transform: scale(1.15); }
}

#team-chat-window {
  position: absolute;
  bottom: 76px;
  right: 0;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 480px;
  max-height: calc(100vh - 120px);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: chatWindowIn 0.25s cubic-bezier(0.21,1.02,0.73,1);
}
/* Atributo `hidden` precisa vencer o display:flex acima */
#team-chat-window[hidden],
#team-chat-attach-preview[hidden],
#team-chat-load-older[hidden],
#team-chat-badge[hidden] {
  display: none !important;
}
@keyframes chatWindowIn {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

#team-chat-header {
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: #fff;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
#team-chat-header strong { display: block; font-size: 0.95rem; font-weight: 700; }
#team-chat-header small  { display: block; font-size: 0.72rem; opacity: 0.85; margin-top: 2px; }
#team-chat-close {
  background: rgba(255,255,255,0.18);
  border: none;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
#team-chat-close:hover { background: rgba(255,255,255,0.32); }

#team-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: var(--bg-muted);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#team-chat-messages::-webkit-scrollbar { width: 6px; }
#team-chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.team-chat-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 40px 16px;
  line-height: 1.6;
}
.team-chat-empty i { font-size: 2rem; opacity: 0.5; margin-bottom: 8px; }

.tcm {
  display: flex;
  flex-direction: column;
  max-width: 80%;
  animation: tcmIn 0.2s ease;
}
@keyframes tcmIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tcm-name {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 3px;
  padding: 0 4px;
}
.tcm-bubble {
  background: var(--bg-surface);
  color: var(--text-base);
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.4;
  word-wrap: break-word;
  border: 1px solid var(--border);
}
.tcm-time {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 3px;
  padding: 0 4px;
}

/* Mensagens do próprio usuário */
.tcm-me { align-self: flex-end; align-items: flex-end; }
.tcm-me .tcm-name { color: var(--primary); text-align: right; }
.tcm-me .tcm-bubble {
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: #fff;
  border: none;
}
.tcm-me .tcm-time { text-align: right; }

/* Mensagens dos outros */
.tcm-other { align-self: flex-start; }

#team-chat-form {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  align-items: center;
}
#team-chat-input {
  flex: 1;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-base);
  color: var(--text-base);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.15s;
  min-width: 0;
}
#team-chat-input:focus { border-color: var(--primary); }
#team-chat-form button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s;
  flex-shrink: 0;
}
#team-chat-form button:hover { background: #4f46e5; }
#team-chat-form button:active { transform: scale(0.92); }
#team-chat-form button:disabled { opacity: 0.5; cursor: not-allowed; }

/* Botões de anexo / microfone com estilo secundário */
#team-chat-attach-btn, #team-chat-mic-btn {
  background: transparent;
  color: var(--text-muted);
}
#team-chat-attach-btn:hover, #team-chat-mic-btn:hover {
  background: var(--bg-muted);
  color: var(--primary);
}
#team-chat-mic-btn.recording {
  background: #ef4444 !important;
  color: #fff !important;
  animation: micPulse 1s ease-in-out infinite;
}
@keyframes micPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.5); }
  50%      { box-shadow: 0 0 0 8px rgba(239,68,68,0); }
}

/* Preview do arquivo a enviar / gravação em andamento */
#team-chat-attach-preview {
  padding: 8px 12px;
  background: var(--bg-muted);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text-base);
  flex-shrink: 0;
}
#team-chat-attach-preview .preview-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}
#team-chat-attach-preview .preview-info i {
  font-size: 1.1rem;
  color: var(--primary);
}
#team-chat-attach-preview .preview-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#team-chat-attach-preview .preview-size {
  color: var(--text-muted);
  font-size: 0.75rem;
}
#team-chat-attach-preview .preview-thumb {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}
#team-chat-attach-preview button.preview-cancel {
  background: transparent;
  border: none;
  color: var(--danger, #ef4444);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px 8px;
}
.rec-timer { font-variant-numeric: tabular-nums; font-weight: 600; color: #ef4444; }

/* "Carregar mais antigas" */
#team-chat-load-older {
  text-align: center;
  padding: 6px 0 12px;
}
#team-chat-load-older-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--primary);
  padding: 6px 14px;
  border-radius: 14px;
  font-size: 0.78rem;
  cursor: pointer;
  font-weight: 500;
}
#team-chat-load-older-btn:hover { background: var(--bg-hover); }

/* Divisor de data (ex: "Hoje", "Ontem", "12/03/2026") */
.tcm-day-sep {
  align-self: center;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.7rem;
  padding: 3px 12px;
  border-radius: 12px;
  margin: 6px 0 2px;
  font-weight: 500;
}

/* ── Anexos dentro das mensagens ──────────────────────── */
.tcm-attach { margin-top: 4px; }

.tcm-attach-image {
  display: block;
  max-width: 220px;
  max-height: 220px;
  border-radius: 10px;
  cursor: pointer;
  object-fit: cover;
  border: 1px solid var(--border);
}

.tcm-attach-audio {
  width: 220px;
  height: 36px;
  margin-top: 4px;
}

.tcm-attach-video {
  max-width: 220px;
  max-height: 200px;
  border-radius: 10px;
  background: #000;
}

.tcm-attach-doc {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-base);
  min-width: 180px;
  max-width: 240px;
  transition: background 0.15s;
}
.tcm-attach-doc:hover { background: var(--bg-hover); }
.tcm-attach-doc i { font-size: 1.4rem; color: var(--primary); flex-shrink: 0; }
.tcm-attach-doc .doc-info { flex: 1; min-width: 0; overflow: hidden; }
.tcm-attach-doc .doc-name {
  font-weight: 600; font-size: 0.82rem; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tcm-attach-doc .doc-size { font-size: 0.7rem; color: var(--text-muted); margin-top: 1px; }

/* Em mensagens próprias (balão roxo), anexos com fundo levemente translúcido */
.tcm-me .tcm-attach-doc {
  background: rgba(255,255,255,0.95);
  border-color: transparent;
}

/* ── Reply (responder mensagem) ──────────────────────── */
.tcm { position: relative; }
.tcm:hover .tcm-reply-btn { opacity: 1; }
.tcm-reply-btn {
  position: absolute;
  top: 0;
  opacity: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 50%;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 0.72rem;
  transition: opacity 0.15s, color 0.15s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.tcm-reply-btn:hover { color: var(--primary); }
.tcm-me    .tcm-reply-btn { left: -34px; }
.tcm-other .tcm-reply-btn { right: -34px; }

/* Botão de apagar mensagem (só admin) */
.tcm-delete-btn {
  position: absolute;
  opacity: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 50%;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 0.68rem;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.tcm:hover .tcm-delete-btn { opacity: 1; }
.tcm-delete-btn:hover { color: #fff; background: #ef4444; border-color: #ef4444; }
/* Posiciona abaixo do botão de reply */
.tcm-me    .tcm-delete-btn { left: -34px; top: 32px; }
.tcm-other .tcm-delete-btn { right: -34px; top: 32px; }

/* Citação da mensagem original dentro do balão */
.tcm-quote {
  border-left: 3px solid var(--primary);
  padding: 4px 8px;
  margin-bottom: 6px;
  border-radius: 0 6px 6px 0;
  background: rgba(0,0,0,0.06);
  font-size: 0.78rem;
  line-height: 1.4;
  max-width: 100%;
  overflow: hidden;
}
.tcm-quote-name {
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1px;
  display: block;
}
.tcm-quote-text {
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.tcm-me .tcm-quote {
  background: rgba(255,255,255,0.2);
  border-left-color: rgba(255,255,255,0.7);
}
.tcm-me .tcm-quote-name { color: #e0d7ff; }
.tcm-me .tcm-quote-text { color: rgba(255,255,255,0.8); }

/* Barra de "respondendo a..." acima do input */
#team-chat-reply-bar {
  padding: 6px 12px;
  background: var(--bg-muted);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  flex-shrink: 0;
}
#team-chat-reply-bar[hidden] { display: none !important; }
.reply-bar-preview {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.reply-bar-name  { font-weight: 700; color: var(--primary); font-size: 0.75rem; }
.reply-bar-text  { color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reply-bar-cancel {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 1rem; padding: 0 4px;
}
.reply-bar-cancel:hover { color: var(--danger, #ef4444); }

/* ── @Menção autocomplete ─────────────────────────────── */
#chat-input-wrapper {
  position: relative;
  flex-shrink: 0;
}
#mention-dropdown {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 -6px 20px rgba(0,0,0,0.15);
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
}
#mention-dropdown[hidden] { display: none !important; }
.mention-item {
  padding: 8px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  transition: background 0.1s;
}
.mention-item:hover, .mention-item.active { background: var(--bg-hover); }
.mention-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.mention-name  { font-weight: 600; }
.mention-login { color: var(--text-muted); font-size: 0.75rem; }

/* Texto @nome destacado em azul dentro dos balões */
.mention-highlight {
  color: var(--primary);
  font-weight: 600;
  cursor: default;
}
.tcm-me .mention-highlight { color: #c4b5fd; }

/* Lightbox simples para ver imagens em tela cheia */
#team-chat-lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex; align-items: center; justify-content: center;
  z-index: 99999;
  cursor: zoom-out;
}
#team-chat-lightbox img {
  max-width: 92vw; max-height: 92vh;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}

/* Mobile */
@media (max-width: 480px) {
  #team-chat-window {
    width: calc(100vw - 24px);
    height: calc(100vh - 160px);
    bottom: 76px;
    right: -12px;
  }
}

/* Pulso no sino quando chega notificação nova */
@keyframes bellShake {
  0%,100% { transform: rotate(0); }
  15%      { transform: rotate(15deg); }
  30%      { transform: rotate(-12deg); }
  45%      { transform: rotate(10deg); }
  60%      { transform: rotate(-8deg); }
  75%      { transform: rotate(5deg); }
}
.bell-shake { animation: bellShake 0.6s ease; }

/* ── Kanban ──────────────────────────────────────────────── */
.kanban-controls {
  display: flex;
  justify-content: flex-end;
  margin-bottom: var(--sp-5);
}

.kanban-board {
  display: flex;
  gap: var(--sp-5);
  overflow-x: auto;
  padding-bottom: var(--sp-5);
  align-items: flex-start;
  min-height: 500px;
  height: calc(100vh - 260px);
}

.kanban-board::-webkit-scrollbar,
.kanban-items::-webkit-scrollbar { height: 6px; width: 5px; }
.kanban-board::-webkit-scrollbar-track,
.kanban-items::-webkit-scrollbar-track { background: transparent; }
.kanban-board::-webkit-scrollbar-thumb,
.kanban-items::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--r-full);
}

.kanban-column {
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  min-width: 290px;
  width: 290px;
  display: flex;
  flex-direction: column;
  max-height: 100%;
  flex-shrink: 0;
}

.kanban-column-header {
  padding: var(--sp-4);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-base);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: var(--bg-surface);
  position: sticky;
  top: 0;
  z-index: 10;
}

.kanban-items {
  padding: var(--sp-3);
  overflow-y: auto;
  flex: 1;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.kanban-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-3);
  cursor: grab;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s;
  user-select: none;
}
.kanban-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}
.kanban-card:active { cursor: grabbing; }
.kanban-card.sortable-ghost {
  opacity: 0.45;
  background: var(--bg-hover);
  border: 1px dashed var(--border-focus);
}

.kanban-card-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--sp-1);
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.kanban-card-title {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-base);
  margin-bottom: 4px;
}
.kanban-card-details {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.kanban-card-footer {
  margin-top: var(--sp-2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-xs);
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: var(--sp-2);
}
.kanban-count {
  background: var(--bg-muted);
  border: 1px solid var(--border);
  padding: 1px var(--sp-2);
  border-radius: var(--r-full);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ── Login ───────────────────────────────────────────────── */
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6);
  background: var(--bg-base);
}

.login-card {
  width: min(460px, 100%);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl);
  padding: var(--sp-10) var(--sp-8);
  animation: modalIn 0.3s ease;
}

.logo-container {
  display: flex;
  justify-content: center;
  margin-bottom: var(--sp-6);
}
.logo-text {
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.04em;
}

.login-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-base);
  text-align: center;
  margin-bottom: var(--sp-2);
  letter-spacing: -0.02em;
}
.login-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  margin-bottom: var(--sp-6);
}

.login-group { margin-bottom: var(--sp-4); }
.login-group label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.login-input {
  width: 100%;
  padding: 10px var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--input-bg);
  color: var(--text-base);
  font-size: var(--text-sm);
  font-family: var(--font);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.login-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

.btn-login {
  width: 100%;
  padding: 11px;
  border: none;
  border-radius: var(--r-md);
  font-size: var(--text-base-size);
  font-weight: 700;
  font-family: var(--font);
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 1px 3px var(--primary-glow);
  margin-top: var(--sp-2);
}
.btn-login:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px var(--primary-glow);
}

.login-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-xs);
  margin-top: var(--sp-4);
}
.login-footer a { color: var(--primary); font-weight: 500; }
.login-footer a:hover { text-decoration: underline; }

.password-wrapper { position: relative; }
.toggle-password {
  position: absolute;
  top: 50%;
  right: var(--sp-3);
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--text-muted);
  font-size: var(--text-sm);
  transition: color 0.15s;
}
.toggle-password:hover { color: var(--primary); }

.error-msg {
  margin-top: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  font-size: var(--text-sm);
  font-weight: 500;
  background: var(--danger-bg);
  color: var(--danger-text);
  border: 1px solid rgba(220,38,38,0.2);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

/* ── Report shortcuts ────────────────────────────────────── */
.report-shortcuts {
  display: flex;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
  flex-wrap: wrap;
}

/* ── Footer ──────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: var(--sp-8) 0;
  color: var(--text-muted);
  font-size: var(--text-xs);
  border-top: 1px solid var(--border);
  margin-top: var(--sp-8);
}

/* ── Utilities ───────────────────────────────────────────── */
.text-danger  { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-muted   { color: var(--text-muted) !important; }
.text-primary { color: var(--primary) !important; }

.font-bold   { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.flex        { display: flex; }
.flex-wrap   { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: var(--sp-1); }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }

.mt-0 { margin-top: 0 !important; }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mb-0 { margin-bottom: 0 !important; }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }
.p-0  { padding: 0 !important; }

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-sm     { font-size: var(--text-sm); }
.text-xs     { font-size: var(--text-xs); }

.w-full { width: 100%; }
.min-w-0 { min-width: 0; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: var(--sp-10) var(--sp-6);
  color: var(--text-muted);
}
.empty-state i { font-size: 2rem; margin-bottom: var(--sp-3); display: block; opacity: 0.4; }
.empty-state p { font-size: var(--text-sm); }

/* Section divider */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-5);
  flex-wrap: wrap;
  gap: var(--sp-3);
}
.section-title {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--text-base);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

/* Search bar row */
.search-row {
  display: flex;
  gap: var(--sp-2);
  margin-bottom: var(--sp-5);
  flex-wrap: wrap;
}
.search-row input[type="text"] {
  flex: 1;
  min-width: 200px;
  padding: 9px var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--input-bg);
  color: var(--text-base);
  font-size: var(--text-sm);
  font-family: var(--font);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-row input[type="text"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

/* Stat pill for views */
.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}
.stat-pill .stat-icon { color: var(--primary); font-size: 1.1rem; }
.stat-pill .stat-label { font-size: var(--text-xs); color: var(--text-muted); }
.stat-pill .stat-value { font-size: var(--text-lg); font-weight: 700; color: var(--primary); line-height: 1; }

/* Action button row */
.action-col {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  justify-content: flex-end;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-4) 0;
  flex-wrap: wrap;
}
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: var(--bg-surface);
  transition: all 0.15s;
  text-decoration: none;
}
.pagination a:hover { background: var(--bg-hover); color: var(--primary); border-color: var(--primary); }
.pagination .active-page { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Icons (Font Awesome) ────────────────────────────────── */
.fa, .fa-solid, .fa-regular, .fa-brands, .fa-light, .fa-thin {
  color: inherit;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .container { padding: var(--sp-4); }
  header { padding: 0 var(--sp-4); }
  .header-top { height: 54px; }
  .header-top h1 { font-size: var(--text-lg); }

  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-3);
  }
  .card { padding: var(--sp-4); }

  .kanban-board { scroll-snap-type: x mandatory; }
  .kanban-column {
    scroll-snap-align: center;
    width: 84vw;
    min-width: 84vw;
  }

  .report-shortcuts { flex-direction: column; }
  .btn-report { min-width: unset; }

  .modal-custom { padding: var(--sp-5); margin: var(--sp-4); }
  .login-card { padding: var(--sp-8) var(--sp-6); }

  /* Hide username label on mobile */
  .header-user-label { display: none; }

  .section-header { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .modal-actions { flex-direction: column; }
  .modal-actions .btn { width: 100%; }
}

/* ── Hamburger / Mobile nav ─────────────────────────────── */
.nav-hamburger   { display: none; }
.nav-mobile-only { display: none; }
.nav-mobile-divider { display: none; }

#nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 199;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
#nav-overlay.open { display: block; }

@media (max-width: 768px) {
  /* Mostra o hambúrguer */
  .nav-hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
  }

  /* Esconde Perfil/Sair do cabeçalho no mobile */
  .nav-desktop-only { display: none !important; }

  /* Nav container vira painel fixo que desce de cima */
  .nav-container {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 200;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 32px rgba(0,0,0,.18);
    padding: 68px var(--sp-4) var(--sp-5);
    transform: translateY(-110%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    overflow-y: auto;
    max-height: 92svh;
    overflow-x: visible;
    scrollbar-width: none;
    /* zera os estilos de scroll horizontal do desktop */
    justify-content: flex-start;
  }
  .nav-container::-webkit-scrollbar { display: none; }
  .nav-container.open { transform: translateY(0); }

  /* Nav menu em coluna */
  .nav-menu {
    flex-direction: column;
    min-width: unset;
    width: 100%;
    gap: 4px;
    padding: 0;
    border: none;
  }

  /* Itens maiores e em bloco */
  .nav-btn {
    width: 100%;
    padding: 13px 16px;
    font-size: var(--text-base);
    border-radius: var(--r-md);
    justify-content: flex-start;
    gap: 12px;
  }

  /* Divisor e itens exclusivos do mobile */
  .nav-mobile-divider {
    display: block;
    border: none;
    border-top: 1px solid var(--border);
    margin: 8px 0;
  }
  .nav-mobile-only { display: flex; }
}

/* ── Profile sidebar (used in perfil.php) ────────────────── */
.profile-sidebar {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
