:root {
  --green: #8b5cf6;
  --green-dark: #6d28d9;
  --cyan: #ec4899;
  --orange: #d946ef;
  --red: #e11d48;
  --purple: #6d28d9;
  --pink: #ec4899;
  --blue: #7c3aed;
  --navy: #211044;
  --navy-soft: #3b1b73;
  --body: #f3f5f8;
  --sidebar: #ffffff;
  --sidebar-active: #eef3f9;
  --text: #263240;
  --muted: #8b8f98;
  --line: #e5eaf0;
  --table-head: #4c1d95;
  --link: #7e22ce;
  --soft-orange: #ec4899;
  --soft-orange-light: #fdf2f8;
  --success: #16834f;
  --danger: #c0342b;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--body);
  color: var(--text);
  font-family: "Source Sans Pro", Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: linear-gradient(180deg, #fff 0%, #edf2f8 100%);
}

.login-box {
  width: min(480px, 100%);
}

.login-logo {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--navy);
  font-size: 20px;
  text-align: center;
}

.login-logo img {
  width: min(420px, 86vw);
  height: auto;
}

.login-logo b {
  font-weight: 900;
}

.login-card {
  display: grid;
  gap: 14px;
  padding: 22px;
  background: #fff;
  border: 1px solid #dfe7f0;
  box-shadow: 0 14px 34px rgba(9, 33, 66, 0.14);
}

.login-card h1 {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 400;
}

.login-card label {
  display: grid;
  gap: 6px;
  color: #555;
  font-weight: 800;
}

.login-card input {
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #ddd;
}

.login-card small {
  color: #777;
  text-align: center;
}

.login-back {
  margin: 4px 0 0;
  text-align: center;
  font-size: 13px;
}

.login-back a {
  color: #777;
  text-decoration: none;
}

.login-back a:hover {
  color: #333;
  text-decoration: underline;
}

.login-error {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-weight: 800;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.admin-shell {
  min-height: 100vh;
}

.main-header {
  position: fixed;
  z-index: 30;
  inset: 0 0 auto;
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  height: 150px;
  box-shadow: 0 2px 12px rgba(9, 33, 66, 0.16);
}

.brand-logo {
  display: flex;
  height: 150px;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  background: #fff;
  border-right: 1px solid #dfe7f0;
  text-decoration: none;
}

.brand-logo img {
  width: 320px;
  max-height: 142px;
  object-fit: contain;
}

.topbar {
  display: flex;
  align-items: center;
  min-width: 0;
  background: linear-gradient(135deg, #092142 0%, #12345a 100%);
  color: #fff;
  border-bottom: 1px solid #071a35;
}

.hamburger {
  display: grid;
  width: 54px;
  height: 150px;
  place-items: center;
  border: 0;
  background: transparent;
  color: #fff;
}

.hamburger:hover {
  background: rgba(255, 255, 255, 0.08);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  padding-right: 34px;
  font-size: 16px;
}

.topbar-user a {
  color: #f1b15c;
  text-decoration: underline;
  text-underline-offset: 8px;
}

.avatar {
  display: inline-block;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 35%, #fff 0 28%, transparent 29%),
    radial-gradient(circle at 50% 90%, #fff 0 35%, transparent 36%),
    var(--soft-orange);
}

.logout-button {
  min-height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-weight: 800;
}

.sidebar {
  position: fixed;
  z-index: 20;
  top: 150px;
  bottom: 0;
  left: 0;
  width: 340px;
  overflow-y: auto;
  background: var(--sidebar);
  box-shadow: 3px 0 12px rgba(9, 33, 66, 0.12);
  transition: transform 0.18s ease;
}

.sidebar-collapsed .sidebar {
  transform: translateX(-340px);
}

.side-nav {
  display: grid;
}

.side-nav button {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 54px;
  padding: 0 18px;
  border: 0;
  background: transparent;
  color: var(--navy-soft);
  font-size: 17px;
  font-weight: 700;
  text-align: left;
}

.side-nav button:hover,
.side-nav button.active {
  background: var(--sidebar-active);
  color: var(--green-dark);
  border-left: 4px solid var(--soft-orange);
  padding-left: 14px;
}

.side-nav button.child {
  min-height: 40px;
  padding-left: 38px;
  color: #888;
  font-size: 16px;
  font-weight: 400;
}

.side-nav button.child.active {
  color: #000;
  font-weight: 700;
}

.content {
  min-height: 100vh;
  margin-left: 340px;
  padding: 170px 22px 32px;
  transition: margin-left 0.18s ease;
}

.sidebar-collapsed .content {
  margin-left: 0;
}

.page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.page-head h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 400;
  color: var(--navy);
}

.breadcrumb {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 14px;
  list-style: none;
}

.breadcrumb li + li::before {
  margin-right: 8px;
  content: ">";
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(230px, 1fr));
  gap: 18px;
}

.dash-card {
  min-height: 154px;
  overflow: hidden;
  border-radius: 6px;
  color: var(--navy);
  border: 1px solid #dfe7f0;
  border-top: 4px solid var(--soft-orange);
  background: #fff;
  box-shadow: 0 10px 24px rgba(9, 33, 66, 0.08);
}

.dash-card .inner {
  position: relative;
  min-height: 118px;
  padding: 16px;
}

.dash-card h2 {
  margin: 0 0 10px;
  color: var(--navy);
  font-size: 42px;
  line-height: 1;
}

.dash-card p {
  margin: 0;
  color: #526070;
  font-size: 18px;
  font-weight: 800;
}

.dash-card .card-icon {
  position: absolute;
  right: 24px;
  bottom: 18px;
  color: rgba(9, 33, 66, 0.16);
  transform: scale(5.4);
  transform-origin: bottom right;
}

.dash-card button {
  display: flex;
  width: 100%;
  min-height: 33px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  background: #f7f9fb;
  color: var(--navy);
  font-size: 17px;
  font-weight: 800;
}

.dash-card.cyan {
  border-top-color: #d9922d;
}

.dash-card.green {
  border-top-color: #102b4f;
}

.dash-card.orange {
  border-top-color: #d9922d;
}

.dash-card.red {
  border-top-color: #b9433d;
}

.dash-card.purple {
  border-top-color: #142f57;
}

.dash-card.pink {
  border-top-color: #c9893d;
}

.dash-card.blue {
  border-top-color: #386083;
}

.dash-card.dark-green {
  border-top-color: #b87118;
}

.panel-card {
  margin-top: 24px;
  background: #fff;
  border: 1px solid #dfe7f0;
  box-shadow: 0 9px 22px rgba(9, 33, 66, 0.1);
}

.panel-body {
  padding: 13px;
}

.month-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 28px;
}

