:root {
  --bg: #f5f7fb;
  --bg-strong: #e7edf7;
  --panel: #ffffff;
  --panel-alt: #f3f6fb;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #1581ff;
  --accent-soft: #e1efff;
  --accent-dark: #0a4fa6;
  --border: #d9e2ef;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
  --radius: 18px;
  --radius-lg: 24px;
  --radius-xl: 30px;
  --btn-radius:10px;
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-shadow: 0 20px 50px rgba(15, 23, 42, 0.16);

  --ease-apple: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-apple-soft: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-1: 140ms;
  --dur-2: 220ms;
  --dur-3: 360ms;
  --shadow-float: 0 18px 45px rgba(15, 23, 42, 0.18);
}

* {
  box-sizing: border-box;
}

* {
  transition-duration: var(--dur-2);
  transition-timing-function: var(--ease-apple);
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Archivo", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 8%, rgba(21, 129, 255, 0.16), transparent 42%),
    radial-gradient(
      circle at 85% 12%,
      rgba(21, 129, 255, 0.12),
      transparent 48%
    ),
    var(--bg);
}

.page-loader {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  transition: opacity var(--dur-3) var(--ease-apple-soft),
    visibility var(--dur-3) var(--ease-apple-soft);
}

.page-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.page-loader-media {
    width: min(160px, 80vw);
    height: auto;
    border-radius: 18px;
}

@media (prefers-reduced-motion: reduce) {
  .app-shell {
    animation: none;
  }
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0.28),
    rgba(255, 255, 255, 0)
  );
  pointer-events: none;
  z-index: 0;
}

h1,
h2,
h3,
h4,
h5 {
  font-family: "Sora", "Segoe UI", sans-serif;
  letter-spacing: -0.02em;
  color: var(--text);
}

p {
  margin: 0;
}

.material-symbols-outlined {
  font-variation-settings:
    "FILL" 0,
    "wght" 500,
    "GRAD" 0,
    "opsz" 24;
  font-size: 18px;
  line-height: 1;
}

.material-symbols-filled {
  font-variation-settings:
    "FILL" 1,
    "wght" 500,
    "GRAD" 0,
    "opsz" 24;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--btn-radius);
  transition:
    transform var(--dur-1) var(--ease-apple),
    box-shadow var(--dur-1) var(--ease-apple),
    background var(--dur-1) var(--ease-apple),
    border-color var(--dur-1) var(--ease-apple);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
}

.btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.btn-outline-primary {
  color: var(--accent);
  border-color: var(--accent);
}

.btn-outline-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: 0;
  padding: 0;
  animation: appFadeIn var(--dur-3) var(--ease-apple-soft);
}

body[data-app-mode="config"] {
  overflow: hidden;
}

body[data-app-mode="config"] .app-shell {
  height: 100vh;
}

body[data-app-mode="config"] .sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}

body[data-app-mode="config"] .main {
  height: 100vh;
  overflow-y: auto;
}

body[data-app-mode="login"] {
  background: #0b1020;
}

.login-lockscreen {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  justify-items: center;
  padding: 32px 24px 64px;
  overflow: hidden;
  color: #f8fafc;
  font-family: "Sora", sans-serif;
}

.login-bg-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.05);
  filter: saturate(1.1) contrast(1.05);
  z-index: 0;
}

.login-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.1), rgba(15, 23, 42, 0.65));
  z-index: 1;
}

.login-topbar {
  position: absolute;
  top: 22px;
  left: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 2;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(248, 250, 252, 0.85);
}

.login-locale {
  opacity: 0.85;
}

.login-clock {
  position: relative;
  z-index: 2;
  text-align: center;
}

.login-date {
  font-size: 18px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.7);
  margin-bottom: 6px;
}

.login-time {
  font-size: clamp(56px, 8vw, 120px);
  font-weight: 600;
  color: rgba(248, 250, 252, 0.72);
  text-shadow:
    0 2px 8px rgba(15, 23, 42, 0.25),
    0 12px 36px rgba(15, 23, 42, 0.35);
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.22);
  text-stroke: 1px rgba(255, 255, 255, 0.22);
  filter: drop-shadow(0 0 18px rgba(255, 255, 255, 0.12));
}

.login-user {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 12px;
  justify-items: center;
}

.login-user-compact {
  margin-top: 8px;
}

.login-avatar {
  width: 76px;
  height: 76px;
  border-radius: 999px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.3);
  background: rgba(255, 255, 255, 0.2);
}

.login-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.login-user-name {
  font-size: 16px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(248, 250, 252, 0.9);
}

.login-form.login-form-compact {
  display: grid;
  gap: 12px;
  width: min(340px, 86vw);
  justify-items: stretch;
  align-items: stretch;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.28), rgba(15, 23, 42, 0.4));
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 26px;
  padding: 18px;
  box-shadow: 0 20px 40px rgba(2, 6, 23, 0.35);
}

