/* assets/css/style.css — AlgaSys JBP — Design System */

/* ============================================================
   VARIÁVEIS & RESET
   ============================================================ */
:root {
  --font-main: 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --primary:     #6366f1;
  --primary-dk:  #4f46e5;
  --primary-lt:  #e0e7ff;
  --secondary:   #0ea5e9;
  --success:     #10b981;
  --warning:     #f59e0b;
  --danger:      #ef4444;
  --info:        #6366f1;

  --bg:          #f1f5f9;
  --bg-card:     #ffffff;
  --bg-sidebar:  #0f172a;
  --text-main:   #0f172a;
  --text-muted:  #64748b;
  --text-sidebar:#cbd5e1;
  --border:      #e2e8f0;
  --shadow:      0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:   0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
  --shadow-lg:   0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
  --radius:      0.75rem;
  --radius-sm:   0.5rem;
  --sidebar-w:   260px;
  --topbar-h:    64px;
  --transition:  0.2s ease;
}

[data-theme="dark"] {
  --bg:          #0f172a;
  --bg-card:     #1e293b;
  --bg-sidebar:  #020617;
  --text-main:   #f1f5f9;
  --text-muted:  #94a3b8;
  --text-sidebar:#94a3b8;
  --border:      #334155;
  --primary-lt:  #312e81;
  --shadow:      0 1px 3px rgba(0,0,0,.3);
  --shadow-md:   0 4px 6px -1px rgba(0,0,0,.3);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  font-size: 14px;
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 100;
  transition: width var(--transition), transform var(--transition);
  overflow: hidden;
}
.sidebar.collapsed { width: 72px; }
.sidebar.collapsed .brand-text,
.sidebar.collapsed .sidebar-section-label,
.sidebar.collapsed .nav-link span,
.sidebar.collapsed .user-info,
.sidebar.collapsed .sidebar-branch-selector,
.sidebar.collapsed .sidebar-branch-info span { display: none; }
.sidebar.collapsed .nav-link { justify-content: center; padding: 12px; }
.sidebar.collapsed .sidebar-footer .user-card { justify-content: center; }