.month-tabs button {
  min-width: 84px;
  min-height: 38px;
  border: 0;
  border-radius: 3px;
  background: var(--soft-orange);
  color: #fff;
  font-weight: 700;
}

.month-tabs button.active {
  background: var(--navy);
}

.day-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -14px 0 24px;
}

.day-selector button,
.day-button {
  min-width: 34px;
  min-height: 30px;
  border: 0;
  border-radius: 3px;
  background: #ededed;
  color: #444;
  font-weight: 800;
}

.day-selector button.active,
.day-button.active {
  background: var(--soft-orange);
  color: #fff;
}

.chart-title,
.table-title {
  margin: 0 0 24px;
  font-size: 23px;
}

.stacked-chart {
  position: relative;
  height: 340px;
  padding: 10px 28px 62px 80px;
  background:
    linear-gradient(#d8d8d8 1px, transparent 1px) 0 0 / 100% 25%,
    #fff;
}

.y-axis {
  position: absolute;
  left: 12px;
  color: #888;
  font-weight: 700;
}

.y-axis.y0 {
  bottom: 58px;
}

.y-axis.y500 {
  bottom: 128px;
}

.y-axis.y1000 {
  bottom: 198px;
}

.y-axis.y1500 {
  bottom: 268px;
}

.y-axis.y2000 {
  top: 2px;
}

.bar-stack {
  position: absolute;
  bottom: 62px;
  left: 270px;
  display: flex;
  width: 46px;
  height: 168px;
  flex-direction: column-reverse;
}

.bar-stack span {
  display: block;
}

.bar-ok {
  background: var(--soft-orange);
}

.bar-nok {
  background: #ff6b35;
}

.bar-rok {
  background: var(--navy-soft);
}

.bar-rnok {
  background: #6f7f95;
}

.bar-small {
  position: absolute;
  bottom: 62px;
  left: 333px;
  width: 46px;
  height: 36px;
  background: var(--soft-orange);
}

.x-label {
  position: absolute;
  bottom: 22px;
  color: #888;
  font-weight: 700;
}

.x1 {
  left: 64px;
}

.x2 {
  left: 272px;
}

.x3 {
  left: 470px;
}

.legend {
  display: flex;
  justify-content: center;
  gap: 34px;
  min-height: 58px;
  align-items: center;
  background: #eef3f9;
  font-size: 19px;
  font-weight: 800;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legend i {
  display: inline-block;
  width: 29px;
  height: 29px;
}

.data-card {
  background: #fff;
  border: 1px solid #dfe7f0;
  box-shadow: 0 10px 22px rgba(9, 33, 66, 0.1);
}

.toolbar {
  display: grid;
  gap: 18px;
  padding: 13px 13px 6px;
}

.payroll-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 10px;
  padding: 13px;
  border-bottom: 1px solid #eee;
  background: #fbfbfb;
}

.payroll-summary div {
  display: grid;
  min-height: 68px;
  align-content: center;
  gap: 4px;
  padding: 10px 12px;
  border-left: 4px solid var(--soft-orange);
  background: #fff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.08);
}

.payroll-summary strong {
  color: #12345a;
  font-size: 22px;
}

.payroll-summary span {
  color: #777;
  font-weight: 800;
}

.compact-summary {
  grid-template-columns: repeat(3, minmax(150px, 1fr));
}

.workflow-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 13px 0;
}

