﻿/* ═══════════════════════════════════════════════════════════
   Coditech — Gestão TCC  |  Design System v3
═══════════════════════════════════════════════════════════ */
:root {
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
  --font-icon: "Material Symbols Outlined";

  /* Palette */
  --indigo-50:  #eef2ff;
  --indigo-100: #e0e7ff;
  --indigo-200: #c7d2fe;
  --indigo-400: #818cf8;
  --indigo-500: #6366f1;
  --indigo-600: #4f46e5;
  --indigo-700: #4338ca;
  --indigo-800: #3730a3;
  --violet-500: #8b5cf6;
  --violet-600: #7c3aed;
  --slate-50:   #f8fafc;
  --slate-100:  #f1f5f9;
  --slate-200:  #e2e8f0;
  --slate-300:  #cbd5e1;
  --slate-400:  #94a3b8;
  --slate-500:  #64748b;
  --slate-600:  #475569;
  --slate-700:  #334155;
  --slate-800:  #1e293b;
  --slate-900:  #0f172a;

  /* Semantic */
  --color-bg:            #f0f4ff;
  --color-surface:       #ffffff;
  --color-surface-2:     #f8fafc;
  --color-text:          var(--slate-900);
  --color-text-muted:    var(--slate-500);
  --color-text-subtle:   var(--slate-400);
  --color-border:        var(--slate-200);
  --color-primary:       var(--indigo-600);
  --color-primary-hover: var(--indigo-700);
  --color-primary-light: var(--indigo-100);
  --color-primary-soft:  rgba(99, 102, 241, 0.1);
  --color-accent:        var(--violet-600);
  --color-danger:        #dc2626;
  --color-danger-soft:   #fef2f2;
  --color-success:       #059669;
  --color-success-soft:  #ecfdf5;

  /* Gradient principal */
  --grad-primary: linear-gradient(135deg, var(--indigo-600) 0%, var(--violet-600) 100%);
  --grad-subtle:  linear-gradient(135deg, var(--indigo-50) 0%, #ede9fe 100%);

  /* Sidebar */
  --sidebar-bg:          var(--slate-900);
  --sidebar-text:        var(--slate-400);
  --sidebar-text-hover:  #f1f5f9;
  --sidebar-hover-bg:    rgba(255,255,255,0.06);
  --sidebar-active-bg:   rgba(99,102,241,0.2);
  --sidebar-active-text: #a5b4fc;
  --sidebar-border:      rgba(255,255,255,0.07);
  --sidebar-section:     var(--slate-600);

  /* Radii */
  --r-xs: 4px; --r-sm: 8px; --r-md: 12px;
  --r-lg: 16px; --r-xl: 20px; --r-2xl: 24px; --r-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(15,23,42,.05);
  --shadow-sm: 0 1px 3px 0 rgba(15,23,42,.08), 0 1px 2px -1px rgba(15,23,42,.05);
  --shadow-md: 0 4px 16px -2px rgba(15,23,42,.1), 0 2px 6px -2px rgba(15,23,42,.06);
  --shadow-lg: 0 16px 48px -8px rgba(15,23,42,.14), 0 6px 16px -4px rgba(15,23,42,.08);
  --shadow-inset: inset 0 2px 4px 0 rgba(15,23,42,.06);
  --shadow-primary: 0 4px 14px 0 rgba(99,102,241,.35);

  /* Layout */
  --sidebar-w:   260px;
  --topbar-h:    62px;

  /* Motion */
  --ease:     cubic-bezier(.4,0,.2,1);
  --ease-out: cubic-bezier(0,0,.2,1);
  --ease-in:  cubic-bezier(.4,0,1,1);
  --t1: .12s; --t2: .22s; --t3: .35s;
}

@media (prefers-reduced-motion: reduce) {
  :root { --t1: .01ms; --t2: .01ms; --t3: .01ms; }
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: .9375rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Background mesh */
body.app--with-sidebar {
  background-color: var(--color-bg);
  background-image:
    radial-gradient(at 20% 10%, rgba(99,102,241,.07) 0, transparent 50%),
    radial-gradient(at 80% 90%, rgba(139,92,246,.06) 0, transparent 50%);
}

/* ── Icons ───────────────────────────────────────────────── */
.material-symbols-outlined {
  font-family: "Material Symbols Outlined", sans-serif;
  font-weight: normal; font-style: normal;
  font-size: 1.25rem; line-height: 1;
  letter-spacing: normal; text-transform: none;
  display: inline-block; white-space: nowrap;
  direction: ltr; -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 1,'wght' 400,'GRAD' 0,'opsz' 24;
}

/* ── Generic icon span ──────────────────────────────────── */
.icon {
  font-family: var(--font-icon);
  font-weight: normal; font-style: normal;
  font-size: 1.1rem; line-height: 1;
  display: inline-block; white-space: nowrap;
  direction: ltr; -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 1,'wght' 400,'GRAD' 0,'opsz' 24;
  vertical-align: middle;
}

/* ── Skip link ───────────────────────────────────────────── */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 9999;
  padding: .6rem 1rem; background: var(--color-primary);
  color: #fff; font-weight: 600; text-decoration: none;
  border-radius: var(--r-sm);
}
.skip-link:focus { left: .5rem; top: .5rem; }

/* ══════════════════════════════════════════════════════════
   SHELL
══════════════════════════════════════════════════════════ */
.app-shell { min-height: 100vh; display: flex; }
.app-layout { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.app-main   { display: flex; flex-direction: column; flex: 1; }

/* ══════════════════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════════════════ */
.app-sidebar {
  background: var(--sidebar-bg);
  width: var(--sidebar-w);
  flex-shrink: 0;
  display: flex; flex-direction: column;
  position: sticky; top: 0;
  height: 100vh;
  overflow: hidden;
  border-right: 1px solid var(--sidebar-border);
  transition: width var(--t2) var(--ease), transform var(--t2) var(--ease);
  z-index: 50;
}

/* ── Brand ──────────────────────────────────────────────── */
.sidebar-brand {
  display: flex; align-items: center; gap: .65rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.sidebar-brand__img {
  width: 34px; height: 34px;
  object-fit: cover; border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.15);
  flex-shrink: 0;
}

.sidebar-brand__name {
  font-size: .8125rem; font-weight: 700;
  color: #e2e8f0; letter-spacing: -.01em;
  white-space: nowrap;
}

/* ── Nav ────────────────────────────────────────────────── */
.app-sidebar__nav {
  display: flex; flex-direction: column;
  padding: .6rem .6rem 1rem;
  gap: .1rem; overflow-y: auto;
  overscroll-behavior: contain; flex: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.08) transparent;
}

.sidebar-section-label {
  font-size: .6375rem; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase;
  color: var(--slate-600);
  padding: .9rem .75rem .3rem;
  user-select: none;
}

.sidebar-link {
  display: flex; align-items: center; gap: .65rem;
  padding: .55rem .75rem;
  border-radius: var(--r-md);
  color: var(--sidebar-text);
  text-decoration: none;
  font-weight: 500; font-size: .875rem;
  transition: background var(--t1), color var(--t1);
  white-space: nowrap;
}

.sidebar-link:hover {
  background: var(--sidebar-hover-bg);
  color: var(--sidebar-text-hover);
}

.sidebar-link:focus-visible { outline: 2px solid var(--indigo-400); outline-offset: 2px; }

.sidebar-link--active {
  background: var(--sidebar-active-bg) !important;
  color: var(--sidebar-active-text) !important;
}
.sidebar-link--active .sidebar-link__icon { color: var(--sidebar-active-text) !important; }
.sidebar-link--danger:hover { background: rgba(220,38,38,.12); color: #fca5a5; }

.sidebar-link__icon {
  font-size: 1.15rem; width: 1.3rem;
  flex-shrink: 0; color: var(--slate-600);
  transition: color var(--t1); line-height: 1;
}
.sidebar-link:hover .sidebar-link__icon { color: var(--sidebar-text-hover); }
.sidebar-link__text { white-space: nowrap; }
.sidebar-spacer { flex: 1; min-height: 1rem; }

/* ── User card ──────────────────────────────────────────── */
.sidebar-user {
  display: flex; align-items: center; gap: .6rem;
  padding: .65rem .75rem;
  border-top: 1px solid var(--sidebar-border);
  margin-bottom: .2rem;
}

.sidebar-user__avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--grad-primary);
  color: #fff; display: flex; align-items: center;
  justify-content: center; font-size: .72rem; font-weight: 700;
  flex-shrink: 0;
}

