﻿@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&display=swap");

:root {
  --bg-base: #eef3fb;
  --bg-top: #f8fbff;
  --ink: #0d2239;
  --ink-soft: #526780;
  --surface: #ffffff;
  --surface-soft: #f2f6fc;
  --surface-strong: #eaf1fb;
  --line: #d4e0f2;
  --line-strong: #bfd1ea;
  --primary: #0b5cab;
  --primary-strong: #0a4a8a;
  --accent: #ff8a3d;
  --success: #0f766e;
  --danger: #b42318;
  --shadow-soft: 0 18px 38px -30px rgba(16, 48, 79, 0.55);
  --shadow-panel: 0 26px 56px -40px rgba(17, 49, 80, 0.48);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  width: 100%;
  overflow-x: hidden;
}

body.app-body {
  margin: 0;
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 9% 9%, rgba(11, 92, 171, 0.11), transparent 34%),
    radial-gradient(circle at 93% 10%, rgba(255, 138, 61, 0.12), transparent 36%),
    linear-gradient(180deg, var(--bg-top) 0%, #eff5fd 45%, var(--bg-base) 100%);
  position: relative;
  overflow-x: hidden;
}

body.app-body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(21, 55, 89, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 55, 89, 0.03) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at 50% 0%, black 38%, transparent 88%);
  z-index: -3;
}

.ambient {
  position: fixed;
  pointer-events: none;
  z-index: -2;
  border-radius: 999px;
  filter: blur(68px);
  opacity: 0.9;
}

.ambient-a {
  width: 360px;
  height: 360px;
  left: -150px;
  top: 85px;
  background: rgba(11, 92, 171, 0.26);
  animation: driftA 16s ease-in-out infinite alternate;
}

.ambient-b {
  width: 310px;
  height: 310px;
  right: -110px;
  top: 190px;
  background: rgba(255, 138, 61, 0.26);
  animation: driftB 20s ease-in-out infinite alternate;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(210, 224, 244, 0.88);
  background: rgba(246, 251, 255, 0.78);
}

.app-header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.72rem;
}

.brand:hover {
  color: var(--ink);
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  font-family: "Space Grotesk", "Plus Jakarta Sans", sans-serif;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  background: linear-gradient(142deg, var(--primary), var(--primary-strong));
  box-shadow: 0 12px 26px -16px rgba(11, 92, 171, 0.88);
}

