/* =====================================================
   F4CIL DESIGN SYSTEM
   Cores: Roxo #5A2D91  |  Laranja #F06423
   ===================================================== */

:root {
  --purple:       #5A2D91;
  --purple-dark:  #3d1e64;
  --purple-light: #7b4db5;
  --purple-pale:  #f0eaf8;
  --orange:       #F06423;
  --orange-dark:  #c94e1a;
  --orange-light: #ff8c50;
  --orange-pale:  #fff3ed;

  --gray-50:  #f8f9fa;
  --gray-100: #f1f3f5;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-400: #ced4da;
  --gray-500: #adb5bd;
  --gray-600: #6c757d;
  --gray-700: #495057;
  --gray-800: #343a40;
  --gray-900: #212529;

  --success: #28a745;
  --danger:  #dc3545;
  --warning: #ffc107;
  --info:    #17a2b8;

  --sidebar-w: 240px;
  --header-h:  60px;
  --radius:    8px;
  --radius-lg: 14px;
  --shadow:    0 2px 8px rgba(0,0,0,.10);
  --shadow-lg: 0 4px 20px rgba(0,0,0,.14);

  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body { font-family: var(--font); background: var(--gray-100); color: var(--gray-900); }
a { color: var(--purple); text-decoration: none; }
a:hover { color: var(--purple-light); }

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

/* ── SIDEBAR ─────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--purple-dark);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  transition: transform .25s ease;
}

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-logo .logo-mark {
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -1px;
}
.sidebar-logo .logo-mark span { color: var(--orange); }
.sidebar-logo small {
  display: block;
  color: rgba(255,255,255,.5);
  font-size: 10px;
  letter-spacing: .5px;
}

.sidebar-polo {
  margin: 12px 14px;
  background: rgba(255,255,255,.08);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.sidebar-polo .polo-label { color: rgba(255,255,255,.45); font-size: 10px; text-transform: uppercase; letter-spacing: .5px; }
.sidebar-polo .polo-name  { color: #fff; font-size: 13px; font-weight: 600; margin-top: 2px; }

.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,.15); border-radius: 4px; }

.nav-group { margin-bottom: 4px; }
.nav-group-label {
  padding: 10px 20px 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: rgba(255,255,255,.35);
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: rgba(255,255,255,.75);
  font-size: 13px;
  border-radius: 0;
  cursor: pointer;
  transition: background .15s, color .15s;
  border-left: 3px solid transparent;
}
.nav-item i { font-size: 15px; width: 18px; text-align: center; }
.nav-item:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}
.nav-item.active {
  background: rgba(240,100,35,.18);
  color: #fff;
  border-left-color: var(--orange);
}

.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 12px 14px;
}
.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--orange);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.user-name  { color: #fff; font-size: 12px; font-weight: 600; }
.user-role  { color: rgba(255,255,255,.45); font-size: 11px; }
.btn-logout {
  width: 100%;
  padding: 7px;
  background: rgba(220,53,69,.15);
  border: 1px solid rgba(220,53,69,.3);
  color: #ff8888;
  border-radius: var(--radius);
  font-size: 12px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: background .15s;
}
.btn-logout:hover { background: rgba(220,53,69,.3); }

/* ── MAIN CONTENT ────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--header-h);
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-800);
  flex: 1;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }

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

/* ── CARDS ───────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 20px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gray-200);
}
.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-800);
}

/* ── KPI CARDS ───────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.kpi-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.kpi-icon.purple { background: var(--purple-pale); color: var(--purple); }
.kpi-icon.orange { background: var(--orange-pale); color: var(--orange); }
.kpi-icon.green  { background: #eafaf1; color: var(--success); }
.kpi-icon.red    { background: #fdecea; color: var(--danger); }
.kpi-body {}
.kpi-label { font-size: 11px; color: var(--gray-600); text-transform: uppercase; letter-spacing: .4px; font-weight: 600; }
.kpi-value { font-size: 22px; font-weight: 800; color: var(--gray-900); margin-top: 2px; line-height: 1; }
.kpi-sub   { font-size: 11px; color: var(--gray-500); margin-top: 4px; }

/* ── BUTTONS ─────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn-primary   { background: var(--purple); color: #fff; }
.btn-primary:hover { background: var(--purple-dark); color: #fff; }
.btn-secondary { background: var(--gray-100); color: var(--gray-700); border: 1px solid var(--gray-300); }
.btn-secondary:hover { background: var(--gray-200); }
.btn-orange    { background: var(--orange); color: #fff; }
.btn-orange:hover { background: var(--orange-dark); color: #fff; }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-icon { padding: 7px; }

/* ── FORMS ───────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--gray-700); margin-bottom: 5px; }
.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--gray-900);
  background: #fff;
  transition: border .15s, box-shadow .15s;
}
.form-control:focus {
  outline: none;
  border-color: var(--purple-light);
  box-shadow: 0 0 0 3px rgba(90,45,145,.12);
}
.form-control::placeholder { color: var(--gray-400); }
select.form-control { cursor: pointer; }

/* ── TABLE ───────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead tr { background: var(--gray-50); }
th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: .4px;
  border-bottom: 2px solid var(--gray-200);
  white-space: nowrap;
}
td {
  padding: 11px 14px;
  font-size: 13px;
  color: var(--gray-800);
  border-bottom: 1px solid var(--gray-100);
}
tbody tr:hover { background: var(--gray-50); }
tbody tr:last-child td { border-bottom: none; }

/* ── BADGES ──────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.badge-success { background: #eafaf1; color: #1a7a3c; }
.badge-danger  { background: #fdecea; color: #b71c1c; }
.badge-warning { background: #fff8e1; color: #8a6900; }
.badge-info    { background: #e8f4f8; color: #0a5d7a; }
.badge-purple  { background: var(--purple-pale); color: var(--purple); }
.badge-orange  { background: var(--orange-pale); color: var(--orange-dark); }

/* ── TABS ────────────────────────────────────────────── */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--gray-200); margin-bottom: 20px; }
.tab-btn {
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
}
.tab-btn.active { color: var(--purple); border-bottom-color: var(--purple); }
.tab-btn:hover  { color: var(--purple-light); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── SEARCH BAR ──────────────────────────────────────── */
.search-bar {
  position: relative;
  max-width: 320px;
}
.search-bar i {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 14px;
}
.search-bar input {
  padding-left: 34px;
}

/* ── PAGINATION ──────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 16px;
}
.page-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius);
  border: 1px solid var(--gray-300);
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  color: var(--gray-700);
  transition: all .15s;
}
.page-btn:hover   { background: var(--purple-pale); border-color: var(--purple-light); color: var(--purple); }
.page-btn.active  { background: var(--purple); border-color: var(--purple); color: #fff; }
.page-btn:disabled { opacity: .4; cursor: default; }

/* ── MODAL ───────────────────────────────────────────── */
.modal-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 999;
  align-items: center;
  justify-content: center;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp .2s ease;
}
@keyframes slideUp {
  from { transform: translateY(24px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--gray-200);
}
.modal-title { font-size: 15px; font-weight: 700; color: var(--gray-900); }
.modal-close {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--gray-100);
  cursor: pointer;
  border: none;
  font-size: 16px;
  color: var(--gray-600);
}
.modal-close:hover { background: var(--gray-200); }
.modal-body    { padding: 20px 22px; }
.modal-footer  { padding: 14px 22px; border-top: 1px solid var(--gray-200); display: flex; justify-content: flex-end; gap: 8px; }