.sidebar-user__info { min-width: 0; flex: 1; }

.sidebar-user__name {
  font-size: .8rem; font-weight: 600;
  color: var(--sidebar-text-hover);
  word-break: break-word;
  line-height: 1.3;
}
.sidebar-user__role { font-size: .7rem; color: var(--slate-600); }

/* ── Collapsed / Mobile ─────────────────────────────────── */
@media (min-width: 1024px) {
  body.app--sidebar-collapsed .app-sidebar {
    width: 0; border-right: 0;
    overflow: hidden; pointer-events: none;
  }
}

@media (max-width: 1023.98px) {
  .app-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    transform: translateX(-100%);
  }
  body.app--sidebar-mobile-open .app-sidebar {
    transform: translateX(0);
    box-shadow: 4px 0 32px rgba(15,23,42,.2);
  }
  body.app--sidebar-mobile-open { overflow: hidden; }

  .sidebar-backdrop {
    position: fixed; inset: 0; z-index: 45;
    background: rgba(15,23,42,.5);
    backdrop-filter: blur(4px);
    opacity: 0; pointer-events: none;
    transition: opacity var(--t2) var(--ease);
  }
  body.app--sidebar-mobile-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  body.app--sidebar-mobile-open .sidebar-backdrop[hidden] { display: block; }
}