.login-form-compact .field {
  width: 100%;
}

.login-form-compact .form-control {
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #f8fafc;
  border-radius: 999px;
  padding: 10px 16px;
  width: 100%;
}

.login-form-compact .form-control::placeholder {
  color: rgba(248, 250, 252, 0.6);
}

.login-password-row {
  position: relative;
}

.login-password-row .form-control {
  padding-right: 46px;
}

.login-password-toggle {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: none;
  color: rgba(248, 250, 252, 0.9);
  text-shadow: 0 0 12px rgba(15, 23, 42, 0.35);
  cursor: pointer;
}

.login-password-toggle:hover,
.login-password-toggle:focus-visible {
  background: rgba(255, 255, 255, 0.18);
  outline: none;
}

.login-submit-full {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--btn-radius);
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.18));
  color: #f8fafc;
  font-weight: 600;
  letter-spacing: 0.04em;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.25);
}

.login-submit-full:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0.22));
}

.login-form-compact .form-status {
  font-size: 12px;
  color: #fef08a;
}

.app-shell.is-collapsed {
  grid-template-columns: 88px 1fr;
}

.app-shell.mode-operacao {
  grid-template-columns: 1fr;
}

.app-shell.mode-operacao .sidebar {
  display: none;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  color: var(--text);
  border-radius: 0;
  border-right: 1px solid var(--glass-border);
  min-height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-toggle {
  margin-left: auto;
  border-radius: 999px;
  width: 34px;
  height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-family: "Sora", sans-serif;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
  letter-spacing: 0.06em;
}

.brand-title {
  font-size: 16px;
  font-weight: 600;
}

.brand-sub {
  font-size: 12px;
  color: var(--muted);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-link {
  border: 1px solid transparent;
  border-radius: var(--btn-radius);
  padding: 10px 14px;
  text-align: left;
  color: var(--text);
  background: rgb(238 237 237 / 60%);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  gap: 10px;
  transition:
    transform var(--dur-1) var(--ease-apple),
    color var(--dur-1) var(--ease-apple),
    border-color var(--dur-1) var(--ease-apple),
    background var(--dur-2) var(--ease-apple);
}

.nav-link.is-hidden {
  display: none;
}

.nav-label {
  flex: 1;
  text-align: left;
}

.nav-link:hover {
  transform: translateX(6px);
  border-color: var(--accent);
  color: var(--accent);
}

.nav-link.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: translateX(2px);
}

.sidebar-card {
  padding: 16px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
  transition:
    transform var(--dur-2) var(--ease-apple),
    box-shadow var(--dur-2) var(--ease-apple);
}

.sidebar-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-float);
}

.app-shell.is-collapsed .brand-text,
.app-shell.is-collapsed .sidebar-card,
.app-shell.is-collapsed .nav-label {
  display: none;
}

.app-shell.is-collapsed .nav-link {
  justify-content: center;
  padding: 10px 0;
}

.app-shell.is-collapsed .sidebar-toggle .material-symbols-outlined {
  transform: rotate(180deg);
}

.sidebar-card-title {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.main {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: var(--glass-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  transition:
    transform var(--dur-2) var(--ease-apple),
    box-shadow var(--dur-2) var(--ease-apple);
}

.topbar:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-float);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-notification {
  position: relative;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(255, 255, 255, 0.9);
  color: #ef4444;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(239, 68, 68, 0.12);
  transition:
    transform var(--dur-1) var(--ease-apple),
    box-shadow var(--dur-1) var(--ease-apple),
    background var(--dur-1) var(--ease-apple),
    border-color var(--dur-1) var(--ease-apple);
}

.btn-notification:hover,
.btn-notification:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(239, 68, 68, 0.6);
  background: rgba(254, 226, 226, 0.9);
  box-shadow: 0 10px 22px rgba(239, 68, 68, 0.2);
  outline: none;
}

.notif-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: #ef4444;
  border: 2px solid #fff;
}

.notif-badge.is-hidden {
  display: none;
}

.notification-list {
  display: grid;
  gap: 12px;
}

.notification-item {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel-alt);
  padding: 14px;
  display: grid;
  gap: 8px;
}

.notification-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.notification-item-title {
  font-weight: 600;
}

.notification-item-sub {
  color: var(--muted);
  font-size: 13px;
}

#notificacoesAvulsasEmpty.is-hidden {
  display: none;
}

.avulsa-lock {
  position: fixed;
  inset: 0;
  z-index: 1040;
  background: rgba(15, 23, 42, 0.36);
  backdrop-filter: blur(2px);
  display: grid;
  place-items: center;
  padding: 20px;
}

.avulsa-lock.is-hidden {
  display: none;
}

