@font-face {
  font-family: "Red Hat Display";
  src: url("https://lojastemperare.fbitsstatic.net/sf/fonts/RedHatDisplay-Light.woff2?theme=main&v=202508061400") format("woff2"),
    url("https://lojastemperare.fbitsstatic.net/sf/fonts/RedHatDisplay-Light.woff?theme=main&v=202508061400") format("woff");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Red Hat Display";
  src: url("https://lojastemperare.fbitsstatic.net/sf/fonts/RedHatDisplay-Regular.woff2?theme=main&v=202508061400") format("woff2"),
    url("https://lojastemperare.fbitsstatic.net/sf/fonts/RedHatDisplay-Regular.woff?theme=main&v=202508061400") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Red Hat Display";
  src: url("https://lojastemperare.fbitsstatic.net/sf/fonts/RedHatDisplay-Medium.woff2?theme=main&v=202508061400") format("woff2"),
    url("https://lojastemperare.fbitsstatic.net/sf/fonts/RedHatDisplay-Medium.woff?theme=main&v=202508061400") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Red Hat Display";
  src: url("https://lojastemperare.fbitsstatic.net/sf/fonts/RedHatDisplay-SemiBold.woff2?theme=main&v=202508061400") format("woff2"),
    url("https://lojastemperare.fbitsstatic.net/sf/fonts/RedHatDisplay-SemiBold.woff?theme=main&v=202508061400") format("woff");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Red Hat Display";
  src: url("https://lojastemperare.fbitsstatic.net/sf/fonts/RedHatDisplay-Bold.woff2?theme=main&v=202508061400") format("woff2"),
    url("https://lojastemperare.fbitsstatic.net/sf/fonts/RedHatDisplay-Bold.woff?theme=main&v=202508061400") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root,
:root[data-theme="light"] {
  color-scheme: light;
  --font-brand: "Red Hat Display", "Nunito", "Montserrat", ui-sans-serif, system-ui,
    -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --color-bg: #f6f7f4;
  --color-bg-soft: #eef1ed;
  --color-surface: #ffffff;
  --color-surface-raised: rgba(255, 255, 255, 0.9);
  --color-surface-muted: #f0f2ef;
  --color-sidebar: rgba(255, 255, 255, 0.7);
  --color-text: #18181b;
  --color-heading: #111113;
  --color-muted: #626b74;
  --color-subtle: #8b949e;
  --color-border: rgba(24, 24, 27, 0.12);
  --color-border-strong: rgba(24, 24, 27, 0.2);
  --color-accent: #f04940;
  --color-accent-strong: #d93a32;
  --color-accent-soft: rgba(240, 73, 64, 0.12);
  --color-accent-border: rgba(240, 73, 64, 0.28);
  --color-link: #c8362f;
  --color-focus: rgba(240, 73, 64, 0.28);
  --color-input: #ffffff;
  --color-shadow: rgba(15, 23, 42, 0.08);
  --color-shadow-strong: rgba(15, 23, 42, 0.14);
  --brand-contrast: #ffffff;
  --radius-panel: 8px;
  --radius-control: 8px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --color-bg: #101214;
  --color-bg-soft: #16191c;
  --color-surface: #1b1f23;
  --color-surface-raised: rgba(29, 33, 38, 0.92);
  --color-surface-muted: #252a30;
  --color-sidebar: rgba(22, 25, 29, 0.84);
  --color-text: #f4f5f7;
  --color-heading: #ffffff;
  --color-muted: #b0b8c2;
  --color-subtle: #828c98;
  --color-border: rgba(232, 238, 247, 0.13);
  --color-border-strong: rgba(232, 238, 247, 0.22);
  --color-accent: #ff6b5f;
  --color-accent-strong: #ff8177;
  --color-accent-soft: rgba(255, 107, 95, 0.16);
  --color-accent-border: rgba(255, 107, 95, 0.34);
  --color-link: #ff8b82;
  --color-focus: rgba(255, 107, 95, 0.32);
  --color-input: #14171a;
  --color-shadow: rgba(0, 0, 0, 0.28);
  --color-shadow-strong: rgba(0, 0, 0, 0.46);
  --brand-contrast: #ffffff;
}

* {
  scrollbar-color: var(--color-border-strong) transparent;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-brand);
  overflow-wrap: anywhere;
}