.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}
.brand-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px; flex-shrink: 0;
}
.brand-name { font-size: 16px; font-weight: 800; color: #fff; display: block; }
.brand-sub  { font-size: 11px; color: #64748b; display: block; }
.sidebar-toggle-btn {
  margin-left: auto; background: none; border: none;
  color: #64748b; cursor: pointer; padding: 4px 8px;
  border-radius: var(--radius-sm); transition: color var(--transition);
}
.sidebar-toggle-btn:hover { color: #fff; }

.sidebar-branch-selector, .sidebar-branch-info {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.sidebar-section-label {
  display: block; font-size: 10px; font-weight: 700;
  color: #475569; text-transform: uppercase; letter-spacing: .08em;
  padding: 14px 16px 4px;
}
.branch-select {
  width: 100%; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1);
  color: var(--text-sidebar); border-radius: var(--radius-sm); padding: 6px 8px; font-size: 12px;
}
.sidebar-branch-info {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: #64748b;
}

.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 0; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }
.nav-section { margin-bottom: 4px; }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; color: var(--text-sidebar);
  text-decoration: none; border-radius: 0;
  transition: background var(--transition), color var(--transition);
  font-size: 13.5px; font-weight: 500;
  border-left: 3px solid transparent;
  position: relative;
}
.nav-link i { width: 18px; text-align: center; font-size: 15px; flex-shrink: 0; }
.nav-link:hover  { background: rgba(255,255,255,.05); color: #fff; }
.nav-link.active { background: rgba(99,102,241,.15); color: #818cf8; border-left-color: var(--primary); }

.sidebar-footer {
  padding: 12px; border-top: 1px solid rgba(255,255,255,.06);
  display: flex; align-items: center; gap: 8px;
}
.user-card {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; flex: 1; min-width: 0;
}
.user-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.user-name { display: block; font-size: 13px; font-weight: 600; color: #e2e8f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { display: block; font-size: 11px; color: #64748b; }
.logout-btn {
  padding: 8px; color: #64748b; text-decoration: none;
  border-radius: var(--radius-sm); transition: all var(--transition);
}
.logout-btn:hover { color: #ef4444; background: rgba(239,68,68,.1); }

/* ============================================================
   MAIN WRAPPER + TOPBAR
   ============================================================ */
.main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1; min-height: 100vh;
  display: flex; flex-direction: column;
  transition: margin-left var(--transition);
}
.main-wrapper.sidebar-collapsed { margin-left: 72px; }

.topbar {
  height: var(--topbar-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; gap: 16px;
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow);
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 12px; }
.breadcrumb-wrap { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); }
.breadcrumb-wrap a { color: var(--primary); text-decoration: none; }
.breadcrumb-wrap i { font-size: 10px; }
.breadcrumb-wrap span { color: var(--text-main); font-weight: 600; }
.mobile-menu-btn { display: none; background: none; border: none; font-size: 20px; color: var(--text-muted); cursor: pointer; }

.page-content { flex: 1; padding: 24px; }

/* ============================================================
   NOTIFICAÇÕES
   ============================================================ */
.notif-wrapper { position: relative; }
.notif-btn {
  position: relative; background: none; border: none; cursor: pointer;
  width: 40px; height: 40px; border-radius: 50%;
  color: var(--text-muted); font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.notif-btn:hover { background: var(--bg); color: var(--primary); }
.notif-badge {
  position: absolute; top: 4px; right: 4px;
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700;
  min-width: 18px; height: 18px;
  border-radius: 9px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.notif-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px);
  width: 360px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); z-index: 200;
  display: none;
}
.notif-dropdown.active { display: block; }
.notif-header { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.notif-list { max-height: 360px; overflow-y: auto; }
.notif-item { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--text-main); transition: background var(--transition); }
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: rgba(99,102,241,.04); }
.notif-item.unread::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--primary); }
.notif-icon { width: 36px; height: 36px; border-radius: 50%; background: var(--primary-lt); color: var(--primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.notif-body strong { font-size: 13px; font-weight: 600; }
.notif-body p { font-size: 12px; color: var(--text-muted); }
.notif-body small { font-size: 11px; color: var(--text-muted); }
.notif-footer { padding: 10px 16px; text-align: center; border-top: 1px solid var(--border); }
.notif-footer a { color: var(--primary); font-size: 13px; }
.notif-empty, .notif-loading { padding: 32px; text-align: center; color: var(--text-muted); }
.notif-empty i, .notif-loading i { font-size: 32px; margin-bottom: 8px; display: block; }

/* ============================================================
   TEMA BTN
   ============================================================ */
.theme-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.theme-btn:hover { background: var(--bg); color: var(--primary); }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-title { font-size: 15px; font-weight: 700; margin: 0; }
.card-body { padding: 20px; }
.card-footer { padding: 12px 20px; border-top: 1px solid var(--border); background: var(--bg); }

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  display: flex; align-items: flex-start; gap: 16px;
  transition: box-shadow var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-icon {
  width: 52px; height: 52px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.stat-icon.purple { background: rgba(99,102,241,.15); color: var(--primary); }
.stat-icon.red    { background: rgba(239,68,68,.12); color: var(--danger); }
.stat-icon.green  { background: rgba(16,185,129,.12); color: var(--success); }
.stat-icon.yellow { background: rgba(245,158,11,.12); color: var(--warning); }
.stat-icon.blue   { background: rgba(14,165,233,.12); color: var(--secondary); }
.stat-value { font-size: 28px; font-weight: 800; line-height: 1; }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.stat-change { font-size: 12px; margin-top: 6px; display: flex; align-items: center; gap: 4px; }
.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ============================================================
   TABELAS
   ============================================================ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  padding: 11px 14px; font-size: 12px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em;
  background: var(--bg); border-bottom: 2px solid var(--border);
  text-align: left; white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--border); transition: background var(--transition); }
tbody tr:hover { background: rgba(99,102,241,.03); }
tbody td { padding: 12px 14px; font-size: 13.5px; vertical-align: middle; }
tbody tr:last-child { border-bottom: none; }

/* ============================================================
   BOTÕES
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600; cursor: pointer;
  border: none; text-decoration: none; transition: all var(--transition);
  white-space: nowrap; line-height: 1;
}
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dk); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-danger:hover  { background: #dc2626; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #d97706; }
.btn-secondary { background: var(--text-muted); color: #fff; }
.btn-outline-primary { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline-primary:hover { background: var(--primary); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg); color: var(--text-main); }
.btn-group { display: flex; gap: 6px; flex-wrap: wrap; }

/* ============================================================
   FORMULÁRIOS
   ============================================================ */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-main); margin-bottom: 6px; }