.workflow-strip span {
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 3px;
  background: var(--soft-orange-light);
  color: var(--navy);
  font-weight: 800;
}

.quick-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 13px 13px 0;
}

.quick-tabs button {
  min-height: 34px;
  padding: 7px 14px;
  border: 1px solid #dfe7f0;
  border-radius: 999px;
  background: #fff;
  color: var(--navy);
  font-weight: 800;
}

.quick-tabs button.active {
  border-color: var(--navy);
  background: var(--navy);
  color: #fff;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.btn {
  display: inline-flex;
  min-width: 82px;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 6px 14px;
  border: 0;
  border-radius: 3px;
  background: #fff;
  color: var(--navy);
  font-weight: 800;
}

.btn-green {
  background: var(--navy);
  color: #fff;
}

.btn-orange {
  background: var(--soft-orange);
  color: #fff;
}

.btn-light {
  border: 1px solid #ddd;
  background: #fff;
}

.filter-line {
  display: flex;
  align-items: end;
  gap: 8px;
  color: #bbb;
  font-size: 17px;
}

.filter-line input {
  width: 180px;
  height: 28px;
  border: 0;
  border-bottom: 1px solid #ccc;
  outline: 0;
  background: transparent;
}

.muted {
  color: #999;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 10px;
  border: 1px solid #f0f0f0;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--table-head);
  color: #fff;
  font-weight: 800;
}

th.day-cell {
  padding: 5px;
}

.day-button {
  width: 100%;
  background: transparent;
}

th.sortable::after {
  float: right;
  color: rgba(0, 0, 0, 0.25);
  content: "↕";
}

tbody tr:hover,
tbody tr.selected {
  background: #eef3f9;
}

td.selected-day {
  background: #fff4e8;
  font-weight: 800;
}

td a {
  color: var(--link);
  text-decoration: none;
}

.file-link {
  display: inline-flex;
  max-width: 260px;
  align-items: center;
  gap: 7px;
  color: var(--link);
  overflow-wrap: anywhere;
}

.file-link img {
  width: 42px;
  height: 42px;
  border: 1px solid #ddd;
  object-fit: cover;
}

.file-list {
  display: grid;
  gap: 8px;
  min-width: 180px;
}

.file-upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.attendance-editor {
  display: grid;
  max-height: 420px;
  overflow: auto;
  border: 1px solid #dfe7f0;
}

.attendance-editor-head,
.attendance-editor-row {
  display: grid;
  grid-template-columns: 60px minmax(140px, 1fr) minmax(90px, 0.55fr);
  gap: 8px;
  align-items: center;
  padding: 8px;
  border-bottom: 1px solid #edf1f5;
}

.attendance-editor-head {
  position: sticky;
  z-index: 1;
  top: 0;
  background: #102b4f;
  color: #fff;
}

.attendance-editor-row span {
  font-weight: 900;
}

.actions {
  display: flex;
  gap: 9px;
}

.icon-action {
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--navy);
  padding: 0;
}

.iban-cell {
  min-width: 260px;
  white-space: nowrap;
}

.status-red {
  color: #e85b2a;
  font-weight: 800;
}

.status-green {
  color: var(--navy-soft);
  font-weight: 800;
}

.status-orange {
  color: var(--soft-orange);
  font-weight: 800;
}