::selection {
  background: var(--color-focus);
}

a,
button,
input,
select,
textarea {
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.theme-shell {
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
}

.theme-app-frame {
  background:
    linear-gradient(135deg, rgba(240, 73, 64, 0.08), transparent 26%),
    linear-gradient(220deg, rgba(32, 142, 147, 0.08), transparent 30%),
    var(--color-bg);
}

.theme-sidebar {
  background: var(--color-sidebar) !important;
  border-color: var(--color-border) !important;
  box-shadow: 8px 0 32px -22px var(--color-shadow-strong) !important;
}

.theme-logo-card {
  border-radius: var(--radius-panel) !important;
}

.rounded-2xl,
.rounded-xl {
  border-radius: var(--radius-panel) !important;
}

.theme-main {
  background: transparent !important;
}

.theme-page-header {
  border-bottom: 1px solid transparent;
}

.theme-content {
  background: transparent;
}

.theme-footer {
  border-color: var(--color-border) !important;
  color: var(--color-subtle) !important;
}

.theme-footer a {
  color: var(--color-muted);
}

.theme-footer a:hover {
  color: var(--color-link);
}

.theme-nav a {
  border: 1px solid transparent;
}

.theme-nav a:hover {
  background: var(--color-surface-muted) !important;
  color: var(--color-heading) !important;
}

.theme-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  flex: 0 0 auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface-raised);
  color: var(--color-muted);
  box-shadow: 0 10px 24px -18px var(--color-shadow-strong);
}

.theme-toggle:hover {
  color: var(--color-heading);
  border-color: var(--color-border-strong);
  background: var(--color-surface);
}

.theme-toggle svg {
  width: 1rem;
  height: 1rem;
  stroke-width: 2.2;
}

:root[data-theme="light"] .theme-toggle-sun,
:root[data-theme="dark"] .theme-toggle-moon {
  display: none;
}

.theme-login {
  position: relative;
  background:
    linear-gradient(135deg, rgba(240, 73, 64, 0.1), transparent 32%),
    linear-gradient(235deg, rgba(32, 142, 147, 0.1), transparent 34%),
    var(--color-bg);
  overflow: hidden;
}

.theme-login::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--color-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-border) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.18), transparent 72%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.18), transparent 72%);
}

.theme-login-card {
  position: relative;
  width: min(100%, 26rem);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-panel);
  background: var(--color-surface-raised);
  color: var(--color-text);
  box-shadow: 0 24px 60px -36px var(--color-shadow-strong);
  backdrop-filter: blur(18px);
}

.theme-login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 5.5rem;
  border-radius: var(--radius-panel);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.22), transparent),
    var(--color-accent);
  box-shadow: 0 16px 34px -24px var(--color-accent);
}

.theme-login-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.theme-button,
button.theme-button {
  border: 1px solid var(--color-accent-border);
  border-radius: var(--radius-control);
  background: var(--color-accent);
  color: var(--brand-contrast);
  font-weight: 700;
  box-shadow: 0 14px 30px -22px var(--color-accent);
}

.theme-button:hover,
button.theme-button:hover {
  background: var(--color-accent-strong);
}

.theme-error {
  border: 1px solid rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
}

:root[data-theme="dark"] .theme-error {
  color: #fecaca;
}

input,
select,
textarea {
  background-color: var(--color-input);
  color: var(--color-text);
  border-color: var(--color-border-strong);
}

input::placeholder,
textarea::placeholder {
  color: var(--color-subtle);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-focus);
}

table {
  color: var(--color-text);
}