/* ══════════════════════════════════════════════════════════
   TOPBAR
══════════════════════════════════════════════════════════ */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid rgba(226,232,240,.8);
  box-shadow: 0 1px 0 rgba(15,23,42,.04);
}

.topbar__inner {
  padding: 0 clamp(16px,3vw,28px);
  min-height: var(--topbar-h);
  display: flex; align-items: center;
  justify-content: space-between; gap: 1rem;
}

.topbar__brand { display: flex; align-items: center; gap: .65rem; min-width: 0; }

.topbar__menu-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--color-text-muted); cursor: pointer;
  transition: all var(--t1);
  flex-shrink: 0;
}
.topbar__menu-btn:hover {
  background: var(--indigo-50); border-color: var(--indigo-200);
  color: var(--indigo-600);
}
.topbar__menu-btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.topbar__menu-icon { font-size: 1.25rem; display: block; line-height: 1; }

.topbar__title {
  font-size: .9375rem; font-weight: 700;
  letter-spacing: -.02em; color: var(--color-text);
}

.topbar__actions { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }

.topbar__user-chip {
  display: flex; align-items: center; gap: .45rem;
  padding: .25rem .65rem .25rem .25rem;
  border: 1px solid var(--color-border);
  border-radius: var(--r-full);
  background: var(--color-surface);
  box-shadow: var(--shadow-xs);
  cursor: default;
}