/* ── TOAST ───────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 9999;
}
.toast {
  padding: 12px 18px;
  border-radius: var(--radius);
  background: var(--gray-900);
  color: #fff;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px;
  animation: slideUp .2s ease;
  min-width: 240px;
}
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
.toast.warning { background: #e07b00; }

/* ── LOADING ─────────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(90,45,145,.2);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(255,255,255,.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 9998;
}

/* ── EMPTY STATE ─────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--gray-500);
}
.empty-state i { font-size: 48px; margin-bottom: 12px; opacity: .4; }
.empty-state p { font-size: 14px; }

/* ── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .page-body { padding: 16px; }
}

/* ── LOGIN PAGE ──────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  background: var(--purple-dark);
}
.login-brand {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: linear-gradient(135deg, var(--purple-dark) 0%, var(--purple) 100%);
  position: relative;
  overflow: hidden;
}
.login-brand::before {
  content: '4';
  position: absolute;
  font-size: 420px;
  font-weight: 900;
  color: rgba(255,255,255,.04);
  right: -60px; bottom: -80px;
  line-height: 1;
  font-family: var(--font);
}
.login-brand .brand-logo {
  font-size: 52px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -2px;
  line-height: 1;
}
.login-brand .brand-logo span { color: var(--orange); }
.login-brand .brand-tagline {
  color: rgba(255,255,255,.6);
  font-size: 14px;
  margin-top: 8px;
  letter-spacing: 1px;
}
.login-brand .brand-desc {
  margin-top: 32px;
  max-width: 300px;
  text-align: center;
  color: rgba(255,255,255,.5);
  font-size: 13px;
  line-height: 1.6;
}
.login-form-panel {
  width: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  padding: 40px;
}
.login-box { width: 100%; }
.login-box h2 { font-size: 22px; font-weight: 800; color: var(--gray-900); margin-bottom: 4px; }
.login-box p  { font-size: 13px; color: var(--gray-500); margin-bottom: 28px; }
.login-box .form-control { padding: 11px 14px; font-size: 14px; }
.login-box .btn-primary { width: 100%; padding: 12px; font-size: 14px; justify-content: center; }
.login-error {
  background: #fdecea;
  border: 1px solid #f5c6cb;
  border-radius: var(--radius);
  padding: 10px 14px;
  color: #b71c1c;
  font-size: 13px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
@media (max-width: 768px) {
  .login-brand { display: none; }
  .login-form-panel { width: 100%; }
}

/* ── POLO SELECTION ──────────────────────────────────── */
.polo-select-page {
  min-height: 100vh;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.polo-select-box {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 36px 40px;
  width: 100%;
  max-width: 960px;
}
.polo-select-box h2 { font-size: 20px; font-weight: 800; color: var(--gray-900); margin-bottom: 4px; }
.polo-select-box p  { font-size: 13px; color: var(--gray-500); margin-bottom: 24px; }
.polo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.polo-card {
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  text-align: center;
}
.polo-card:hover  { border-color: var(--purple-light); background: var(--purple-pale); }
.polo-card.active { border-color: var(--purple); background: var(--purple-pale); }
.polo-card i  { font-size: 24px; color: var(--purple); margin-bottom: 8px; }
.polo-card .polo-card-name { font-size: 13px; font-weight: 700; color: var(--gray-800); }
.polo-card .polo-card-cod  { font-size: 11px; color: var(--gray-500); margin-top: 2px; }

/* =====================================================
   AGENDAMENTO F4CIL — estilos adicionais (mobile-first)
   ===================================================== */

/* ── AGENDAMENTO LAYOUT ───────────────────────────────── */
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  margin: 12px 14px;
  background: rgba(255,255,255,.08);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.user-avatar-lg {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--orange); color: #fff;
  font-size: 16px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.user-name-lg  { color: #fff; font-size: 13px; font-weight: 600; }
.user-ra       { color: rgba(255,255,255,.5); font-size: 11px; }
.user-curso    { color: rgba(255,255,255,.45); font-size: 10px; margin-top: 1px; }

.topbar-logout {
  color: rgba(255,255,255,.7); font-size: 18px;
  padding: 6px; border-radius: 6px;
  transition: background .15s, color .15s;
}
.topbar-logout:hover { background: rgba(255,255,255,.1); color: #fff; }

/* ── BOTTOM NAV (mobile) ──────────────────────────────── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 64px;
  background: #fff;
  border-top: 1px solid var(--gray-200);
  display: flex; align-items: center;
  z-index: 200;
  box-shadow: 0 -2px 10px rgba(0,0,0,.08);
}
.bottom-nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px; padding: 8px 0;
  color: var(--gray-500); font-size: 10px;
  transition: color .15s;
}
.bottom-nav-item i { font-size: 20px; }
.bottom-nav-item.active { color: var(--purple); }

/* ── HERO CARD ────────────────────────────────────────── */
.hero-card {
  background: var(--purple);
  border-radius: var(--radius-lg);
  padding: 20px; color: #fff;
  margin-bottom: 20px;
  box-shadow: var(--shadow-lg);
}
.hero-card .hero-nome   { font-size: 20px; font-weight: 700; line-height: 1.3; }
.hero-card .hero-curso  { font-size: 13px; color: rgba(255,255,255,.75); margin-top: 4px; }
.hero-card .hero-meta   { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.hero-card .hero-badge  { background: rgba(255,255,255,.12); border-radius: 20px; padding: 4px 12px; font-size: 12px; color: rgba(255,255,255,.9); }
.hero-card .hero-badge span { color: var(--orange); font-weight: 700; }

/* ── MENU CARDS ───────────────────────────────────────── */
.menu-section-label {
  font-size: 12px; font-weight: 600; color: var(--gray-600);
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: 10px;
}
.menu-cards { display: flex; flex-direction: column; gap: 10px; }
.menu-card {
  display: flex; align-items: center; gap: 14px;
  background: #fff; border-radius: var(--radius-lg);
  padding: 16px; box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
  cursor: pointer; transition: box-shadow .15s, transform .1s;
  text-decoration: none;
}
.menu-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); color: inherit; }
.menu-card-icon {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--purple-pale);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.menu-card-icon i { font-size: 18px; color: var(--purple); }
.menu-card-icon.orange { background: var(--orange-pale); }
.menu-card-icon.orange i { color: var(--orange); }
.menu-card-body { flex: 1; }
.menu-card-title { font-size: 15px; font-weight: 600; color: var(--gray-900); }
.menu-card-desc  { font-size: 12px; color: var(--gray-600); margin-top: 2px; }
.menu-card-arrow { color: var(--gray-400); font-size: 14px; }

/* ── LIST CARDS ───────────────────────────────────────── */
.list-card {
  display: block; background: #fff; border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200); box-shadow: var(--shadow);
  overflow: hidden; margin-bottom: 10px; cursor: pointer;
  transition: box-shadow .15s; text-decoration: none;
}
.list-card:hover { box-shadow: 0 4px 20px rgba(90,45,145,.12); border-color: var(--purple-pale); }
.list-card-inner { display: flex; align-items: center; padding: 14px 16px; gap: 12px; }
.list-card-icon {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--purple-pale);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.list-card-icon i { color: var(--purple); font-size: 16px; }
.list-card-icon.done   { background: #e6f4ea; }
.list-card-icon.done i { color: var(--success); }
.list-card-body { flex: 1; min-width: 0; }
.list-card-title { font-size: 15px; font-weight: 600; color: var(--gray-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-card-sub   { font-size: 12px; color: var(--gray-600); margin-top: 2px; }
.list-card-arrow { color: var(--gray-400); font-size: 14px; flex-shrink: 0; }
.badge-done { background: #e6f4ea; color: var(--success); font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 20px; white-space: nowrap; }
.badge-pend { background: var(--orange-pale); color: var(--orange-dark); font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 20px; white-space: nowrap; }

/* ── AGENDAMENTO CARD ─────────────────────────────────── */
.ag-card { background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--gray-200); box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 10px; }
.ag-card-disciplina { font-size: 15px; font-weight: 600; color: var(--purple); margin-bottom: 6px; }
.ag-card-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.ag-meta-chip { display: flex; align-items: center; gap: 5px; background: var(--gray-100); border-radius: 20px; padding: 4px 10px; font-size: 12px; color: var(--gray-700); }
.ag-meta-chip i { font-size: 11px; color: var(--gray-500); }
.ag-card-footer { display: flex; justify-content: space-between; align-items: center; }
.ag-card-status { font-size: 12px; font-weight: 600; }
.ag-card-status.realizada { color: var(--success); }
.ag-card-status.pendente  { color: var(--orange); }
.btn-cancelar {
  background: #fef2f2; border: 1px solid #fecaca; color: var(--danger);
  border-radius: var(--radius); padding: 7px 14px; font-size: 13px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; gap: 6px; transition: background .15s;
}
.btn-cancelar:hover { background: #fee2e2; }

/* ── CONFIRMA CARD ────────────────────────────────────── */
.confirma-card { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 24px; margin-bottom: 20px; }
.confirma-row { display: flex; justify-content: space-between; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--gray-200); }
.confirma-row:last-child { border-bottom: none; }
.confirma-label { font-size: 12px; color: var(--gray-600); font-weight: 500; }
.confirma-value { font-size: 14px; font-weight: 600; color: var(--gray-900); text-align: right; max-width: 60%; }

/* ── MEDIA CALC ───────────────────────────────────────── */
.media-card { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }

/* Abas de tipo */
.tipo-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tipo-tab {
  flex: 1; padding: 10px; border-radius: var(--radius-lg); border: 2px solid var(--gray-200);
  background: #fff; font-size: 14px; font-weight: 600; color: var(--gray-600);
  cursor: pointer; transition: all .15s; text-align: center;
}
.tipo-tab.active { border-color: var(--purple); background: var(--purple-pale); color: var(--purple); }

/* Campos com peso */
.nota-row { display: flex; gap: 12px; margin-bottom: 14px; }
.nota-input-group { flex: 1; }
.nota-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.nota-header .form-label { margin: 0; }
.peso-badge { background: var(--purple-pale); color: var(--purple); font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }

/* Tag fórmula */
.formula-tag { background: var(--gray-100); border-radius: var(--radius); padding: 8px 12px; font-size: 12px; color: var(--gray-600); text-align: center; margin-top: 4px; font-family: monospace; }

/* Card resultado */
.media-result-card { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 20px; margin-bottom: 16px; border-top: 4px solid var(--purple); }
.media-result-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.media-result-label { font-size: 12px; color: var(--gray-600); margin-bottom: 4px; }
.media-result-num { font-size: 52px; font-weight: 900; color: var(--purple); line-height: 1; }
.media-result-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 700; }
.badge-aprovado  { background: #e6f4ea; color: var(--success); }
.badge-ef        { background: #fff3e0; color: #e65100; }
.badge-reprovado { background: #fef2f2; color: var(--danger); }
.media-result-msg { font-size: 13px; color: var(--gray-700); margin-bottom: 14px; }

/* Barra de progresso */
.media-progress-wrap { margin-bottom: 4px; }
.media-progress-bar { position: relative; height: 10px; background: var(--gray-200); border-radius: 10px; overflow: visible; margin-bottom: 20px; }
.media-progress-fill { height: 100%; border-radius: 10px; transition: width .4s ease, background .3s; background: var(--purple); }
.media-progress-mark { position: absolute; top: -4px; transform: translateX(-50%); }
.media-progress-mark::before { content: ''; display: block; width: 2px; height: 18px; background: var(--gray-400); margin: 0 auto; }
.media-progress-mark span { display: block; font-size: 10px; color: var(--gray-500); text-align: center; margin-top: 2px; white-space: nowrap; }
.media-progress-mark-ef::before { background: var(--orange); }
.media-progress-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--gray-400); }

/* Exame Final */
.ef-divider { height: 1px; background: var(--gray-200); margin: 16px 0; }
.ef-title { font-size: 14px; font-weight: 700; color: var(--gray-800); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.ef-title i { color: var(--orange); }
.ef-needed { font-size: 13px; color: var(--gray-700); background: #fff3e0; border-radius: var(--radius); padding: 8px 12px; }
.ef-resultado { background: var(--gray-100); border-radius: var(--radius-lg); padding: 16px; margin-top: 12px; text-align: center; }
.ef-mf-label { font-size: 12px; color: var(--gray-600); margin-bottom: 4px; }
.ef-mf-num { font-size: 36px; font-weight: 900; color: var(--purple); line-height: 1; margin-bottom: 8px; }
.ef-mf-status { font-size: 13px; font-weight: 600; }
.ef-aprovado { color: var(--success); }
.ef-reprovado { color: var(--danger); }

/* Info card */
.media-info-card { background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--gray-200); padding: 16px; margin-bottom: 16px; }
.media-info-row { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--gray-700); padding: 6px 0; }
.media-info-row i { font-size: 14px; flex-shrink: 0; margin-top: 1px; }

/* Legado - mantido para compatibilidade */
.media-result { background: var(--purple-pale); border-radius: var(--radius-lg); padding: 20px; text-align: center; margin-top: 16px; }
.media-result.aprovado .media-result-num { color: var(--success); }
.media-result.reprovado .media-result-num { color: var(--danger); }

/* ── VOLTAR TOPO ──────────────────────────────────────── */
.btn-voltar-topo { margin-bottom: 12px; }
.ag-voltar-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--gray-500); font-size: 14px; font-weight: 500;
  text-decoration: none; padding: 4px 0; transition: color .15s;
}
.ag-voltar-link:hover { color: var(--purple); }
.ag-voltar-link i { font-size: 11px; }

/* ── STEPS ────────────────────────────────────────────── */
.steps-faixa { background: var(--gray-100); border-radius: var(--radius-lg); padding: 10px 12px; margin-bottom: 16px; }
.steps { display: flex; align-items: center; justify-content: center; gap: 4px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--gray-500); }
.step-dot { width: 24px; height: 24px; border-radius: 50%; background: var(--gray-200); color: var(--gray-500); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.step.active .step-dot { background: var(--purple); color: #fff; }
.step.done .step-dot   { background: var(--success); color: #fff; }
.step-line { width: 20px; height: 2px; background: var(--gray-200); }

/* ── SECTION HEADING ──────────────────────────────────── */
.section-title { font-size: 18px; font-weight: 700; color: var(--gray-900); margin-bottom: 4px; }
.section-sub   { font-size: 13px; color: var(--gray-600); margin-bottom: 16px; }

/* ── CONTEXT BANNER ───────────────────────────────────── */
.ag-context { background: var(--purple-pale); border-radius: var(--radius-lg); padding: 10px 14px; margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
.ag-context-item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--gray-700); overflow: hidden; }
.ag-context-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--purple); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 9px; }
.ag-context-text { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── LOADING / EMPTY ──────────────────────────────────── */
.loading-center { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 0; gap: 12px; color: var(--gray-600); }
.loading-center .spin-purple { width: 36px; height: 36px; border: 3px solid var(--purple-pale); border-top-color: var(--purple); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { text-align: center; padding: 48px 24px; color: var(--gray-600); }
.empty-state i { font-size: 40px; color: var(--gray-400); margin-bottom: 12px; display: block; }
.empty-state p { font-size: 14px; margin-bottom: 16px; }

/* ── BOTÕES AGENDAMENTO ───────────────────────────────── */
.btn-orange {
  background: linear-gradient(135deg, var(--orange), var(--orange-dark));
  color: #fff; box-shadow: 0 4px 14px rgba(240,100,35,.35);
}
.btn-full { width: 100%; }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }

/* ── DESKTOP ≥ 768px (agendamento) ───────────────────── */
@media (min-width: 768px) {
  .bottom-nav { display: none; }
  .menu-cards { display: grid; grid-template-columns: repeat(2, 1fr); }
}

/* ── AGENDAMENTO LAYOUT (scoped) ──────────────────────── */
.ag-layout .main-content { flex: 1; min-width: 0; display: flex; flex-direction: column; padding-bottom: 64px; }
.ag-layout .page-body    { padding: 16px; flex: 1; max-width: 640px; }

@media (min-width: 768px) {
  .ag-layout .main-content { padding-bottom: 0; }
  .ag-layout .page-body    { padding: 24px; max-width: 640px; }
}