.ui-app-shell,
.ui-attendance-body,
.ui-content,
.ui-panel-grid,
.ui-form-grid,
.ui-text-safe {
  min-width: 0;
}

.ui-text-safe,
.ui-message-bubble,
.ui-table-scroll td,
.ui-table-scroll th,
.ui-control-safe,
.ui-control-safe option {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ui-app-shell {
  min-height: 100vh;
}

.ui-content {
  width: 100%;
  max-width: 100%;
}

.ui-page-header,
.ui-attendance-header,
.ui-action-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.ui-page-header,
.ui-attendance-header {
  justify-content: space-between;
}

.ui-action-row {
  flex-wrap: wrap;
}

.ui-panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

.ui-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  gap: 0.75rem;
}

.ui-table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.ui-table-scroll table {
  min-width: 760px;
}

.ui-message-bubble {
  width: fit-content;
  max-width: min(100%, 42rem);
  min-width: 0;
}

.ui-control-safe {
  min-width: 0;
  white-space: normal;
}

.ui-control-safe button,
button.ui-control-safe,
.ui-control-safe a,
a.ui-control-safe {
  min-height: 2.25rem;
  white-space: normal;
  line-height: 1.25;
}

@media (min-width: 1024px) {
  .ui-panel-grid {
    grid-template-columns: minmax(0, 1fr) minmax(18rem, 22.5rem);
  }
}

@media (max-width: 1024px) {
  .ui-attendance-body {
    overflow-x: auto;
  }

  .ui-attendance-body > * {
    min-width: min(100%, 62rem);
  }
}

thead {
  background: var(--color-surface-muted);
  color: var(--color-muted);
}

tbody tr {
  border-color: var(--color-border);
}

tbody tr:hover {
  background: var(--color-surface-muted);
}

.theme-attendance-shell {
  background: var(--color-bg);
}

.theme-attendance-header,
.theme-attendance-footer {
  background: var(--color-surface-raised) !important;
  border-color: var(--color-border) !important;
  color: var(--color-text) !important;
}

#attendance-chat-container {
  background: var(--color-bg-soft) !important;
}

.theme-placeholder-wash {
  background:
    linear-gradient(135deg, var(--color-bg-soft), transparent 48%),
    linear-gradient(var(--color-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-border) 1px, transparent 1px);
  background-size: auto, 56px 56px, 56px 56px;
  opacity: 0.7;
}

[data-theme="dark"] .bg-white,
[data-theme="dark"] .bg-white\/20,
[data-theme="dark"] .bg-white\/40,
[data-theme="dark"] .bg-white\/60,
[data-theme="dark"] .bg-white\/70,
[data-theme="dark"] .bg-white\/80,
[data-theme="dark"] .bg-white\/90,
[data-theme="dark"] .hover\:bg-white:hover {
  background-color: var(--color-surface-raised) !important;
}

[data-theme="dark"] .bg-zinc-50,
[data-theme="dark"] .bg-zinc-50\/50,
[data-theme="dark"] .from-zinc-50,
[data-theme="dark"] .via-zinc-50\/50,
[data-theme="dark"] .to-zinc-50\/50 {
  background-color: var(--color-bg) !important;
  --tw-gradient-from: var(--color-bg) var(--tw-gradient-from-position) !important;
  --tw-gradient-to: rgb(16 18 20 / 0) var(--tw-gradient-to-position) !important;
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important;
}

[data-theme="dark"] .bg-zinc-100,
[data-theme="dark"] .bg-zinc-100\/50,
[data-theme="dark"] .bg-zinc-200\/50,
[data-theme="dark"] .hover\:bg-zinc-50:hover,
[data-theme="dark"] .hover\:bg-zinc-50\/80:hover,
[data-theme="dark"] .hover\:bg-zinc-100:hover,
[data-theme="dark"] .hover\:bg-zinc-100\/50:hover {
  background-color: var(--color-surface-muted) !important;
}