.topbar__user-avatar {
  width: 27px; height: 27px; border-radius: 50%;
  background: var(--grad-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 700; flex-shrink: 0;
}

.topbar__user-name {
  font-size: .8rem; font-weight: 600; color: var(--color-text);
  white-space: nowrap; display: none;
}
@media (min-width: 580px) { .topbar__user-name { display: block; } }

/* ══════════════════════════════════════════════════════════
   MAIN AREA
══════════════════════════════════════════════════════════ */
.main-area {
  flex: 1;
  padding: clamp(20px,3vw,36px) 0 clamp(32px,4vw,56px);
  animation: pageIn var(--t3) var(--ease-out) both;
}

.main-area--auth {
  padding: 0;
  animation: none;
  display: flex;
  flex-direction: column;
}

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

.container {
  width: 100%; max-width: 1080px;
  margin: 0 auto;
  padding: 0 clamp(14px,3vw,28px);
}

/* ══════════════════════════════════════════════════════════
   PAGE HEADER
══════════════════════════════════════════════════════════ */
.page-header {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 1.75rem; flex-wrap: wrap;
  padding: 1.35rem 1.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--grad-subtle);
  opacity: .6;
  pointer-events: none;
}

.page-header::after {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--grad-primary);
  border-radius: var(--r-full) 0 0 var(--r-full);
}

.page-header__icon {
  width: 44px; height: 44px;
  border-radius: var(--r-md);
  background: var(--grad-primary);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-icon); font-size: 1.25rem;
  color: #fff; flex-shrink: 0; line-height: 1;
  box-shadow: var(--shadow-primary);
  position: relative; z-index: 1;
}

.page-header__title {
  margin: 0;
  font-size: clamp(1.15rem,1rem + .8vw,1.45rem);
  font-weight: 800; letter-spacing: -.03em;
  position: relative; z-index: 1;
}

.page-header__sub {
  margin: .15rem 0 0;
  font-size: .825rem; color: var(--color-text-muted);
  position: relative; z-index: 1;
}

/* ══════════════════════════════════════════════════════════
   CARDS
══════════════════════════════════════════════════════════ */
.card {
  background: var(--color-surface);
  border-radius: var(--r-lg);
  padding: clamp(1rem,2.5vw,1.5rem);
  margin-bottom: 1.15rem;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t2) var(--ease), border-color var(--t2) var(--ease);
}

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

.card h2, .card h3 {
  margin-top: 0;
  font-size: clamp(.95rem,.9rem + .4vw,1.1rem);
  letter-spacing: -.02em;
}

.card--destaque {
  border-color: var(--indigo-200);
  box-shadow: 0 0 0 3px var(--color-primary-soft), var(--shadow-sm);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%,260px),1fr));
  gap: clamp(12px,2vw,20px);
}

/* ══════════════════════════════════════════════════════════
   SECTION HEADER
══════════════════════════════════════════════════════════ */
.section-hd {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem; gap: .5rem; flex-wrap: wrap;
}

.section-hd__title {
  margin: 0; font-size: .9375rem; font-weight: 700;
  letter-spacing: -.015em;
  display: flex; align-items: center; gap: .4rem;
}

.section-hd__icon {
  font-family: var(--font-icon); font-size: 1.1rem;
  color: var(--color-primary); line-height: 1;
}

.count-badge {
  font-size: .7rem; font-weight: 700;
  padding: .2rem .6rem;
  border-radius: var(--r-full);
  background: var(--indigo-100);
  color: var(--indigo-700);
  letter-spacing: .02em;
}

/* ══════════════════════════════════════════════════════════
   LABELS & FORM CONTROLS
══════════════════════════════════════════════════════════ */
label {
  display: block; margin-top: .85rem;
  font-weight: 600; font-size: .8rem;
  color: var(--slate-700); letter-spacing: .01em;
}
label:first-of-type, .card > label:first-child { margin-top: 0; }

input, select, textarea {
  width: 100%; max-width: 100%;
  padding: .6rem .85rem;
  margin-top: .28rem;
  font: inherit; font-size: .875rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--r-sm);
  background: var(--slate-50);
  color: var(--color-text);
  transition: border-color var(--t1), box-shadow var(--t1), background var(--t1);
  outline: none;
  -webkit-appearance: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--indigo-500);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}

input::placeholder, textarea::placeholder {
  color: var(--slate-400); font-weight: 400;
}

textarea { min-height: 96px; resize: vertical; line-height: 1.6; }

select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .75rem center;
  padding-right: 2.25rem;
}