.badge-green {
  display: inline-block;
  min-width: 68px;
  padding: 4px 8px;
  background: var(--navy);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.status-toggle {
  min-width: 76px;
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.14);
}

.status-toggle.active {
  background: var(--success);
}

.status-toggle.passive {
  background: var(--danger);
}

.pagination {
  display: flex;
  justify-content: flex-end;
  padding: 12px 0 9px;
}

.pagination span {
  min-height: 40px;
  padding: 10px 15px;
  border: 1px solid #ddd;
  background: #fff;
  color: #777;
}

.pagination .active {
  background: var(--soft-orange);
  color: #fff;
}

.modal {
  width: min(920px, calc(100vw - 28px));
  padding: 0;
  border: 0;
  background: transparent;
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.42);
}

.modal-card {
  display: grid;
  overflow: hidden;
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.28);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 15px;
  background: var(--navy);
  color: #fff;
}

.modal-header h2 {
  margin: 0;
  font-weight: 400;
}

.icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 16px;
}

.form-grid label {
  display: grid;
  gap: 6px;
  font-weight: 800;
}

.form-grid input,
.form-grid textarea,
.form-grid select {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #ddd;
  outline: 0;
}

.full-field {
  grid-column: 1 / -1;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 13px 16px;
  border-top: 1px solid #eee;
}

[data-icon] {
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
}

[data-icon] svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

@media (max-width: 1180px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(230px, 1fr));
  }
}

@media (max-width: 760px) {
  .main-header {
    position: static;
    grid-template-columns: 1fr;
    height: auto;
  }

  .brand-logo {
    height: 130px;
  }

  .sidebar {
    top: 214px;
    transform: translateX(-340px);
  }

  .sidebar-collapsed .sidebar {
    transform: translateX(0);
  }

  .content,
  .sidebar-collapsed .content {
    margin-left: 0;
    padding: 18px 12px;
  }

  .page-head,
  .dashboard-grid,
  .form-grid,
  .payroll-summary {
    grid-template-columns: 1fr;
  }

  .breadcrumb {
    display: none;
  }
}

/* 2026 corporate refinement */
:root {
  --green: #8b5cf6;
  --green-dark: #6d28d9;
  --cyan: #ec4899;
  --orange: #d946ef;
  --red: #b94136;
  --purple: #6d28d9;
  --pink: #a8663a;
  --blue: #7c3aed;
  --navy: #071d36;
  --navy-soft: #163a5d;
  --body: #f5f7fa;
  --sidebar-active: #eef4f8;
  --text: #202a35;
  --muted: #6f7a86;
  --line: #dfe6ee;
  --table-head: #4c1d95;
  --link: #006d77;
  --soft-orange: #ec4899;
  --soft-orange-light: #fdf2f8;
  --success: #16805a;
  --danger: #c8453b;
}

body {
  background:
    linear-gradient(180deg, #f9fbfd 0%, #eef3f7 100%);
  overflow-x: hidden;
}

.login-page {
  background:
    radial-gradient(circle at 50% 12%, rgba(216, 138, 45, 0.1), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, #eef3f7 100%);
}

.login-card,
.data-card,
.panel-card,
.modal-card {
  border-radius: 8px;
  border-color: rgba(13, 49, 84, 0.12);
  box-shadow: 0 18px 45px rgba(7, 29, 54, 0.1);
}

.login-card h1,
.page-head h1 {
  font-weight: 700;
}

.main-header {
  height: 132px;
  grid-template-columns: 360px minmax(0, 1fr);
  box-shadow: 0 10px 30px rgba(7, 29, 54, 0.12);
}

.brand-logo,
.hamburger {
  height: 132px;
}

.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
}

.brand-logo img {
  width: 342px;
  max-height: 132px;
  object-fit: contain;
}

.topbar {
  background: #071d36;
}

.sidebar {
  top: 132px;
  width: 360px;
  border-right: 1px solid var(--line);
  box-shadow: none;
}

.sidebar-collapsed .sidebar {
  transform: translateX(-360px);
}

.content {
  margin-left: 360px;
  padding-top: 156px;
}

.side-nav button {
  min-height: 48px;
  color: #273746;
  font-size: 16px;
}

.nav-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--module-color) 12%, white);
  color: var(--module-color);
}

.nav-icon svg {
  width: 19px;
  height: 19px;
}

.side-nav button:hover,
.side-nav button.active {
  color: var(--navy);
  background: #edf4f7;
  border-left-color: var(--soft-orange);
}

