/* AlfaCiclo 5.1.7 — refinamento premium EXCLUSIVO do modo claro.\n   Nenhuma regra deste arquivo se aplica ao modo escuro. */

html[data-theme="light"] {
  --light-canvas: #f4f7fb;
  --light-canvas-2: #f8fbfd;
  --light-surface: rgba(255,255,255,.94);
  --light-surface-solid: #ffffff;
  --light-surface-soft: #f7fafc;
  --light-surface-tint: #f0f8f7;
  --light-border: rgba(64,88,120,.12);
  --light-border-strong: rgba(64,88,120,.18);
  --light-text: #17283e;
  --light-text-2: #3c5068;
  --light-muted: #718197;
  --light-teal: #0f9f91;
  --light-teal-dark: #0c776f;
  --light-blue: #2378c9;
  --light-shadow-xs: 0 1px 2px rgba(24,45,74,.035);
  --light-shadow-sm: 0 8px 24px rgba(28,52,83,.055);
  --light-shadow-md: 0 16px 42px rgba(27,51,82,.075);

  --rail-bg: #f4f7fb;
  --rail-bg-soft: rgba(255,255,255,.90);
  --rail-border: rgba(67,91,125,.12);
  --rail-line: rgba(67,91,125,.10);
  --rail-text: #1c2e46;
  --rail-muted: #74849b;
  --rail-hover: rgba(29,116,179,.065);
  --rail-active-a: #e9f5ff;
  --rail-active-b: #edf9f6;
  --rail-shadow: 14px 0 38px rgba(38,59,88,.075);
  --rail-control-bg: rgba(255,255,255,.94);
  --rail-control-hover: #eef6fb;
  --rail-control-border: rgba(67,91,125,.14);
  --rail-account-bg: rgba(255,255,255,.94);

  --surface: #ffffff;
  --surface-alt: #f5f8fb;
  --surface-soft: #eef8f6;
  --line: #e1e8ef;
  --line-strong: #d4dee8;
  --ink-950: #17283e;
  --ink-800: #263b53;
  --ink-700: #3b5068;
  --ink-600: #566a80;
  --ink-500: #728297;
}