.brand-text {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.brand-text small {
  margin-top: 0.1rem;
  font-size: 0.7rem;
  color: var(--ink-soft);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.app-nav a {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 999px;
  padding: 0.5rem 0.88rem;
  background: rgba(11, 92, 171, 0.08);
  border: 1px solid transparent;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.app-nav a:hover {
  background: rgba(11, 92, 171, 0.16);
}

.app-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.app-nav a.is-active {
  background: rgba(11, 92, 171, 0.2);
  border-color: rgba(11, 92, 171, 0.28);
  color: #0a3d72;
}

.app-header-actions {
  display: flex;
  align-items: center;
  gap: 0.62rem;
  width: 100%;
}

.payroll-header-inner {
  justify-content: center;
}

.payroll-page-title {
  margin: 0;
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  font-size: 1.04rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0.01em;
  color: #0f3960;
  text-align: center;
}

.auth-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.auth-user {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  background: rgba(11, 92, 171, 0.08);
  color: var(--ink);
  border-radius: 999px;
  min-height: 2.1rem;
  padding: 0.38rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 700;
  max-width: 220px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  background: linear-gradient(145deg, var(--primary), var(--primary-strong));
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  min-height: 2.1rem;
  padding: 0.38rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter 140ms ease, transform 140ms ease, border-color 140ms ease;
}

.auth-btn:hover {
  filter: brightness(1.03);
  color: #fff;
  transform: translateY(-1px);
}

.auth-btn.is-active {
  background: rgba(11, 92, 171, 0.2);
  border-color: rgba(11, 92, 171, 0.32);
  color: #0a3d72;
}

.auth-logout-form {
  margin: 0;
}

.app-main {
  padding-top: 1rem;
  padding-bottom: 2.25rem;
}

.reveal {
  animation: revealUp 540ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.delay-1 {
  animation-delay: 80ms;
}

.delay-2 {
  animation-delay: 150ms;
}

.hero-panel {
  position: relative;
  border-radius: 1.3rem;
  padding: 1.35rem 1.45rem;
  background:
    radial-gradient(circle at 15% 18%, rgba(255, 255, 255, 0.22), transparent 42%),
    radial-gradient(circle at 82% 14%, rgba(255, 255, 255, 0.17), transparent 38%),
    linear-gradient(130deg, #0b5cab 0%, #0a4e94 58%, #0b3f79 100%);
  color: #f4f9ff;
  box-shadow: var(--shadow-panel);
  display: grid;
  grid-template-columns: 1.4fr minmax(250px, 0.9fr);
  gap: 1rem;
  overflow: hidden;
  margin-bottom: 1rem;
}

.hero-panel::after {
  content: "";
  position: absolute;
  right: -120px;
  bottom: -140px;
  width: 320px;
  height: 320px;
  border-radius: 999px;
  border: 28px solid rgba(255, 255, 255, 0.1);
  pointer-events: none;
}

.hero-copy {
  display: grid;
  align-content: center;
  gap: 0.72rem;
}

.hero-kicker {
  margin: 0;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: rgba(233, 245, 255, 0.9);
}

.hero-panel h1 {
  margin: 0;
  font-family: "Space Grotesk", "Plus Jakarta Sans", sans-serif;
  font-size: clamp(1.42rem, 2.8vw, 2.16rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  max-width: 18ch;
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.hero-chips span {
  padding: 0.34rem 0.62rem;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #edf6ff;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.26);
}

.hero-visual {
  position: relative;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.08));
  padding: 0.68rem 0.68rem 0.84rem;
  display: grid;
  align-content: space-between;
  min-height: 176px;
}

.hero-visual svg {
  width: 100%;
  height: 136px;
  filter: drop-shadow(0 14px 22px rgba(5, 27, 47, 0.24));
}

.hero-badge {
  justify-self: end;
  padding: 0.54rem 0.68rem;
  border-radius: 0.74rem;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.17);
  display: grid;
  gap: 0.1rem;
  animation: pulseSoft 2400ms ease-in-out infinite;
}

.hero-badge span {
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(233, 246, 255, 0.88);
  font-weight: 700;
}

.hero-badge strong {
  font-size: 0.86rem;
  font-family: "Space Grotesk", "Plus Jakarta Sans", sans-serif;
  letter-spacing: -0.01em;
}

.workspace-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: 1fr;
  align-items: start;
}

.panel-card {
  background: linear-gradient(180deg, var(--surface), #fafdff 100%);
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  box-shadow: var(--shadow-soft);
  padding: 1rem;
  min-width: 0;
}

.home-card {
  display: grid;
  gap: 0.68rem;
  align-content: start;
}

.home-card h2 {
  margin: 0;
  font-size: 1.1rem;
  font-family: "Space Grotesk", "Plus Jakarta Sans", sans-serif;
}

.home-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.home-link {
  justify-self: start;
}

.auth-shell {
  min-height: calc(100vh - 220px);
  display: grid;
  place-items: center;
}

body.app-body.no-chrome .auth-shell {
  min-height: 100vh;
}

.auth-card {
  width: min(100%, 440px);
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: linear-gradient(180deg, #ffffff 0%, #f2f7ff 100%);
  box-shadow: var(--shadow-panel);
  padding: 1.1rem;
  display: grid;
  gap: 0.86rem;
}

.auth-head {
  display: grid;
  gap: 0.36rem;
}

.auth-head h1 {
  margin: 0;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  font-family: "Space Grotesk", "Plus Jakarta Sans", sans-serif;
}

.auth-head p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 600;
}

.auth-form {
  display: grid;
  gap: 0.74rem;
}

.auth-field {
  display: grid;
  gap: 0.32rem;
}

.auth-field span {
  color: var(--ink-soft);
  font-size: 0.77rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.auth-field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.58rem 0.72rem;
}

.auth-field input:focus {
  outline: none;
  border-color: rgba(11, 92, 171, 0.58);
  box-shadow: 0 0 0 0.2rem rgba(11, 92, 171, 0.14);
}

.auth-remember {
  display: inline-flex;
  align-items: center;
  gap: 0.52rem;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 600;
}

.auth-remember input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary);
}

.auth-submit {
  width: 100%;
}

.auth-validation {
  border: 1px solid rgba(180, 35, 24, 0.25);
  border-radius: 0.7rem;
  background: rgba(180, 35, 24, 0.08);
  color: #8a1c14;
  padding: 0.5rem 0.62rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.auth-validation ul {
  margin: 0;
  padding-left: 1rem;
}

.field-validation {
  color: #8a1c14;
  font-size: 0.76rem;
  font-weight: 700;
}

.option-panel {
  position: static;
}

.panel-heading h2 {
  margin: 0;
  font-family: "Space Grotesk", "Plus Jakarta Sans", sans-serif;
  font-size: 1.07rem;
  letter-spacing: -0.01em;
}

.field-grid {
  margin-top: 0.6rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 0.65rem;
}

.field-grid > * {
  min-width: 0;
}

.field {
  display: grid;
  gap: 0.36rem;
}

.field span {
  color: var(--ink-soft);
  font-size: 0.77rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.field select,
.money-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--surface-soft);
  color: var(--ink);
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.57rem 0.7rem;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.field select:hover,
.money-input:hover {
  border-color: var(--line-strong);
}

.field select:focus,
.money-input:focus {
  outline: none;
  border-color: rgba(11, 92, 171, 0.58);
  box-shadow: 0 0 0 0.2rem rgba(11, 92, 171, 0.14);
  transform: translateY(-1px);
}

.law-control-row {
  margin-top: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: flex-end;
  align-content: flex-start;
  min-width: 0;
  grid-column: span 2;
}

.law-panel {
  margin-top: 0;
  min-width: 232px;
}

.law-panel h3 {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.79rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.law-grid {
  margin-top: 0.42rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.law-side {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  align-content: flex-start;
  min-width: 0;
}

.switch {
  border: 1px solid var(--line);
  border-radius: 0.74rem;
  background: var(--surface-soft);
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 0.58rem;
  padding: 0.58rem 0.68rem;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.switch input {
  width: 1.02rem;
  height: 1.02rem;
  accent-color: var(--primary);
  flex: 0 0 auto;
}

.switch span {
  font-size: 0.82rem;
  line-height: 1.25;
  font-weight: 600;
  white-space: normal;
}

.switch:has(input:checked) {
  background: #ecf4ff;
  border-color: rgba(11, 92, 171, 0.4);
}

.law-option {
  width: max-content;
  min-width: 120px;
  justify-content: center;
  min-height: 42px;
  cursor: pointer;
  padding-inline: 0.85rem;
}

.law-side > .switch {
  width: auto;
  max-width: 100%;
  min-height: 42px;
  padding: 0.52rem 0.66rem;
}

.law-buttons {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.48rem;
  margin-left: 0;
}

.btn-primary-action,
.btn-ghost {
  border: 0;
  border-radius: 0.78rem;
  font-family: "Space Grotesk", "Plus Jakarta Sans", sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.01em;
  font-weight: 700;
  padding: 0.54rem 0.86rem;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, filter 150ms ease;
}

.btn-primary-action {
  color: #fff;
  background: linear-gradient(145deg, var(--primary), var(--primary-strong));
  box-shadow: 0 14px 26px -16px rgba(11, 92, 171, 0.75);
}

.btn-ghost {
  color: var(--ink);
  background: #edf3fb;
  border: 1px solid var(--line);
}

.btn-primary-action:hover,
.btn-ghost:hover {
  transform: translateY(-1px);
  filter: brightness(1.01);
}

.table-shell {
  margin-top: 0.8rem;
  max-height: 520px;
  overflow-y: auto;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 0.82rem;
  background: #fff;
  width: 100%;
  max-width: 100%;
  display: block;
  -webkit-overflow-scrolling: touch;
}

.table-shell::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.table-shell::-webkit-scrollbar-track {
  background: #ebf1fa;
  border-radius: 999px;
}

.table-shell::-webkit-scrollbar-thumb {
  background: #c0d1e8;
  border: 2px solid #ebf1fa;
  border-radius: 999px;
}

.input-table,
.result-table {
  border-collapse: collapse;
  width: max-content;
  min-width: 100%;
}

.result-table {
  min-width: 3200px;
}

.input-table thead th,
.result-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  text-align: left;
  padding: 0.7rem;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: linear-gradient(180deg, #f1f6fd 0%, #e8f0fa 100%);
  color: #234460;
  border-bottom: 1px solid #cfddf1;
}

.input-table td,
.result-table td {
  padding: 0.56rem 0.68rem;
  border-top: 1px solid #ebf1f9;
  font-size: 0.84rem;
  font-weight: 600;
  color: #163047;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.input-table tbody tr:nth-child(odd),
.result-table tbody tr:nth-child(odd) {
  background: #fbfdff;
}

.input-table tbody tr:hover,
.result-table tbody tr:hover {
  background: #f2f7ff;
}

.warning-panel {
  margin-top: 0.86rem;
  border: 1px solid rgba(180, 35, 24, 0.35);
  border-radius: 0.8rem;
  background: rgba(180, 35, 24, 0.08);
  color: var(--danger);
  font-weight: 700;
  font-size: 0.84rem;
  padding: 0.7rem 0.84rem;
}

.results-shell {
  margin-top: 0.95rem;
  display: grid;
  gap: 0.86rem;
  animation: revealUp 450ms ease both;
  min-width: 0;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(146px, 1fr));
  gap: 0.66rem;
}

.summary-tile {
  border: 1px solid var(--line);
  border-radius: 0.88rem;
  background: linear-gradient(170deg, #ffffff 0%, #f2f7fe 100%);
  box-shadow: var(--shadow-soft);
  padding: 0.72rem 0.76rem;
  display: grid;
  gap: 0.28rem;
}

.summary-tile span {
  font-size: 0.71rem;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 700;
  letter-spacing: 0.06em;
}

.summary-tile strong {
  font-family: "Space Grotesk", "Plus Jakarta Sans", sans-serif;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
}

.result-panel .panel-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.7rem;
}

.result-panel {
  min-width: 0;
  overflow: hidden;
}

#resultModeLabel {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 700;
}

.app-footer {
  border-top: 1px solid rgba(212, 224, 242, 0.86);
  background: rgba(249, 252, 255, 0.78);
}

.app-footer .container {
  min-height: 50px;
  display: flex;
  align-items: center;
  color: var(--ink-soft);
  font-size: 0.77rem;
  font-weight: 600;
}

@keyframes revealUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulseSoft {
  0%,
  100% {
    transform: translateY(0);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.14);
  }

  50% {
    transform: translateY(-2px);
    box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.04);
  }
}

@keyframes driftA {
  from {
    transform: translate3d(0, 0, 0);
  }

  to {
    transform: translate3d(30px, -18px, 0);
  }
}

@keyframes driftB {
  from {
    transform: translate3d(0, 0, 0);
  }

  to {
    transform: translate3d(-24px, 18px, 0);
  }
}

@media (max-width: 1240px) {
  .field-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .law-control-row {
    grid-column: span 1;
  }
}

@media (max-width: 1040px) {
  .hero-panel {
    grid-template-columns: 1fr;
    gap: 0.78rem;
  }

  .hero-copy h1 {
    max-width: 100%;
  }

  .hero-visual {
    min-height: 0;
  }

  .hero-visual svg {
    height: 122px;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
}

@media (max-width: 760px) {
  .app-header-inner {
    min-height: auto;
    padding-top: 0.52rem;
    padding-bottom: 0.52rem;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.58rem;
  }

  .brand-text small {
    display: none;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .brand {
    width: 100%;
    min-width: 0;
  }

  .brand-text {
    max-width: 100%;
    font-size: 1.06rem;
  }

  .app-header-actions {
    width: 100%;
    display: grid;
    gap: 0.45rem;
  }

  .payroll-page-title {
    font-size: 0.96rem;
  }

  .app-nav {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 0.1rem;
  }

  .app-nav a {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .auth-nav {
    width: 100%;
    justify-content: flex-end;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .auth-user {
    max-width: 100%;
  }

  .app-main {
    padding-top: 1rem;
    padding-bottom: 1.6rem;
  }

  .hero-panel {
    padding: 1rem;
  }

  .hero-chips span {
    font-size: 0.69rem;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .law-control-row {
    grid-column: span 1;
    gap: 0.55rem;
  }

  .law-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .law-side {
    display: grid;
    grid-template-columns: 1fr;
  }

  .law-option,
  .law-side > .switch,
  .law-buttons {
    width: 100%;
    max-width: none;
  }

  .law-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 0.45rem;
    margin-left: 0;
  }

  .switch span {
    white-space: normal;
  }

  .btn-primary-action,
  .btn-ghost {
    width: 100%;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .table-shell {
    max-height: 58vh;
  }
}

@media (max-width: 520px) {
  .panel-card {
    padding: 0.88rem;
    border-radius: 0.92rem;
  }

  .auth-card {
    padding: 0.9rem;
  }

  .hero-panel {
    border-radius: 1rem;
  }

  .hero-badge {
    justify-self: start;
  }

  .switch span {
    font-size: 0.8rem;
  }

  .app-nav {
    display: inline-flex;
  }

  .auth-btn {
    padding-inline: 0.75rem;
  }

  .law-buttons {
    grid-template-columns: 1fr;
  }

  .input-table th,
  .result-table th,
  .input-table td,
  .result-table td {
    padding: 0.5rem 0.55rem;
  }
}

/* CRM Sidebar Layout */
.crm-shell {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  min-height: 100vh;
  padding: 0.85rem;
  overflow: visible;
}

.crm-sidebar {
  width: 278px;
  max-width: calc(100vw - 2rem);
  border: 1px solid #e5ebf4;
  border-radius: 1rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 14px 36px -30px rgba(14, 37, 62, 0.45);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0.85rem;
  height: calc(100vh - 1.7rem);
  overflow: visible;
  z-index: 120;
  transition: width 220ms ease, transform 220ms ease, box-shadow 220ms ease;
}

.crm-sidebar-head {
  position: relative;
  padding: 0.95rem 0.75rem 0.72rem;
  border-bottom: 1px solid #ebf0f8;
}

.crm-profile {
  min-height: 3.15rem;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: #1a2f44;
  border-radius: 0.72rem;
  padding: 0.36rem;
  transition: background-color 150ms ease;
  cursor: default;
}

.crm-profile:hover {
  color: #1a2f44;
  background: rgba(21, 55, 89, 0.06);
}

.crm-profile-avatar {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  background: linear-gradient(145deg, #0d5ca8, #0a4a8a);
  box-shadow: 0 10px 16px -14px rgba(11, 92, 171, 0.9);
  flex: 0 0 auto;
}

.crm-profile-meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.06rem;
  min-width: 0;
  line-height: 1.1;
  transition: opacity 180ms ease, transform 180ms ease;
}

.crm-profile-meta small {
  color: #7b8da2;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 800;
}

.crm-profile-meta strong {
  color: #172c41;
  font-size: 0.88rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-toggle {
  position: absolute;
  top: 1.02rem;
  right: -0.5rem;
  width: 1.25rem;
  height: 1.55rem;
  padding: 0;
  border: 1px solid #dbe4f0;
  border-radius: 0.42rem;
  background: #ffffff;
  color: #27435f;
  font-size: 0.92rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: none;
  cursor: pointer;
  box-shadow: 0 8px 16px -14px rgba(17, 49, 80, 0.65);
  z-index: 2;
}

.sidebar-toggle > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transform: translateY(-0.5px);
}

.crm-nav {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.24rem;
  padding: 0.66rem 0.62rem 0.62rem;
  overflow-y: auto;
  overflow-x: hidden;
}

.crm-nav-title {
  margin: 0.5rem 0.35rem 0.34rem;
  color: #7a8ea5;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 800;
  transition: opacity 160ms ease;
}

.crm-nav-separator {
  height: 1px;
  margin: 0.45rem 0.18rem;
  background: #ecf1f8;
}

.crm-link {
  position: relative;
  width: 100%;
  box-sizing: border-box;
  border: 0;
  background: transparent;
  text-decoration: none;
  color: #24384d;
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 0.68rem;
  min-height: 2.2rem;
  display: flex;
  align-items: center;
  gap: 0.56rem;
  padding: 0.44rem 0.58rem;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
  border: 1px solid transparent;
  cursor: pointer;
}

.crm-link:hover {
  color: #133b66;
  background: rgba(13, 92, 168, 0.09);
}

.crm-link:focus-visible,
.sidebar-toggle:focus-visible,
.mobile-menu-btn:focus-visible {
  outline: 2px solid rgba(11, 92, 171, 0.4);
  outline-offset: 2px;
}

.crm-link.is-active {
  color: #0f3962;
  background: rgba(13, 92, 168, 0.14);
  border-color: rgba(13, 92, 168, 0.2);
}

.crm-link-static {
  color: #4f657e;
}

.crm-link-static.is-placeholder {
  font-weight: 650;
}

.crm-link-caret {
  margin-left: auto;
  color: #7e94ad;
  font-size: 0.72rem;
  line-height: 1;
}

.crm-submenu {
  display: grid;
  gap: 0.14rem;
  margin: 0.04rem 0 0.26rem 1.34rem;
  padding: 0.22rem 0 0.24rem 0.6rem;
  border-left: 1px solid #e8eef7;
}

.crm-submenu-link {
  display: block;
  border-radius: 0.55rem;
  padding: 0.34rem 0.5rem;
  font-size: 0.77rem;
  font-weight: 700;
  color: #778aa1;
  white-space: nowrap;
}

.crm-submenu-link.is-active {
  color: #1c324a;
  background: rgba(14, 92, 168, 0.1);
}

.crm-submenu-link.is-placeholder {
  color: #899bb0;
}

.crm-link-danger {
  color: #b43a2d;
}

.crm-link-danger:hover {
  color: #9a2d22;
  background: rgba(180, 35, 24, 0.11);
}

.crm-icon {
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 0.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 1.15rem;
}

.crm-icon svg {
  width: 0.95rem;
  height: 0.95rem;
  fill: currentColor;
}

.crm-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: opacity 170ms ease;
}

.crm-sidebar-footer {
  border-top: 1px solid #edf2f8;
  padding: 0.52rem 0.62rem 0.64rem;
}

.crm-logout-form {
  margin: 0;
}

.crm-sidebar-footer .crm-logout-form {
  margin-top: 0.24rem;
}

.crm-bottom-actions {
  display: grid;
  gap: 0.18rem;
}

.crm-help-link {
  color: #60768f;
}

.crm-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 1.8rem);
}

.crm-page-container {
  width: min(1740px, 100%);
  max-width: 100%;
  margin-inline: auto;
}

.crm-mobile-topbar {
  display: none;
}

.mobile-menu-btn {
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: #edf4fe;
  color: #123a61;
  font-size: 0.82rem;
  font-weight: 700;
  min-height: 2.2rem;
  padding: 0.42rem 0.78rem;
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
}

.sidebar-backdrop {
  display: none;
}

.crm-shell .app-main {
  width: 100%;
  max-width: 100%;
  padding-top: 0.2rem;
  padding-bottom: 1.35rem;
}

body.sidebar-collapsed .crm-sidebar {
  width: 86px;
  overflow: visible;
}

body.sidebar-collapsed .crm-profile-meta,
body.sidebar-collapsed .crm-label {
  display: none;
}

body.sidebar-collapsed .crm-sidebar-head {
  padding: 0.72rem 0.42rem 0.56rem;
}

body.sidebar-collapsed .sidebar-toggle {
  right: -0.5rem;
  top: 1.02rem;
  transform: none;
}

body.sidebar-collapsed .crm-profile {
  justify-content: center;
  padding: 0.16rem 0;
  min-height: auto;
}

body.sidebar-collapsed .crm-link {
  width: 2.28rem;
  height: 2.28rem;
  min-height: 2.28rem;
  margin: 0 auto;
  padding: 0;
  justify-content: center;
  align-items: center;
  gap: 0;
  border-radius: 0.62rem;
}

body.sidebar-collapsed .crm-nav {
  padding: 0.54rem 0.3rem 0.56rem;
  overflow: visible;
}

body.sidebar-collapsed .crm-link-caret,
body.sidebar-collapsed .crm-submenu {
  display: none;
}

body.sidebar-collapsed .crm-sidebar-footer {
  padding: 0.46rem 0.3rem 0.62rem;
}

body.sidebar-collapsed .crm-nav-title {
  display: block;
  text-align: center;
  margin: 0.34rem 0 0.5rem;
  font-size: 0.55rem;
  letter-spacing: 0.14em;
}

body.sidebar-collapsed .crm-link + .crm-link {
  margin-top: 0.32rem;
}

body.sidebar-collapsed .crm-icon {
  width: 1.02rem;
  height: 1.02rem;
  flex: 0 0 1.02rem;
  border-radius: 0;
}

body.sidebar-collapsed .crm-link.is-active {
  background: #f1f5fb;
  border-color: #dbe5f2;
}

body.sidebar-collapsed .crm-sidebar-footer .crm-link {
  width: 2.28rem;
  height: 2.28rem;
  min-height: 2.28rem;
  margin: 0 auto;
  padding: 0;
  justify-content: center;
  align-items: center;
  gap: 0;
}

@media (min-width: 991px) {
  body.sidebar-collapsed .crm-nav,
  body.sidebar-collapsed .crm-link {
    overflow: visible;
  }

  body.sidebar-collapsed .crm-link[data-tooltip] {
    z-index: 1;
  }

  body.sidebar-collapsed .crm-link[data-tooltip]:hover {
    z-index: 120;
  }

  body.sidebar-collapsed .crm-link[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 0.62rem);
    top: 50%;
    transform: translateY(-50%);
    background: #101318;
    color: #ffffff;
    border-radius: 0.48rem;
    padding: 0.32rem 0.45rem;
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 10px 22px -16px rgba(0, 0, 0, 0.8);
    z-index: 999;
    transition: opacity 120ms ease;
  }

  body.sidebar-collapsed .crm-link[data-tooltip]:hover::after {
    opacity: 1;
  }
}

@media (max-width: 990px) {
  .crm-shell {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0.7rem;
  }

  .crm-sidebar {
    position: fixed;
    top: 0.7rem;
    left: 0.7rem;
    height: calc(100vh - 1.4rem);
    transform: translateX(calc(-100% - 1rem));
    width: 278px;
    z-index: 60;
  }

  body.sidebar-open .crm-sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    border: 0;
    background: rgba(11, 31, 54, 0.28);
    display: none;
    z-index: 55;
  }

  body.sidebar-open .sidebar-backdrop {
    display: block;
  }

  .crm-mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 0.72rem;
  }

  .crm-profile-meta,
  .crm-label,
  .crm-nav-title {
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  .sidebar-toggle {
    right: 0.34rem;
    top: 50%;
    transform: translateY(-50%);
  }
}

/* Uygulamalar */
.uygulamalar-page {
  padding-top: 0.5rem;
}

.uygulamalar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 260px));
  gap: 1rem;
}

.uygulama-karti {
  min-height: 138px;
  border-radius: 0.95rem;
  border: 1px solid #d5e2f3;
  background: linear-gradient(180deg, #ffffff 0%, #f6faff 100%);
  box-shadow: 0 16px 30px -28px rgba(18, 49, 80, 0.55);
  text-decoration: none;
  color: #1a3048;
  padding: 0.95rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.uygulama-karti:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 34px -28px rgba(17, 61, 101, 0.58);
  border-color: #bdd2ec;
  color: #16324d;
}

.uygulama-karti-ikon {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0.62rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eaf2ff;
  color: #0f4f8e;
}

.uygulama-karti-ikon svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: currentColor;
}

.uygulama-karti-baslik {
  font-size: 0.94rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.uygulama-karti-aciklama {
  font-size: 0.78rem;
  color: #6a8099;
  line-height: 1.35;
}