input[type="file"] {
  padding: .5rem .75rem;
  background: var(--slate-50);
  cursor: pointer;
  font-size: .825rem;
}

/* ══════════════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════════════ */
button {
  width: 100%; max-width: 100%;
  padding: .6rem .85rem; margin-top: .28rem;
  font: inherit; font-size: .875rem; font-weight: 500;
  border: 1.5px solid var(--color-border);
  border-radius: var(--r-sm);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  transition: all var(--t1);
  line-height: 1.4;
}

/* Primary submit button */
button[type="submit"],
.card button:not([type]) {
  width: auto; min-width: 120px;
  padding: .62rem 1.5rem; margin-top: 1.1rem;
  background: var(--grad-primary);
  border: 0; color: #fff; font-weight: 600;
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-primary);
  letter-spacing: .01em;
}

button[type="submit"]:hover,
.card button:not([type]):hover {
  filter: brightness(1.1);
  box-shadow: 0 6px 20px rgba(99,102,241,.45);
  transform: translateY(-1px);
}

button[type="submit"]:active,
.card button:not([type]):active {
  transform: translateY(0); filter: brightness(.97);
}

button[type="submit"]:focus-visible,
.card button:not([type]):focus-visible {
  outline: 2px solid var(--color-primary); outline-offset: 2px;
}

button:disabled {
  opacity: .55; cursor: not-allowed;
  pointer-events: none; transform: none !important;
}