html[data-theme="light"],
html[data-theme="light"] body {
  background:
    radial-gradient(circle at 8% 0%, rgba(20,184,166,.070), transparent 31rem),
    radial-gradient(circle at 100% 4%, rgba(59,130,246,.065), transparent 34rem),
    radial-gradient(circle at 82% 100%, rgba(250,204,21,.035), transparent 29rem),
    linear-gradient(180deg, var(--light-canvas-2) 0%, var(--light-canvas) 52%, #f2f6fa 100%) !important;
  color: var(--light-text);
}
html[data-theme="light"] .rail-workspace,
html[data-theme="light"] .rail-page-content,
html[data-theme="light"] .page-content,
html[data-theme="light"] .page-container {
  background: transparent !important;
}

/* Sidebar clara: superfície premium, não uma versão lavada do dark. */
html[data-theme="light"] .app-rail {
  background:
    radial-gradient(circle at 18% -5%, rgba(20,184,166,.085), transparent 15rem),
    radial-gradient(circle at 108% 62%, rgba(59,130,246,.05), transparent 18rem),
    linear-gradient(180deg, #f8fafc 0%, #f3f6fa 100%) !important;
  border-right-color: var(--rail-border) !important;
  box-shadow: var(--rail-shadow) !important;
}
html[data-theme="light"] .rail-brand {
  background: rgba(255,255,255,.86) !important;
  border-color: rgba(69,94,128,.12) !important;
  box-shadow: 0 10px 30px rgba(42,65,97,.055), inset 0 1px 0 rgba(255,255,255,.95) !important;
  backdrop-filter: blur(15px);
}
html[data-theme="light"] .rail-brand-mark {
  background:
    radial-gradient(circle at 30% 24%, rgba(45,212,191,.20), transparent 58%),
    linear-gradient(145deg,#e9f8f6,#edf5fc) !important;
  border-color: rgba(16,143,132,.15) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 8px 18px rgba(28,111,128,.07);
}
html[data-theme="light"] .rail-brand-text strong { color: #16324a !important; }
html[data-theme="light"] .rail-brand-text small { color: #72869a !important; }
html[data-theme="light"] .rail-collapse,
html[data-theme="light"] .rail-close {
  border-color: rgba(255,255,255,.96) !important;
  background: linear-gradient(145deg,#158e86,#126d79) !important;
  box-shadow: 0 9px 19px rgba(16,111,111,.20) !important;
}
html[data-theme="light"] .rail-collapse:hover,
html[data-theme="light"] .rail-close:hover { background: linear-gradient(145deg,#10a294,#0e7280) !important; }
html[data-theme="light"] .rail-section-title {
  color: #7a899d !important;
}
html[data-theme="light"] .rail-scroll { scrollbar-color: rgba(92,115,145,.22) transparent; }
html[data-theme="light"] .rail-scroll::-webkit-scrollbar-thumb { background: rgba(92,115,145,.22) !important; }
html[data-theme="light"] .rail-nav-link {
  color: #31485f !important;
}
html[data-theme="light"] .rail-nav-link:hover {
  background: linear-gradient(90deg, rgba(229,239,248,.88), rgba(239,247,250,.50)) !important;
  color: #173750 !important;
}
html[data-theme="light"] .rail-nav-icon {
  background: color-mix(in srgb, var(--rail-tone) 8%, white) !important;
  border-color: color-mix(in srgb, var(--rail-tone) 16%, #e4eaf0) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
}
html[data-theme="light"] .rail-nav-link.active {
  color: #123d58 !important;
  background:
    linear-gradient(90deg, rgba(15,159,145,.10), rgba(35,120,201,.055)),
    #f8fcfc !important;
  border: 1px solid rgba(15,137,128,.12);
  box-shadow: 0 8px 18px rgba(25,83,111,.055), inset 3px 0 0 #13a997 !important;
}
html[data-theme="light"] .rail-nav-link.active .rail-nav-icon {
  color: #0f837a !important;
  background: linear-gradient(145deg,#e2f6f2,#e7f2fb) !important;
  border-color: rgba(15,137,128,.13) !important;
}
html[data-theme="light"] .rail-nav-link.active::after {
  width: 7px; height: 7px;
  background: #13a997 !important;
  box-shadow: 0 0 0 4px rgba(19,169,151,.11) !important;
}
html[data-theme="light"] .rail-footer {
  background: linear-gradient(180deg, rgba(244,247,251,0), rgba(244,247,251,.98) 15%) !important;
  border-top-color: rgba(67,91,125,.10) !important;
}
html[data-theme="light"] .app-rail .theme-menu-rail .theme-trigger,
html[data-theme="light"] .rail-font-stepper,
html[data-theme="light"] .rail-account {
  background: rgba(255,255,255,.88) !important;
  border-color: rgba(67,91,125,.13) !important;
  box-shadow: 0 5px 16px rgba(39,63,94,.035) !important;
}
html[data-theme="light"] .app-rail .theme-menu-rail .theme-trigger:hover,
html[data-theme="light"] .rail-font-button:hover:not(:disabled),
html[data-theme="light"] .rail-font-reset:hover,
html[data-theme="light"] .rail-account:hover {
  background: #eef6fa !important;
}
html[data-theme="light"] .rail-account-avatar {
  background: linear-gradient(145deg,#129b91,#247cca) !important;
  box-shadow: 0 7px 16px rgba(18,123,145,.15);
}

/* Superfícies gerais */
html[data-theme="light"] :is(.card,.metric-card,.entity-card,.analytics-filter-card,.filter-card,.filter-bar,.panel,.student-row,.fluency-task-panel,.network-result-card,.operational-card,.roster-mobile-card) {
  border-color: var(--light-border) !important;
}
html[data-theme="light"] :is(.card,.entity-card,.analytics-filter-card,.filter-card,.filter-bar,.panel,.student-row,.fluency-task-panel,.network-result-card,.roster-mobile-card) {
  background: var(--light-surface) !important;
  box-shadow: var(--light-shadow-sm) !important;
}
html[data-theme="light"] .card {
  border-radius: 20px;
  overflow: hidden;
}
html[data-theme="light"] .card:hover,
html[data-theme="light"] .entity-card:hover {
  border-color: rgba(15,159,145,.20) !important;
  box-shadow: var(--light-shadow-md) !important;
}
html[data-theme="light"] .card-header {
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,251,253,.94)) !important;
  border-bottom-color: rgba(67,91,125,.095) !important;
}
html[data-theme="light"] .card-header h2,
html[data-theme="light"] .card-header h3 { color: #21364d !important; }
html[data-theme="light"] .card-header p { color: #73849a !important; }
html[data-theme="light"] .card-empty-icon {
  background: linear-gradient(145deg,#eaf8f5,#eef5fb) !important;
  color: #168d83 !important;
  box-shadow: inset 0 0 0 1px rgba(15,137,128,.07) !important;
}

html[data-theme="light"] .page-header {
  border-color: rgba(52,90,115,.10) !important;
  background:
    radial-gradient(circle at 92% 10%, rgba(45,212,191,.10), transparent 15rem),
    linear-gradient(135deg, rgba(255,255,255,.96), rgba(246,251,252,.94)) !important;
  box-shadow: 0 12px 32px rgba(32,61,90,.055) !important;
}
html[data-theme="light"] .page-header::before {
  background: radial-gradient(circle, rgba(59,130,246,.09), rgba(59,130,246,0) 69%) !important;
}
html[data-theme="light"] .page-header h1 { color: #19344b !important; }
html[data-theme="light"] .page-header p { color: #657a8e !important; }

/* Filtros e formulários */
html[data-theme="light"] :is(.filter-bar,.analytics-filter-card,.filter-card) {
  background: rgba(255,255,255,.91) !important;
  border-color: rgba(67,91,125,.11) !important;
  box-shadow: 0 8px 24px rgba(32,58,88,.042) !important;
}
html[data-theme="light"] .filter-group label,
html[data-theme="light"] label { color: #4f6378; }
html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea {
  border-color: #d8e1e9 !important;
  background-color: #fbfdff !important;
  color: #1e344c !important;
  box-shadow: inset 0 1px 0 rgba(20,44,72,.015);
}
html[data-theme="light"] input:hover,
html[data-theme="light"] select:hover,
html[data-theme="light"] textarea:hover { border-color: #becbd8 !important; }
html[data-theme="light"] input:focus,
html[data-theme="light"] select:focus,
html[data-theme="light"] textarea:focus {
  border-color: #18a99a !important;
  background: #fff !important;
  box-shadow: 0 0 0 4px rgba(20,184,166,.10) !important;
}
html[data-theme="light"] input:disabled,
html[data-theme="light"] select:disabled,
html[data-theme="light"] textarea:disabled {
  background: #f0f3f6 !important;
  color: #8794a4 !important;
}

/* Tabelas */
html[data-theme="light"] .table-wrap {
  border-color: rgba(67,91,125,.09) !important;
  scrollbar-color: #b9c7d3 transparent !important;
}
html[data-theme="light"] .data-table th {
  background: #f5f8fb !important;
  color: #53677d !important;
  border-bottom-color: #dfe6ed !important;
}
html[data-theme="light"] .data-table td { border-bottom-color: #e9eef3 !important; }
html[data-theme="light"] .data-table tbody tr:hover { background: #f3f9fb !important; }
html[data-theme="light"] .table-primary { color: #223950 !important; }
html[data-theme="light"] .table-secondary { color: #748397 !important; }
html[data-theme="light"] .pagination {
  background: linear-gradient(180deg,#fff,#f8fafc) !important;
  border-color: rgba(67,91,125,.10) !important;
}

/* Botões: turquesa/azul em vez do amarelo legado. */
html[data-theme="light"] .btn-primary {
  color: #fff !important;
  border-color: transparent !important;
  background: linear-gradient(110deg,#0d9488 0%,#14b8a6 55%,#2a75c5 132%) !important;
  box-shadow: 0 9px 20px rgba(15,148,136,.17) !important;
}
html[data-theme="light"] .btn-primary:hover:not(:disabled) {
  background: linear-gradient(110deg,#0f766e 0%,#0d9488 55%,#236ab4 132%) !important;
  box-shadow: 0 12px 25px rgba(15,148,136,.22) !important;
}
html[data-theme="light"] .btn-secondary {
  color: #344b63 !important;
  border-color: #d6e0e8 !important;
  background: linear-gradient(180deg,#fff,#f7fafc) !important;
  box-shadow: 0 3px 10px rgba(29,52,82,.035) !important;
}
html[data-theme="light"] .btn-secondary:hover:not(:disabled) {
  border-color: #b9cbd7 !important;
  background: #f2f8fa !important;
}
html[data-theme="light"] .btn-ghost:hover:not(:disabled) {
  background: #edf7f5 !important;
  color: #173f48 !important;
}

/* Indicadores */
html[data-theme="light"] .metric-card {
  background:
    linear-gradient(150deg, rgba(255,255,255,.98) 0%, rgba(251,253,255,.98) 68%, color-mix(in srgb, var(--metric-tint, #eef6fb) 24%, white) 100%) !important;
  border-color: rgba(67,91,125,.10) !important;
  box-shadow: 0 9px 26px rgba(31,57,88,.05) !important;
}
html[data-theme="light"] .metric-card:hover {
  transform: translateY(-2px);
  border-color: rgba(15,159,145,.17) !important;
  box-shadow: 0 15px 34px rgba(31,57,88,.075) !important;
}
html[data-theme="light"] .metric-value { color: #19384c !important; }
html[data-theme="light"] .metric-foot,
html[data-theme="light"] .metric-card small { color: #708295 !important; }

/* Dashboard: mantém a identidade multicolorida, mas integra ao novo canvas. */
html[data-theme="light"] .dashboard-hero {
  border-color: rgba(36,112,127,.10) !important;
  background:
    radial-gradient(circle at 10% 8%, rgba(45,212,191,.20), transparent 27%),
    radial-gradient(circle at 91% 8%, rgba(250,204,21,.12), transparent 23%),
    radial-gradient(circle at 92% 94%, rgba(139,92,246,.075), transparent 28%),
    radial-gradient(circle at 0% 100%, rgba(59,130,246,.09), transparent 30%),
    linear-gradient(135deg,#f3fffc 0%,#f7fbff 52%,#fffef6 100%) !important;
  box-shadow: 0 18px 46px rgba(30,74,96,.075), inset 0 1px rgba(255,255,255,.95) !important;
}
html[data-theme="light"] .dashboard-filter-panel {
  background: rgba(255,255,255,.90) !important;
  border-color: rgba(52,90,115,.10) !important;
  box-shadow: 0 10px 27px rgba(30,65,91,.045) !important;
}
html[data-theme="light"] .dashboard-home .card,
html[data-theme="light"] .dashboard-home .metric-card {
  background-color: rgba(255,255,255,.94) !important;
}

/* Modais e menus flutuantes */
html[data-theme="light"] .modal,
html[data-theme="light"] .dropdown,
html[data-theme="light"] .theme-popover,
html[data-theme="light"] .font-size-popover,
html[data-theme="light"] .power-table-filter-popover,
html[data-theme="light"] .power-table-column-menu {
  background: #fff !important;
  border-color: rgba(67,91,125,.13) !important;
  box-shadow: 0 22px 58px rgba(25,48,78,.15) !important;
}
html[data-theme="light"] .modal-footer {
  background: #f8fafc !important;
  border-top-color: #e2e8ee !important;
}
html[data-theme="light"] .modal-close { background: #f3f7fa !important; color: #6a7d91 !important; }
html[data-theme="light"] .modal-close:hover { background: #eaf4f2 !important; color: #185b5d !important; }

/* Mobile drawer no claro. */
@media (max-width:1180px) {
  html[data-theme="light"] .app-rail { box-shadow: 24px 0 50px rgba(24,48,80,.18) !important; }
  html[data-theme="light"] .rail-overlay { background: rgba(20,35,55,.28) !important; }
  html[data-theme="light"] .rail-mobile-open {
    background: rgba(255,255,255,.94) !important;
    border-color: rgba(67,91,125,.14) !important;
    color: #23425b !important;
    box-shadow: 0 10px 24px rgba(27,50,80,.11) !important;
  }
}