.avulsa-lock-card {
  width: min(520px, 92vw);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-float);
  display: grid;
  gap: 10px;
  text-align: center;
}

.avulsa-lock-title {
  font-family: "Sora", "Segoe UI", sans-serif;
  font-weight: 600;
}

.mode-switch {
  display: flex;
  gap: 8px;
  padding: 4px;
  border-radius: 999px;
  background: var(--panel-alt);
  border: 1px solid var(--border);
}

.mode-switch .btn {
  border-radius: var(--btn-radius);
}

.mode-switch .btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
}

.section {
  display: none;
  animation: fadeUp 0.5s ease both;
}

.section.active {
  display: block;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-input {
  min-width: 220px;
}

.section-actions .btn-icon {
  white-space: nowrap;
  flex-shrink: 0;
}

.vinculo-group {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  overflow: hidden;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.vinculo-group-header {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition:
    background var(--dur-2) var(--ease-apple),
    transform var(--dur-2) var(--ease-apple);
}

.vinculo-group-header:hover {
  background: var(--panel-alt);
}

.vinculo-group-header .material-symbols-outlined {
  transition: transform var(--dur-2) var(--ease-apple);
}

.vinculo-group-title {
  flex: 1;
  text-align: left;
}

.vinculo-group-count {
  font-size: 12px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
}

.vinculo-group-body {
  display: none;
  padding: 0 8px 12px;
}

.vinculo-group.is-open .vinculo-group-body {
  display: block;
}

.vinculo-group.is-open .vinculo-group-header .material-symbols-outlined {
  transform: rotate(180deg);
}

@media (max-width: 720px) {
  .section-actions {
    flex-wrap: wrap;
    width: 100%;
    justify-content: flex-start;
  }
  .search-input {
    min-width: 100%;
  }
}

.muted {
  color: var(--muted);
}

.filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}


.panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--glass-border);
    margin: 0;
    transition:
      transform var(--dur-2) var(--ease-apple),
      box-shadow var(--dur-2) var(--ease-apple),
      border-color var(--dur-2) var(--ease-apple);
}

.panel:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-float);
}

.panel-title {
  font-weight: 600;
  margin-bottom: 16px;
}

.form-panel .form-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field.full {
  grid-column: 1 / -1;
}

.field.inline {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-footer {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-cancel {
  display: none;
}

.btn-cancel.is-visible {
  display: inline-flex;
}

.form-status {
  font-size: 12px;
  color: var(--muted);
}

.form-status.success {
  color: var(--accent);
}

.form-status.error {
  color: #f97316;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.list-row {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel-alt);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  transition:
    transform var(--dur-2) var(--ease-apple),
    box-shadow var(--dur-2) var(--ease-apple),
    border-color var(--dur-2) var(--ease-apple);
}

.list-row:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-float);
}

.list-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-icon.btn-sm {
  padding: 4px 8px;
}

.list-title {
  font-weight: 600;
}

.list-sub {
  font-size: 12px;
  color: var(--muted);
}

.tag {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.tag.tag-priority {
  font-size: 8px;
  padding: 3px 8px;
  letter-spacing: 0.06em;
}

.tag-alta {
  background: rgba(249, 115, 22, 0.14);
  color: #c2410c;
}

.tag-media {
  background: rgba(21, 129, 255, 0.15);
  color: var(--accent-dark);
}

.tag-baixa {
  background: rgba(16, 185, 129, 0.16);
  color: #047857;
}

.tag-ativo {
  background: rgba(16, 185, 129, 0.16);
  color: #047857;
}

.tag-inativo {
  background: rgba(148, 163, 184, 0.28);
  color: #475569;
}

.history-placeholder {
  color: var(--muted);
  line-height: 1.6;
}

.history-list {
  display: grid;
  gap: 12px;
}

.history-item {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
}

.history-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 600;
}

.history-meta {
  color: var(--muted);
  font-size: 12px;
}

.history-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
}

.history-metric {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--glass-border);
}

.history-loading,
.history-end,
.history-empty {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin-top: 12px;
  display: none;
}

.list-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
}

.list-pagination.is-hidden {
  display: none;
}

.list-row-fade td {
  opacity: 0;
  animation: fadeRow 0.35s ease both;
  animation-delay: var(--row-delay, 0ms);
}

.page-list {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.page-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
  color: var(--accent);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
  transition:
    transform var(--dur-1) var(--ease-apple),
    box-shadow var(--dur-1) var(--ease-apple),
    background var(--dur-1) var(--ease-apple),
    border-color var(--dur-1) var(--ease-apple);
}

.page-btn:hover:not(.is-disabled):not(.is-active) {
  transform: translateY(-1px);
  border-color: rgba(21, 129, 255, 0.35);
  box-shadow: 0 8px 18px rgba(21, 129, 255, 0.2);
}

.page-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 10px 20px rgba(21, 129, 255, 0.3);
}