/* Danger */
.btn-perigo, button.btn-perigo {
  background: linear-gradient(135deg,#dc2626,#b91c1c) !important;
  color: #fff !important; border: 0 !important;
  box-shadow: 0 2px 8px rgba(220,38,38,.25) !important;
  font-weight: 600 !important;
}
.btn-perigo:hover, button.btn-perigo:hover {
  filter: brightness(1.08) !important;
  box-shadow: 0 4px 16px rgba(220,38,38,.35) !important;
  transform: translateY(-1px) !important;
}

/* Small */
.btn-sm {
  padding: .35rem .75rem !important;
  margin-top: 0 !important; font-size: .78rem !important;
  min-width: auto !important;
}

/* Edit */
.btn-editar {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .35rem .85rem; font-size: .8rem; font-weight: 600;
  border-radius: var(--r-sm);
  background: var(--indigo-50); color: var(--indigo-700);
  text-decoration: none; border: 1px solid var(--indigo-200);
  vertical-align: middle;
  transition: all var(--t1);
}
.btn-editar:hover { background: var(--indigo-100); color: var(--indigo-800); }

/* Cancel */
.btn-cancel {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .85rem; color: var(--color-text-muted);
  text-decoration: none; font-weight: 500; margin-bottom: 1rem;
  transition: color var(--t1);
}
.btn-cancel:hover { color: var(--color-text); }
.btn-cancel .icon { font-family: var(--font-icon); font-size: 1rem; line-height: 1; }

/* Form inline crud */
.form-excluir-inline { display: inline-block; vertical-align: middle; }
.form-excluir-inline button.btn-perigo { width: auto; min-width: auto; margin-top: 0; }
.form-excluir button.btn-perigo { width: auto; min-width: auto; margin-top: 1.35rem; padding: .6rem 1rem; }

/* ══════════════════════════════════════════════════════════
   ALERTS
══════════════════════════════════════════════════════════ */
.alerta {
  display: flex; align-items: center; gap: .65rem;
  padding: .8rem 1rem; border-radius: var(--r-md);
  margin-bottom: 1.25rem; font-size: .875rem; font-weight: 500;
  animation: slideDown var(--t2) var(--ease-out) both;
}

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

.alerta .material-symbols-outlined { font-size: 1.1rem; flex-shrink: 0; }

.alerta.erro {
  background: #fef2f2; color: #991b1b;
  border: 1px solid #fecaca;
}
.alerta.sucesso {
  background: var(--color-success-soft); color: #065f46;
  border: 1px solid #a7f3d0;
}

/* ══════════════════════════════════════════════════════════
   STATUS BADGES
══════════════════════════════════════════════════════════ */
.status-badge {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .25rem .75rem; border-radius: var(--r-full);
  font-size: .7rem; font-weight: 700;
  white-space: nowrap; letter-spacing: .04em; text-transform: uppercase;
}

.status-badge::before {
  content: ''; width: 6px; height: 6px;
  border-radius: 50%; flex-shrink: 0;
}

.status-badge--pendente     { background: var(--slate-100); color: var(--slate-600); }
.status-badge--pendente::before { background: var(--slate-400); }

.status-badge--em_andamento { background: var(--indigo-50); color: var(--indigo-700); border: 1px solid var(--indigo-200); }
.status-badge--em_andamento::before { background: var(--indigo-500); box-shadow: 0 0 0 2px rgba(99,102,241,.25); animation: pulse 1.8s infinite; }

.status-badge--concluida    { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.status-badge--concluida::before { background: #22c55e; }

.status-badge--validada     { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.status-badge--validada::before { background: #16a34a; }

.status-badge--rejeitada    { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.status-badge--rejeitada::before { background: #dc2626; }

@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(99,102,241,.4); }
  50%      { box-shadow: 0 0 0 4px rgba(99,102,241,.0); }
}

/* ══════════════════════════════════════════════════════════
   EMPTY STATE
══════════════════════════════════════════════════════════ */
.empty-state {
  display: flex; flex-direction: column;
  align-items: center; gap: .65rem;
  padding: 3rem 1rem; text-align: center;
  color: var(--color-text-muted);
}

.empty-state__icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--grad-subtle);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-icon); font-size: 1.75rem;
  color: var(--indigo-400); line-height: 1;
}

.empty-state p { margin: 0; font-size: .875rem; }

/* ══════════════════════════════════════════════════════════
   FILTER BAR
══════════════════════════════════════════════════════════ */
.filter-bar {
  display: flex; flex-wrap: wrap;
  align-items: flex-end; gap: .65rem;
}
.filter-bar__group { flex: 1; min-width: min(100%,180px); }
.filter-bar__group label { margin-top: 0; font-size: .78rem; }
.filter-bar__group input,
.filter-bar__group select { margin-top: .25rem; }
.filter-bar button {
  flex: 0 0 auto; width: auto; min-width: auto;
  margin-top: 0; align-self: flex-end;
}

/* ══════════════════════════════════════════════════════════
   TASK ITEMS
══════════════════════════════════════════════════════════ */
.tarefa-item {
  border: 1.5px solid var(--color-border);
  border-radius: var(--r-md);
  padding: 1.1rem 1.25rem;
  margin-bottom: .65rem;
  background: var(--color-surface);
  transition: box-shadow var(--t2), border-color var(--t2), transform var(--t1);
  position: relative; overflow: hidden;
}

.tarefa-item::before {
  content: ''; position: absolute;
  left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--slate-200);
  border-radius: var(--r-full) 0 0 var(--r-full);
  transition: background var(--t2);
}

.tarefa-item:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--indigo-200);
  transform: translateY(-1px);
}

.tarefa-item:hover::before { background: var(--grad-primary); }