.form-label .req { color: var(--danger); margin-left: 2px; }
.form-control, .form-select {
  width: 100%; padding: 9px 12px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-card); color: var(--text-main);
  font-family: var(--font-main); font-size: 13.5px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus, .form-select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
textarea.form-control { min-height: 90px; resize: vertical; }
.form-check { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.form-check input[type="checkbox"], .form-check input[type="radio"] { width: 16px; height: 16px; accent-color: var(--primary); }
.form-check label { font-size: 13.5px; cursor: pointer; }
.form-text { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.form-section { margin-bottom: 24px; }
.form-section-title { font-size: 13px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; padding-bottom: 8px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }

/* Campos de visibilidade (toggle switches) */
.field-toggle {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: var(--bg);
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  margin-bottom: 6px;
}
.toggle-switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--border); border-radius: 22px; transition: var(--transition);
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 16px; height: 16px; left: 3px; bottom: 3px;
  background: white; border-radius: 50%; transition: var(--transition);
}
.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ============================================================
   PÁGINAS / LAYOUT
   ============================================================ */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-title { font-size: 22px; font-weight: 800; }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.section-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.section-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* ============================================================
   BADGES
   ============================================================ */
.badge, [class^="bg-"] {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 20px; font-size: 12px; font-weight: 600;
}
.bg-purple-100  { background: #ede9fe; }
.text-purple-800 { color: #5b21b6; }
.bg-green-100   { background: #dcfce7; }
.text-green-800  { color: #166534; }
.bg-red-100     { background: #fee2e2; }
.text-red-800    { color: #991b1b; }
.bg-yellow-100  { background: #fef3c7; }
.text-yellow-800 { color: #92400e; }
.bg-blue-100    { background: #dbeafe; }
.text-blue-800   { color: #1e40af; }
.bg-gray-100    { background: #f3f4f6; }
.text-gray-600   { color: #4b5563; }
.bg-orange-100  { background: #ffedd5; }
.text-orange-800 { color: #9a3412; }

/* ============================================================
   AGENDA / CALENDÁRIO
   ============================================================ */
.calendar-layout { display: flex; gap: 20px; height: calc(100vh - 160px); }
.calendar-main { flex: 1; background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; }
.calendar-sidebar { width: 280px; flex-shrink: 0; display: flex; flex-direction: column; gap: 12px; }
.tasks-panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.tasks-panel-header { padding: 14px 16px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 13px; }
.tasks-panel-list { flex: 1; overflow-y: auto; padding: 8px; }
.task-item {
  padding: 10px 12px; border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
  margin-bottom: 6px; background: var(--bg);
  cursor: pointer; transition: box-shadow var(--transition);
  font-size: 13px;
}
.task-item:hover { box-shadow: var(--shadow-md); }
.task-item.overdue { border-left-color: var(--danger); }
.task-item.done    { border-left-color: var(--success); opacity: .7; }
.task-item-title { font-weight: 600; margin-bottom: 4px; }
.task-item-meta  { font-size: 11px; color: var(--text-muted); }

/* FullCalendar custom */
.fc .fc-button { background: var(--primary) !important; border-color: var(--primary) !important; font-size: 13px !important; font-family: var(--font-main) !important; }
.fc .fc-button-active, .fc .fc-button:hover { background: var(--primary-dk) !important; }
.fc .fc-toolbar-title { font-size: 16px !important; font-weight: 700 !important; color: var(--text-main) !important; }
.fc-theme-standard td, .fc-theme-standard th { border-color: var(--border) !important; }
.fc .fc-col-header-cell-cushion { color: var(--text-muted) !important; font-size: 12px !important; font-weight: 700 !important; text-transform: uppercase; }
.fc .fc-daygrid-day-number { color: var(--text-main) !important; font-weight: 600; }
.fc .fc-event { border: none !important; border-radius: 4px !important; font-size: 12px !important; font-weight: 500 !important; cursor: pointer; }
.fc-event-pending  { background: #a78bfa !important; }
.fc-event-done     { background: var(--success) !important; }
.fc-event-overdue  { background: var(--danger) !important; }
.fc-event-plan     { background: var(--warning) !important; }
.fc .fc-daygrid-day.fc-day-today { background: rgba(99,102,241,.05) !important; }

/* ============================================================
   DASHBOARD
   ============================================================ */
.top-list { list-style: none; }
.top-list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.top-list-item:last-child { border-bottom: none; }
.top-list-rank { width: 28px; height: 28px; border-radius: 50%; background: var(--bg); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; color: var(--text-muted); flex-shrink: 0; }
.top-list-rank.gold   { background: #fef3c7; color: #92400e; }
.top-list-rank.silver { background: #f3f4f6; color: #374151; }
.top-list-rank.bronze { background: #fef6ee; color: #9a3412; }
.top-list-info { flex: 1; min-width: 0; }
.top-list-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-list-sub  { font-size: 12px; color: var(--text-muted); }
.top-list-val  { font-size: 14px; font-weight: 700; color: var(--primary); }

.progress-bar-wrap { background: var(--border); border-radius: 4px; height: 6px; overflow: hidden; margin-top: 4px; }
.progress-bar { height: 100%; border-radius: 4px; background: var(--primary); transition: width .6s ease; }
.progress-bar.danger  { background: var(--danger); }
.progress-bar.success { background: var(--success); }
.progress-bar.warning { background: var(--warning); }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 500;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity var(--transition);
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-card); border-radius: var(--radius);
  width: 90%; max-width: 640px; max-height: 90vh;
  overflow-y: auto; box-shadow: var(--shadow-lg);
  transform: translateY(-20px); transition: transform var(--transition);
}
.modal-overlay.active .modal { transform: translateY(0); }
.modal-header { padding: 18px 24px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 20px; color: var(--text-muted); cursor: pointer; }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* ============================================================
   UPLOAD / FOTO
   ============================================================ */
.upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 32px; text-align: center; cursor: pointer;
  transition: all var(--transition); background: var(--bg);
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--primary); background: rgba(99,102,241,.04); }
.upload-zone i { font-size: 36px; color: var(--text-muted); margin-bottom: 12px; display: block; }
.upload-preview { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.upload-thumb { position: relative; width: 80px; height: 80px; }
.upload-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-sm); }
.upload-thumb-remove { position: absolute; top: -6px; right: -6px; background: var(--danger); color: #fff; border: none; border-radius: 50%; width: 20px; height: 20px; font-size: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* ============================================================
   ALERTAS / TOAST
   ============================================================ */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-danger   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning  { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.alert-info     { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

/* ============================================================
   FILTROS E SEARCH
   ============================================================ */
.filter-bar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: flex-end; }
.search-input { position: relative; flex: 1; min-width: 200px; }
.search-input input { padding-left: 36px; }
.search-input i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.filter-actions { display: flex; gap: 8px; }

/* ============================================================
   EMPTY STATES
   ============================================================ */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty-state i { font-size: 48px; margin-bottom: 16px; display: block; opacity: .3; }
.empty-state h3 { font-size: 16px; font-weight: 700; color: var(--text-main); margin-bottom: 8px; }
.empty-state p  { font-size: 13px; }

/* ============================================================
   PAGINAÇÃO
   ============================================================ */
.pagination { display: flex; gap: 4px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.page-item { display: inline-flex; }
.page-link {
  padding: 7px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text-main); text-decoration: none; font-weight: 500;
  transition: all var(--transition);
}
.page-link:hover, .page-link.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ============================================================
   NOTAS / RATING
   ============================================================ */
.star-rating { display: flex; gap: 4px; }
.star-rating .star { font-size: 24px; cursor: pointer; color: var(--border); transition: color var(--transition); }
.star-rating .star.active, .star-rating .star:hover { color: var(--warning); }
.score-display { font-size: 42px; font-weight: 800; color: var(--primary); line-height: 1; }
.score-label   { font-size: 13px; color: var(--text-muted); }

/* ============================================================
   CHAMADOS / TICKETS
   ============================================================ */
.ticket-thread { display: flex; flex-direction: column; gap: 16px; }
.ticket-msg { display: flex; gap: 12px; }
.ticket-msg.own { flex-direction: row-reverse; }
.ticket-msg-bubble {
  background: var(--bg); border-radius: var(--radius);
  padding: 12px 16px; max-width: 75%; border: 1px solid var(--border);
}
.ticket-msg.own .ticket-msg-bubble { background: rgba(99,102,241,.08); border-color: rgba(99,102,241,.2); }
.ticket-msg-meta { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ============================================================
   RESPONSIVO
   ============================================================ */
.sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 99; display: none; }
.sidebar-overlay.active { display: block; }

@media (max-width: 1024px) {
  .section-grid, .section-grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .mobile-menu-btn { display: flex; }
  .sidebar { transform: translateX(-100%); width: var(--sidebar-w) !important; }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-wrapper { margin-left: 0 !important; }
  .calendar-layout { flex-direction: column; height: auto; }
  .calendar-sidebar { width: 100%; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .page-content { padding: 16px; }
  .topbar { padding: 0 16px; }
  .notif-dropdown { width: 300px; right: -60px; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
}

/* Login page */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%); padding: 20px; }
.login-card { width: 100%; max-width: 440px; background: rgba(255,255,255,.03); backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,.08); border-radius: 1.5rem; padding: 48px; }
.login-logo { text-align: center; margin-bottom: 36px; }
.login-logo-icon { width: 72px; height: 72px; background: linear-gradient(135deg, var(--primary), var(--secondary)); border-radius: 1.25rem; display: inline-flex; align-items: center; justify-content: center; font-size: 32px; color: #fff; margin-bottom: 16px; }
.login-title { font-size: 24px; font-weight: 800; color: #fff; }
.login-sub   { font-size: 13px; color: rgba(255,255,255,.4); }
.login-card .form-label { color: rgba(255,255,255,.7); }
.login-card .form-control { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); color: #fff; }
.login-card .form-control::placeholder { color: rgba(255,255,255,.3); }
.login-card .form-control:focus { border-color: var(--primary); background: rgba(255,255,255,.09); }
.login-btn { width: 100%; padding: 12px; font-size: 15px; font-weight: 700; background: linear-gradient(135deg, var(--primary), var(--secondary)); border: none; border-radius: var(--radius-sm); color: #fff; cursor: pointer; transition: opacity var(--transition); margin-top: 8px; }
.login-btn:hover { opacity: .9; }
.login-footer { text-align: center; margin-top: 24px; font-size: 12px; color: rgba(255,255,255,.25); }

/* Utilitários */
.text-muted { color: var(--text-muted) !important; }
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-danger  { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-right   { text-align: right; }
.text-center  { text-align: center; }
.d-flex       { display: flex; }
.align-center { align-items: center; }
.gap-2        { gap: 8px; }
.gap-3        { gap: 12px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.fw-bold { font-weight: 700; }
.fw-600  { font-weight: 600; }
.fs-sm   { font-size: 12px; }
.fs-xs   { font-size: 11px; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-none { display: none !important; }
.d-md-inline { display: none; }
@media (min-width: 768px) { .d-md-inline { display: inline; } }