.executive-dashboard {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

.executive-hero {
  min-height: 142px;
  padding: 22px 26px;
  border: 1px solid rgba(13, 49, 84, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(7, 29, 54, 0.96), rgba(17, 59, 91, 0.96)),
    #071d36;
  color: #fff;
  box-shadow: 0 16px 38px rgba(7, 29, 54, 0.16);
}

.executive-hero span,
.module-intro span {
  color: #f1ad62;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.executive-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.dashboard-month-picker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-weight: 900;
}

.dashboard-month-picker select {
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 900;
}

.dashboard-month-picker option {
  color: #071d36;
}

.executive-hero h2 {
  margin: 8px 0 6px;
  font-size: 30px;
}

.executive-hero p {
  max-width: 720px;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 16px;
}

.kpi-grid,
.ops-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.kpi-card,
.ops-panel,
.module-intro {
  border: 1px solid rgba(13, 49, 84, 0.12);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(7, 29, 54, 0.07);
}

.kpi-card {
  display: grid;
  min-height: 92px;
  align-content: center;
  gap: 6px;
  padding: 18px;
  border-left: 5px solid #8ca0b3;
  text-align: left;
}

.kpi-card strong {
  color: var(--navy);
  font-size: 28px;
}

.kpi-card span {
  color: var(--muted);
  font-weight: 800;
}

.kpi-card.good {
  border-left-color: #16a34a;
}

.kpi-card.bad {
  border-left-color: #dc2626;
  background: linear-gradient(90deg, rgba(220, 38, 38, 0.08), #fff 42%);
}

.kpi-card.neutral {
  border-left-color: #2563eb;
}

.kpi-card.good strong {
  color: #116b43;
}

.kpi-card.bad strong {
  color: #b91c1c;
}

.ops-panel {
  padding: 18px;
}

.ops-panel h3 {
  margin: 0 0 12px;
  color: var(--navy);
  font-size: 18px;
}

.ops-panel p {
  margin: 8px 0;
  color: #405061;
}

.ops-panel p span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.alert-row {
  padding: 10px 12px;
  border-left: 3px solid var(--soft-orange);
  background: #fff8ef;
}

.empty-state {
  color: var(--muted);
}

.dashboard-grid {
  grid-template-columns: repeat(4, minmax(210px, 1fr));
}

.dash-card {
  min-height: 136px;
  border-top: 0;
  border-left: 4px solid var(--soft-orange);
  box-shadow: 0 10px 24px rgba(7, 29, 54, 0.08);
}

.dash-card.cyan {
  border-left-color: #0ea5a3;
}

.dash-card.green {
  border-left-color: #c026d3;
}

.dash-card.orange {
  border-left-color: #16a34a;
}

.dash-card.red {
  border-left-color: #7c3aed;
}

.dash-card.purple {
  border-left-color: #2563eb;
}

.dash-card.blue {
  border-left-color: #0891b2;
}

.dash-card.dark-green {
  border-left-color: #b45309;
}

.dash-card .inner {
  min-height: 100px;
}

.dash-card h2 {
  font-size: 34px;
}

.dash-card p {
  font-size: 16px;
}

.dash-card button {
  min-height: 36px;
  background: #f3f6f9;
  color: var(--navy);
}

.module-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.45fr);
  gap: 18px;
  margin: 13px;
  padding: 18px;
}

.module-intro h2 {
  margin: 7px 0;
  color: var(--navy);
  font-size: 22px;
}

.module-intro p {
  margin: 6px 0;
  color: #526170;
}