.tarefa-item[data-status="em_andamento"]::before { background: var(--indigo-500); }
.tarefa-item[data-status="concluida"]::before    { background: #22c55e; }
.tarefa-item[data-status="validada"]::before     { background: #16a34a; }
.tarefa-item[data-status="rejeitada"]::before    { background: #dc2626; }
.tarefa-item:last-child { margin-bottom: 0; }

.tarefa-item__head {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: .75rem;
  flex-wrap: wrap; margin-bottom: .4rem;
}

.tarefa-item__title { font-weight: 700; font-size: .9375rem; }

.tarefa-item__meta {
  font-size: .775rem; color: var(--color-text-muted);
  margin-top: .2rem;
  display: flex; align-items: center; gap: .35rem; flex-wrap: wrap;
}
.tarefa-item__meta .icon { font-family: var(--font-icon); font-size: .875rem; line-height: 1; }
.tarefa-item__desc { font-size: .875rem; color: var(--slate-600); margin: .5rem 0 0; line-height: 1.6; }

.tarefa-actions {
  display: flex; flex-wrap: wrap; gap: .5rem;
  margin-top: .9rem; padding-top: .9rem;
  border-top: 1px solid var(--color-border);
}
.tarefa-actions button,
.tarefa-actions input[type="submit"] {
  width: auto; min-width: auto; margin: 0; padding: .45rem .9rem; font-size: .8125rem;
}

.tarefa-feedback {
  background: #fef2f2; border: 1px solid #fecaca;
  border-radius: var(--r-sm); padding: .6rem .9rem;
  font-size: .825rem; color: #991b1b; margin-top: .65rem;
  display: flex; align-items: flex-start; gap: .4rem;
}
.tarefa-feedback .icon { font-family: var(--font-icon); font-size: 1rem; flex-shrink: 0; }

/* ══════════════════════════════════════════════════════════
   TABLES
══════════════════════════════════════════════════════════ */
.tabela-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  border-radius: var(--r-md); border: 1px solid var(--color-border);
  margin-top: .25rem;
}

table, .tabela-cadastro {
  width: 100%; border-collapse: collapse; font-size: .875rem;
}

th, td, .tabela-cadastro th, .tabela-cadastro td {
  padding: .7rem .9rem; text-align: left;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

thead th, .tabela-cadastro thead th {
  background: var(--slate-50); font-weight: 700;
  font-size: .7rem; text-transform: uppercase;
  letter-spacing: .06em; color: var(--slate-500);
  white-space: nowrap;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--t1); }
tbody tr:hover td { background: var(--indigo-50); }

.tabela-cadastro__acoes { text-align: right; white-space: nowrap; }
.tabela-cadastro__acoes .form-excluir-inline { display: inline-block; vertical-align: middle; margin-left: .35rem; }

/* ══════════════════════════════════════════════════════════
   FILE ITEMS
══════════════════════════════════════════════════════════ */
.file-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem .25rem;
  border-bottom: 1px solid var(--color-border);
  transition: background var(--t1), padding var(--t1);
  border-radius: var(--r-sm);
}
.file-item:last-child { border-bottom: 0; padding-bottom: .25rem; }
.file-item:hover { background: var(--indigo-50); padding-left: .5rem; padding-right: .5rem; }

.file-item__icon {
  width: 40px; height: 40px; border-radius: var(--r-md);
  background: var(--indigo-50); display: flex;
  align-items: center; justify-content: center;
  font-family: var(--font-icon); font-size: 1.25rem;
  color: var(--indigo-500); flex-shrink: 0;
}
.file-item__info { flex: 1; min-width: 0; }
.file-item__name { font-weight: 600; font-size: .875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item__meta { font-size: .75rem; color: var(--color-text-muted); margin-top: .1rem; }

/* ══════════════════════════════════════════════════════════
   CRONOGRAMA
══════════════════════════════════════════════════════════ */
.cron-item {
  display: flex; gap: 1rem; padding: .9rem 0;
  border-bottom: 1px solid var(--color-border);
  align-items: flex-start;
}
.cron-item:last-child { border-bottom: 0; padding-bottom: 0; }

.cron-date {
  min-width: 52px; text-align: center;
  background: var(--grad-primary);
  border-radius: var(--r-md); padding: .55rem .4rem;
  flex-shrink: 0; box-shadow: var(--shadow-primary);
}
.cron-date__day { font-size: 1.35rem; font-weight: 800; color: #fff; line-height: 1; }
.cron-date__month { font-size: .62rem; font-weight: 700; color: rgba(255,255,255,.8); text-transform: uppercase; letter-spacing: .07em; margin-top: .1rem; }

.cron-body { flex: 1; min-width: 0; }
.cron-title { font-weight: 600; font-size: .9rem; }
.cron-desc { font-size: .8rem; color: var(--color-text-muted); margin-top: .2rem; }

/* ══════════════════════════════════════════════════════════
   DIÁRIO
══════════════════════════════════════════════════════════ */
.diario-item {
  border: 1.5px solid var(--color-border);
  border-radius: var(--r-md); padding: 1.1rem 1.25rem;
  margin-bottom: .65rem;
  transition: box-shadow var(--t2), border-color var(--t2);
}
.diario-item:last-child { margin-bottom: 0; }
.diario-item:hover { box-shadow: var(--shadow-md); border-color: var(--indigo-200); }

.diario-item__head {
  display: flex; align-items: center;
  justify-content: space-between; gap: .5rem;
  flex-wrap: wrap; margin-bottom: .6rem;
  padding-bottom: .6rem; border-bottom: 1px solid var(--color-border);
}
.diario-item__date {
  font-weight: 600; font-size: .825rem;
  display: flex; align-items: center; gap: .3rem;
  color: var(--indigo-600);
}
.diario-item__date .icon { font-family: var(--font-icon); font-size: .95rem; line-height: 1; }
.diario-item__author {
  font-size: .775rem; color: var(--color-text-muted);
  background: var(--slate-100); padding: .15rem .55rem;
  border-radius: var(--r-full); font-weight: 500;
}

/* ══════════════════════════════════════════════════════════
   GRUPOS ALUNOS FIELDSET
══════════════════════════════════════════════════════════ */
.grupo-alunos-fieldset {
  border: 1.5px solid var(--color-border);
  border-radius: var(--r-md); padding: .85rem 1rem; margin-top: .85rem;
}
.grupo-alunos-fieldset legend {
  padding: 0 .4rem; font-weight: 700;
  font-size: .8rem; color: var(--slate-700);
}
.grupo-alunos-lista {
  display: flex; flex-direction: column; gap: .15rem;
  margin-top: .5rem; max-height: 210px; overflow-y: auto;
}
.grupo-aluno-item {
  display: flex; align-items: center; gap: .5rem;
  font-size: .875rem; padding: .35rem .5rem;
  border-radius: var(--r-sm); cursor: pointer;
  transition: background var(--t1);
}
.grupo-aluno-item:hover { background: var(--indigo-50); }
.grupo-aluno-item input[type="checkbox"] {
  width: auto; min-width: auto; margin: 0; padding: 0; border: none;
  flex-shrink: 0; accent-color: var(--color-primary);
}

/* ══════════════════════════════════════════════════════════
   LISTA CRUD
══════════════════════════════════════════════════════════ */
.lista-crud .item-crud {
  display: flex; flex-wrap: wrap;
  align-items: flex-end; gap: .75rem 1rem;
  padding: .75rem 0; border-top: 1px solid var(--color-border);
}
.lista-crud .item-crud:first-child { border-top: 0; }

.form-inline-crud { flex: 1; min-width: min(100%,240px); }
.form-inline-crud input[type="text"] { margin-top: .25rem; }
.form-excluir { flex-shrink: 0; }
.item-crud--stack .form-inline-crud { flex: 1 1 100%; }

/* Login antigo removido — substituído pelo layout split em auth/login.php */

/* ══════════════════════════════════════════════════════════
   MISC
══════════════════════════════════════════════════════════ */
.item { border-top: 1px solid var(--color-border); padding-top: 1rem; margin-top: 1rem; }

.numero {
  font-size: clamp(1.75rem,1.5rem + 1.5vw,2.25rem);
  font-weight: 800; letter-spacing: -.04em; color: var(--color-primary);
}

.aviso-grupo {
  color: var(--color-text-muted); font-size: .875rem; margin-bottom: .75rem;
  display: flex; align-items: center; gap: .35rem;
}

/* Sidebar active (JS) */
.sidebar-link--active {
  background: var(--sidebar-active-bg) !important;
  color: var(--sidebar-active-text) !important;
}