.page-btn.is-disabled {
  opacity: 0.4;
  pointer-events: none;
  box-shadow: none;
}

.page-ellipsis {
  color: var(--muted);
  font-weight: 600;
  padding: 0 4px;
}

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

.task-modal .modal-dialog {
  max-width: 1000px;
}

.task-modal .modal-content {
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
}

.task-modal .modal-header {
  background: #f7f9ff;
  border-bottom: 1px solid var(--border);
  padding: 18px 22px;
}

.task-modal .modal-body {
  padding: 20px 22px 24px;
}

.task-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 18px;
}

.task-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.task-title {
  font-size: 20px;
  font-weight: 600;
}

.task-meta {
  color: var(--muted);
  font-size: 13px;
}

.task-files-panel {
  padding: 14px;
}

.task-chat {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.task-chat-card {
  border: 1px solid var(--border);
  border-radius: 24px;
  background: #fff;
  display: flex;
  flex-direction: column;
  min-height: 520px;
}

.chat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 18px;
  font-weight: 600;
}

.chat-card-header .form-select {
  background: var(--panel-alt);
  max-width: max-content;
}

.chat-messages {
  padding: 18px 20px;
  background: #fff;
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-messages-card {
  border-bottom: 1px solid var(--border);
}

.chat-message {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--panel-alt);
  border: 1px solid var(--border);
}

.chat-message > div:first-child {
  white-space: pre-wrap;
}

.chat-message .chat-meta {
  font-size: 11px;
  color: var(--muted);
}

.chat-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.chat-input {
  border-radius: 999px;
  border: 1px solid #d6dbe6;
  background: #fff;
  padding: 12px 18px;
  min-height: 48px;
  font-size: 15px;
}

.chat-submit {
  border-radius: var(--btn-radius);
  padding: 10px 26px;
  font-weight: 600;
}

.btn-close {
  border-radius: var(--btn-radius);
}

.chat-attachments {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px 18px;
}

.chat-attachments .form-control {
  flex: 1;
  border-radius: 14px;
}

.board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  --kanban-col-height: clamp(280px, 60vh, 680px);
}

.column {
  display: flex;
  flex-direction: column;
  background: rgb(246 246 246 / 75%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  height: var(--kanban-col-height);
  overflow: hidden;
  backdrop-filter: blur(6px);
  transition:
    border-color var(--dur-2) var(--ease-apple),
    box-shadow var(--dur-2) var(--ease-apple),
    transform var(--dur-2) var(--ease-apple);
}

.column.drag-over {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(21, 129, 255, 0.16);
  transform: translateY(-2px);
}

.column h5 {
  margin: 0 0 12px 0;
  font-size: 22px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.card-task {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 14px;
  animation: pop var(--dur-3) var(--ease-apple-soft) both;
  cursor: grab;
  transition:
    transform var(--dur-2) var(--ease-apple),
    box-shadow var(--dur-2) var(--ease-apple),
    border-color var(--dur-2) var(--ease-apple);
}

.card-task:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-float);
}

.card-task.dragging {
  opacity: 0.6;
}

.card-task.status-a_fazer {
  border-left: 4px solid #fbbf24;
}

.card-task.status-em_andamento {
  border-left: 4px solid #1581ff;
}

.card-task.status-esperando_retorno {
  border-left: 4px solid #f97316;
}

.card-task.status-concluido {
  border-left: 4px solid #10b981;
}

.small-muted {
  color: var(--muted);
  font-size: 12px;
}

.badge-overdue {
  font-size: 11px;
  height: max-content;
}

.form-control,
.form-select {
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: rgb(234 234 245 / 75%) !important;
  backdrop-filter: blur(10px);
  transition:
    border-color var(--dur-1) var(--ease-apple),
    box-shadow var(--dur-1) var(--ease-apple),
    transform var(--dur-1) var(--ease-apple);
}

.modal .form-control,
.modal .form-select,
.modal textarea.form-control {
  background: rgba(255, 255, 255, 0.82) !important;
  border-color: rgba(203, 213, 225, 0.8);
}

.modal .form-control:focus,
.modal .form-select:focus,
.modal textarea.form-control:focus {
  background: rgba(255, 255, 255, 0.9) !important;
  box-shadow: 0 0 0 4px rgba(21, 129, 255, 0.18);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(21, 129, 255, 0.18);
  transform: translateY(-1px);
}

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

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

@media (max-width: 1024px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .app-shell.is-collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-radius: 0;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .task-modal-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .field-grid {
    grid-template-columns: 1fr;
  }

  .nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .nav-link {
    flex: 1 1 45%;
  }

  .app-shell.is-collapsed .nav-link {
    flex: 1 1 45%;
    padding: 10px 14px;
  }

  .chat-attachments {
    flex-direction: column;
    align-items: stretch;
  }
}