[data-theme="dark"] .bg-temperare-50,
[data-theme="dark"] .bg-temperare-100,
[data-theme="dark"] .hover\:bg-temperare-100:hover {
  background-color: var(--color-accent-soft) !important;
}

[data-theme="dark"] .bg-red-50,
[data-theme="dark"] .bg-rose-50 {
  background-color: rgba(244, 63, 94, 0.14) !important;
}

[data-theme="dark"] .bg-blue-50,
[data-theme="dark"] .bg-blue-100 {
  background-color: rgba(59, 130, 246, 0.16) !important;
}

[data-theme="dark"] .bg-emerald-50,
[data-theme="dark"] .bg-emerald-100 {
  background-color: rgba(16, 185, 129, 0.16) !important;
}

[data-theme="dark"] .bg-purple-100 {
  background-color: rgba(168, 85, 247, 0.16) !important;
}

[data-theme="dark"] .text-zinc-900,
[data-theme="dark"] .text-zinc-950,
[data-theme="dark"] .hover\:text-zinc-900:hover {
  color: var(--color-heading) !important;
}

[data-theme="dark"] .text-zinc-800,
[data-theme="dark"] .text-zinc-700,
[data-theme="dark"] .text-zinc-600,
[data-theme="dark"] .hover\:text-zinc-800:hover {
  color: var(--color-text) !important;
}

[data-theme="dark"] .text-zinc-500 {
  color: var(--color-muted) !important;
}

[data-theme="dark"] .text-zinc-400,
[data-theme="dark"] .text-zinc-300 {
  color: var(--color-subtle) !important;
}

[data-theme="dark"] .text-temperare-500,
[data-theme="dark"] .text-temperare-600,
[data-theme="dark"] .hover\:text-temperare-600:hover {
  color: var(--color-accent) !important;
}

[data-theme="dark"] .border-white,
[data-theme="dark"] .border-white\/40,
[data-theme="dark"] .border-white\/50,
[data-theme="dark"] .border-white\/60,
[data-theme="dark"] .border-zinc-100,
[data-theme="dark"] .border-zinc-200,
[data-theme="dark"] .border-zinc-200\/50,
[data-theme="dark"] .border-zinc-200\/60,
[data-theme="dark"] .border-zinc-200\/80,
[data-theme="dark"] .border-zinc-300,
[data-theme="dark"] .hover\:border-zinc-200:hover,
[data-theme="dark"] .hover\:border-zinc-300:hover {
  border-color: var(--color-border) !important;
}

[data-theme="dark"] .border-temperare-100,
[data-theme="dark"] .border-temperare-200 {
  border-color: var(--color-accent-border) !important;
}

[data-theme="dark"] .divide-zinc-100 > :not([hidden]) ~ :not([hidden]) {
  border-color: var(--color-border) !important;
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background-color: var(--color-input) !important;
  color: var(--color-text) !important;
  border-color: var(--color-border-strong) !important;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: var(--color-subtle) !important;
}

[data-theme="dark"] .shadow,
[data-theme="dark"] .shadow-sm,
[data-theme="dark"] .shadow-lg,
[data-theme="dark"] .shadow-xl {
  --tw-shadow-color: rgba(0, 0, 0, 0.32) !important;
}

[data-theme="dark"] .prose,
[data-theme="dark"] .prose p,
[data-theme="dark"] .prose li {
  color: var(--color-muted) !important;
}

[data-theme="dark"] .prose h1,
[data-theme="dark"] .prose h2,
[data-theme="dark"] .prose h3 {
  color: var(--color-heading) !important;
}

@media (max-width: 900px) {
  .theme-page-header,
  .ui-page-header,
  .ui-attendance-header {
    align-items: flex-start;
    gap: 1rem;
    flex-direction: column;
  }

  .theme-page-header > div:last-child,
  .ui-page-header > div:last-child,
  .ui-attendance-header > div:last-child {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .ui-table-scroll table {
    min-width: 680px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