.compact-intro {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.compact-intro div {
  display: grid;
  gap: 5px;
}

.compact-intro strong {
  color: var(--navy);
  font-size: 24px;
}

.compact-intro span {
  color: var(--muted);
  font-weight: 800;
}

.toolbar {
  padding: 16px;
  border-top: 1px solid #edf1f5;
}

.btn {
  min-height: 38px;
  border-radius: 6px;
}

.btn-green {
  background: #0d3154;
}

.btn-orange {
  background: #d88a2d;
}

.filter-line input {
  width: min(340px, 100%);
  border-bottom-color: #aab6c2;
}

table {
  font-size: 14px;
}

th {
  background: #0d3154;
}

th,
td {
  padding: 12px 11px;
  border-color: #edf1f5;
}

tbody tr:nth-child(even) {
  background: #fbfcfd;
}

tbody tr:hover,
tbody tr.selected {
  background: #edf5f8;
}

.badge-green {
  border-radius: 999px;
  background: #0d3154;
}

.status-green {
  color: #0f7a5a;
}

.status-orange {
  color: #bd741f;
}

.status-red {
  color: #bf3f36;
}

.modal-header {
  background: #071d36;
}

.modal-card {
  overflow: hidden;
}

.form-grid input,
.form-grid textarea,
.form-grid select,
.login-card input {
  border-radius: 6px;
  border-color: #cfd8e3;
}

.pagination .active {
  background: #0d3154;
}

@media (max-width: 1180px) {
  .kpi-grid,
  .ops-grid,
  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 760px) {
  html,
  body {
    width: 100%;
    overflow-x: hidden;
  }

  .login-page {
    min-height: 100svh;
    padding: 16px 12px;
    align-items: start;
  }

  .login-box {
    width: 100%;
    max-width: 420px;
    margin-top: 18px;
  }

  .login-logo {
    gap: 4px;
    margin-bottom: 10px;
  }

  .login-logo img {
    width: min(270px, 78vw);
  }

  .login-card {
    gap: 12px;
    padding: 18px;
  }

  .login-card h1 {
    font-size: 22px;
  }

  .main-header,
  .brand-logo,
  .hamburger {
    height: auto;
  }

  .main-header {
    position: sticky;
    top: 0;
    grid-template-columns: 1fr;
  }

  .brand-logo {
    min-height: 96px;
    padding: 8px 14px;
  }

  .brand-logo img {
    width: min(260px, 76vw);
    max-height: 88px;
  }

  .executive-headline {
    display: grid;
    gap: 10px;
  }

  .dashboard-month-picker {
    justify-content: space-between;
  }

  .dashboard-month-picker select {
    width: 150px;
  }

  .topbar {
    min-height: 56px;
    align-items: stretch;
  }

  .hamburger {
    width: 56px;
    min-height: 56px;
    flex: 0 0 auto;
  }

  .topbar-user {
    min-width: 0;
    gap: 8px;
    padding: 8px 10px 8px 0;
    font-size: 13px;
  }

  .topbar-user strong {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar-user a {
    text-underline-offset: 4px;
  }

  .avatar {
    width: 26px;
    height: 26px;
  }

  .logout-button {
    min-height: 28px;
    padding: 3px 7px;
    font-size: 12px;
  }

  .sidebar {
    top: 152px;
    width: 300px;
    transform: translateX(-300px);
  }

  .sidebar-collapsed .sidebar {
    transform: translateX(0);
  }

  .content,
  .sidebar-collapsed .content {
    width: 100%;
    max-width: 100vw;
    margin-left: 0 !important;
    padding: 16px 10px;
    overflow-x: hidden;
  }

  .admin-shell,
  .page-head,
  #pageContent,
  .executive-dashboard,
  .data-card,
  .panel-card {
    width: 100%;
    max-width: 100vw;
    min-width: 0;
  }

  .page-head {
    gap: 6px;
    margin-bottom: 12px;
  }

  .page-head h1 {
    font-size: 24px;
  }

  .executive-hero {
    min-height: auto;
    padding: 16px;
  }

  .executive-hero h2 {
    font-size: 22px;
    line-height: 1.18;
  }

  .executive-hero p,
  .ops-panel p,
  .module-intro p {
    font-size: 14px;
  }

  .kpi-grid,
  .ops-grid,
  .dashboard-grid,
  .module-intro,
  .compact-intro {
    grid-template-columns: 1fr;
  }

  .topbar-user {
    padding: 10px 14px 10px 0;
  }

  .kpi-card,
  .ops-panel,
  .dash-card,
  .data-card,
  .panel-card,
  .module-intro {
    border-radius: 7px;
  }

  .kpi-card {
    min-height: 78px;
    padding: 14px;
  }

  .kpi-card strong {
    font-size: 24px;
  }

  .dash-card {
    min-height: 116px;
  }

  .dash-card .inner {
    min-height: 86px;
    padding: 14px;
  }

  .dash-card h2 {
    font-size: 28px;
  }

  .dash-card p {
    max-width: 72%;
    font-size: 15px;
  }

  .dash-card .card-icon {
    right: 18px;
    bottom: 18px;
    transform: scale(3.8);
  }

  .module-intro {
    margin: 10px;
    padding: 14px;
  }

  .module-intro h2 {
    font-size: 18px;
    line-height: 1.25;
  }

  .toolbar {
    gap: 12px;
    padding: 12px;
  }

  .toolbar-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .toolbar-actions .btn {
    min-width: 0;
    padding: 6px 8px;
    font-size: 13px;
  }

  .filter-line {
    display: grid;
    gap: 5px;
    align-items: stretch;
    font-size: 14px;
  }

  .filter-line input {
    width: 100%;
    height: 36px;
    padding: 6px 8px;
    border: 1px solid #cfd8e3;
    border-radius: 6px;
    background: #fff;
  }

  .table-wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .data-table {
    display: block;
    min-width: 0;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
  }

  .data-table thead {
    display: none;
  }

  .data-table tbody {
    display: grid;
    gap: 10px;
    padding: 0 10px 10px;
  }

  .data-table tr {
    display: grid;
    overflow: hidden;
    border: 1px solid #dfe6ee;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(7, 29, 54, 0.06);
  }

  .data-table tr.selected {
    border-color: #d88a2d;
    background: #fff;
  }

  .data-table td {
    display: grid;
    grid-template-columns: minmax(96px, 0.38fr) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    min-width: 0;
    padding: 9px 10px;
    border: 0;
    border-bottom: 1px solid #edf1f5;
    overflow-wrap: anywhere;
  }

  .data-table td:last-child {
    border-bottom: 0;
  }

  .data-table td::before {
    color: #6f7a86;
    font-size: 12px;
    font-weight: 900;
    content: attr(data-label);
  }

  .data-table td[colspan] {
    display: block;
    text-align: center;
  }

  .data-table td[colspan]::before {
    content: "";
  }

  th,
  td {
    padding: 9px 8px;
  }

  .actions {
    flex-wrap: wrap;
    gap: 12px;
  }

  .icon-action {
    width: 30px;
    height: 30px;
    border: 1px solid #dfe6ee;
    border-radius: 6px;
    background: #f8fafc;
  }

  .iban-cell {
    min-width: 0;
    white-space: normal;
  }

  .payroll-summary,
  .compact-summary {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px;
  }

  .workflow-strip {
    padding: 10px;
  }

  .quick-tabs {
    padding: 10px 10px 0;
  }

  .quick-tabs button {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 13px;
  }

  .modal {
    width: calc(100vw - 16px);
  }

  .modal-card {
    max-height: calc(100svh - 24px);
  }

  .form-grid {
    grid-template-columns: 1fr;
    max-height: calc(100svh - 150px);
    overflow-y: auto;
    padding: 14px;
  }

  .file-upload-grid {
    grid-template-columns: 1fr;
  }

  .attendance-editor {
    max-height: 58svh;
  }

  .attendance-editor-head,
  .attendance-editor-row {
    grid-template-columns: 42px minmax(96px, 1fr) 82px 70px;
    gap: 6px;
    padding: 7px;
  }

  .pagination {
    justify-content: center;
  }
}

/* Final portal polish */
.main-header {
  grid-template-columns: 420px minmax(0, 1fr);
  height: 158px;
}

.brand-logo,
.hamburger {
  height: 158px;
}

.brand-logo {
  overflow: hidden;
  padding: 0;
}

.brand-logo img {
  width: 640px;
  max-width: none;
  max-height: none;
  transform: scale(1.35);
  transform-origin: center;
}

.sidebar {
  top: 158px;
  width: 420px;
}

.sidebar-collapsed .sidebar {
  transform: translateX(-420px);
}

.content {
  margin-left: 420px;
  padding-top: 182px;
}

.language-switch {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 6px;
}

.language-switch button {
  min-height: 30px;
  padding: 3px 9px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 900;
}

.language-switch button.active {
  background: var(--soft-orange);
  color: #071d36;
}

.dashboard-period-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.ops-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.monthly-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.monthly-breakdown div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(13, 49, 84, 0.1);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(7, 29, 54, 0.05);
}

.monthly-breakdown strong {
  color: var(--navy);
}

.monthly-breakdown span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.corporate-lanes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.lane-card {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 4px 10px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(13, 49, 84, 0.1);
  border-left: 5px solid #16805a;
  border-radius: 8px;
  background: #fff;
  text-align: left;
  box-shadow: 0 8px 18px rgba(7, 29, 54, 0.05);
}

.lane-card.bad {
  border-left-color: #c8453b;
}

.lane-card .nav-icon {
  grid-row: span 2;
}

.lane-card strong {
  color: var(--navy);
}

.lane-card small {
  color: var(--muted);
  font-weight: 800;
}

.dash-card .card-icon {
  color: color-mix(in srgb, var(--module-color) 58%, #cbd3dc);
  opacity: 0.72;
}

.quality-badge {
  display: inline-flex;
  min-width: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 8px;
  color: #fff;
  font-weight: 900;
}

.quality-ok,
.quality-bar.quality-ok {
  background: #16805a;
}

.quality-nok,
.quality-bar.quality-nok {
  background: #c8453b;
}

.quality-rok,
.quality-bar.quality-rok {
  background: #1776b8;
}

.quality-rnok,
.quality-bar.quality-rnok {
  background: #d88a2d;
}

.chart-action {
  color: #1776b8;
}

.chart-modal .modal-card {
  width: min(760px, calc(100vw - 24px));
}

.chart-content {
  display: grid;
  gap: 18px;
  padding: 20px;
}

.project-chart-summary {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid #dfe6ee;
  border-radius: 8px;
  background: #f8fafc;
}

.project-chart-summary strong {
  color: var(--navy);
  font-size: 22px;
}

.project-chart-summary span,
.project-chart-summary small {
  color: var(--muted);
  font-weight: 800;
}

.project-chart-summary p {
  margin: 0;
  color: #405061;
}

.project-quality-chart {
  display: grid;
  gap: 14px;
}

.quality-chart-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 70px;
  gap: 12px;
  align-items: center;
}

.quality-bar-track {
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef3f8;
}

.quality-bar {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.attendance-editor-head,
.attendance-editor-row {
  grid-template-columns: 60px minmax(150px, 1fr) minmax(120px, 0.7fr) minmax(100px, 0.55fr);
}

.attendance-editor-row select,
.attendance-editor-row input {
  width: 100%;
  min-width: 0;
}

@media (max-width: 1180px) {
  .main-header {
    grid-template-columns: 360px minmax(0, 1fr);
  }

  .brand-logo img {
    width: 350px;
  }

  .sidebar {
    width: 360px;
  }

  .sidebar-collapsed .sidebar {
    transform: translateX(-360px);
  }

  .content {
    margin-left: 360px;
  }
}

@media (max-width: 760px) {
  .main-header {
    grid-template-columns: 1fr;
    height: auto;
  }

  .brand-logo,
  .hamburger {
    height: auto;
  }

  .brand-logo {
    min-height: 110px;
  }

  .brand-logo img {
    width: min(430px, 116vw);
    max-height: none;
    transform: scale(1.22);
  }

  .sidebar {
    top: 166px;
    width: 300px;
  }

  .sidebar-collapsed .sidebar {
    transform: translateX(0);
  }

  .content,
  .sidebar-collapsed .content {
    margin-left: 0;
    padding-top: 16px;
  }

  .dashboard-period-controls,
  .ops-grid {
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .dashboard-period-controls {
    display: grid;
  }

  .dashboard-month-picker select {
    width: 100%;
  }

  .attendance-editor-head,
  .attendance-editor-row {
    grid-template-columns: 42px minmax(92px, 1fr) 82px 68px;
  }

  .quality-chart-row {
    grid-template-columns: 58px minmax(0, 1fr) 48px;
    gap: 8px;
  }
}

[data-quill-editor] .ql-editor {
  min-height: 220px;
  background: #fff;
}

/* Görsele tıklandığında beliren boyut/hizalama araç çubuğu (attachQuillImageControls) */
.quill-image-toolbar {
  /* fixed: <dialog>'ın (showModal) tarayıcı "üst katman"ı içinde, diyalogun kendi
     konumlandırmasından bağımsız olarak viewport'a göre konumlanır. */
  position: fixed;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--navy);
  border-radius: 6px;
  padding: 6px 8px;
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.5);
}
.quill-image-toolbar-label {
  color: #cfc2ef;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0 4px;
}
.quill-image-toolbar button {
  background: var(--navy-soft);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 5px 9px;
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
}
.quill-image-toolbar button:hover {
  background: var(--purple);
}

.site-management-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
  align-items: start;
}

.site-management-menu {
  display: grid;
  gap: 4px;
  background: #fff;
  border: 1px solid #e2e2e2;
  border-radius: 8px;
  padding: 8px;
}

.site-management-menu button {
  text-align: left;
  border: 0;
  background: none;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
  color: #333;
}

.site-management-menu button:hover {
  background: #f5f5f5;
}

.site-management-menu button.active {
  background: #eef7f2;
  color: #0d9488;
  font-weight: 700;
}
