﻿:root {
  --ink: #111827;
  --muted: #64748b;
  --page: #eef3f8;
  --panel: rgba(255, 255, 255, .94);
  --panel-border: #d8e3ef;
  --navy: #09111f;
  --navy-2: #101d33;
  --blue: #0f5f8f;
  --blue-2: #0ea5c6;
  --cyan: #38bdf8;
  --mint: #13b88a;
  --blue-soft: #e5f4ff;
  --rose-soft: #ffe8df;
  --line: #8fd3f4;
  --danger: #b42318;
  --danger-soft: #fee4e2;
  --shadow: 0 20px 50px rgba(15, 23, 42, .10);
  --shadow-sm: 0 8px 24px rgba(15, 23, 42, .08);
  --radius: 10px;
}


/* v98 UI polish: dark-mode selects, compact sidebar and mobile log/detail fixes */
html.theme-night select,
html.theme-night select option,
html.theme-night select optgroup {
    background-color: #0f1d31 !important;
    color: #e8f4ff !important;
}

html.theme-night select option:checked,
html.theme-night select option:hover {
    background-color: #1f9bd7 !important;
    color: #ffffff !important;
}

html.theme-night select optgroup {
    color: #9fc3df !important;
    font-weight: 900;
}

html.theme-night .log-detail-grid pre {
    background: #071524 !important;
    color: #dceafe !important;
    border-color: #31506c !important;
}

html.theme-night .log-detail-grid span {
    color: #9fb8d4 !important;
}

.mail-test-form {
    border-radius: 0 0 8px 8px;
    overflow: hidden;
}

.employee-modal-card .document-upload,
.employee-modal-card .document-bulk-actions,
.employee-modal-card .document-empty,
.employee-modal-card .document-card {
    border-radius: 8px;
}

.employee-modal-card .document-upload {
    overflow: hidden;
}

@media (min-width: 861px) {
    .sidebar {
        overflow: hidden;
    }

    .sidebar nav {
        flex: 1 1 auto;
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
        padding-right: 2px;
        scrollbar-color: rgba(125, 211, 252, 0.35) transparent;
        scrollbar-width: thin;
    }

    .sidebar:hover nav,
    .sidebar:focus-within nav,
    .sidebar.is-expanded nav {
        gap: 6px;
    }

    .sidebar:hover a,
    .sidebar:focus-within a,
    .sidebar.is-expanded a {
        min-height: 40px;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .sidebar:hover .brand,
    .sidebar:focus-within .brand,
    .sidebar.is-expanded .brand {
        min-height: 48px;
        margin-bottom: 10px;
        padding-bottom: 14px;
    }

    .sidebar:hover .sidebar-preferences,
    .sidebar:focus-within .sidebar-preferences,
    .sidebar.is-expanded .sidebar-preferences {
        margin-top: 10px;
    }

    .sidebar-preferences {
        flex: 0 0 auto;
    }
}

@media (min-width: 861px) and (max-height: 760px) {
    .sidebar:hover,
    .sidebar:focus-within,
    .sidebar.is-expanded {
        padding-top: 14px;
        padding-bottom: 10px;
    }

    .sidebar:hover a,
    .sidebar:focus-within a,
    .sidebar.is-expanded a {
        min-height: 36px;
        padding-top: 6px;
        padding-bottom: 6px;
    }

    .sidebar:hover nav,
    .sidebar:focus-within nav,
    .sidebar.is-expanded nav {
        gap: 4px;
    }

    .sidebar:hover .brand,
    .sidebar:focus-within .brand,
    .sidebar.is-expanded .brand {
        margin-bottom: 6px;
        padding-bottom: 10px;
    }
}

@media (max-width: 860px) {
    .log-maintenance,
    .log-purge-form {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        overflow: hidden;
    }

    .log-purge-form > *,
    .log-purge-form label {
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .log-purge-form input,
    .log-purge-form select,
    .log-purge-form .button {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
}

@media (max-width: 560px) {
    .logs-table td[data-label] .log-details,
    td[data-label] .log-details {
        grid-column: 1 / -1 !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .logs-table .log-detail-grid,
    .log-detail-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .logs-table .log-detail-grid > div,
    .log-detail-grid > div {
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .logs-table .log-detail-grid pre,
    .log-detail-grid pre {
        max-width: 100% !important;
        overflow: auto !important;
        white-space: pre !important;
        overflow-wrap: normal !important;
        word-break: normal !important;
        font-size: 9.5px !important;
        line-height: 1.32 !important;
        padding: 8px !important;
    }

    .timesheet-status-badge.incomplete {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-height: 54px !important;
        padding: 12px 16px !important;
        border-radius: 999px !important;
        font-size: clamp(12px, 3.25vw, 15px) !important;
        line-height: 1.25 !important;
        text-align: center !important;
    }
}

@media (max-width: 380px) {
    .logs-table .log-detail-grid,
    .log-detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}
html.theme-night {
  color-scheme: dark;
  --ink: #edf6ff;
  --muted: #adc2da;
  --page: #07111f;
  --panel: rgba(13, 28, 47, .96);
  --panel-border: #315171;
  --navy: #050914;
  --navy-2: #081426;
  --blue: #38bdf8;
  --blue-2: #22d3ee;
  --cyan: #67e8f9;
  --mint: #34d399;
  --blue-soft: rgba(14, 55, 84, .74);
  --rose-soft: rgba(87, 45, 39, .76);
  --line: #2879a8;
  --danger: #fecaca;
  --danger-soft: rgba(127, 29, 29, .54);
  --shadow: 0 22px 55px rgba(0, 0, 0, .42);
  --shadow-sm: 0 12px 32px rgba(0, 0, 0, .34);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  max-width: 100%;
  overflow-x: hidden;
}
body {
  margin: 0;
  min-height: 100vh;
  max-width: 100%;
  overflow-x: hidden;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(56, 189, 248, .20), transparent 28%),
    radial-gradient(circle at 90% 0%, rgba(19, 184, 138, .16), transparent 26%),
    linear-gradient(135deg, #f8fbff 0%, var(--page) 52%, #e7eef7 100%);
}
html.theme-night body {
  background:
    radial-gradient(circle at 9% 8%, rgba(56, 189, 248, .18), transparent 28%),
    radial-gradient(circle at 92% 5%, rgba(20, 184, 166, .13), transparent 28%),
    linear-gradient(135deg, #040814 0%, #07111f 48%, #0b2031 100%);
}
body.modal-open { overflow: hidden; }
a { color: var(--blue); text-decoration: none; font-weight: 700; }
input, select, textarea, button { font: inherit; }
input, select, textarea {
  width: 100%;
  border: 1px solid #cbd8e6;
  border-radius: 8px;
  padding: 10px 11px;
  background: linear-gradient(180deg, #fff, #fbfdff);
  color: #172033;
  outline: none;
}
select option,
select optgroup {
  background: #ffffff;
  color: #172033;
}
html.theme-night input,
html.theme-night select,
html.theme-night textarea {
  border-color: #2d4664;
  background: linear-gradient(180deg, #0f1c2f, #111f34);
  color: #e5edf7;
  color-scheme: dark;
}
html.theme-night select option,
html.theme-night select optgroup {
  background: #0f1c2f;
  color: #e8f3ff;
}
html.theme-night select option:checked {
  background: #1e8fcb;
  color: #ffffff;
}
html.theme-night input::placeholder,
html.theme-night textarea::placeholder {
  color: #7f90a9;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--blue-2);
  box-shadow: 0 0 0 4px rgba(14, 165, 198, .14);
}
textarea { min-height: 82px; resize: vertical; }
label { display: grid; gap: 7px; font-size: 13px; font-weight: 800; color: #334155; }
html.theme-night label { color: #c2d2e7; }
.auth-link {
  display: inline-flex;
  width: fit-content;
  margin-top: 8px;
  color: var(--blue);
  font-weight: 900;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: 72px;
  display: flex;
  flex-direction: column;
  color: #fff;
  padding: 22px 12px;
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 70%, #052b3f 100%);
  box-shadow: 14px 0 45px rgba(9, 17, 31, .22);
  overflow: hidden auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(125, 211, 252, .34) transparent;
  transition: width .24s ease, padding .24s ease, box-shadow .24s ease;
}
.sidebar::-webkit-scrollbar {
  width: 6px;
}
.sidebar::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(125, 211, 252, .30);
}
.sidebar:hover,
.sidebar:focus-within,
.sidebar.is-expanded {
  width: 250px;
  padding: 22px 18px;
  box-shadow: 18px 0 55px rgba(9, 17, 31, .30);
}
.brand {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 54px;
  padding: 12px 12px 18px;
  margin-bottom: 18px;
  font-size: 18px;
  font-weight: 900;
  white-space: nowrap;
  transition: color .18s ease;
}
.brand::after {
  content: attr(data-short);
  position: absolute;
  inset: 10px auto auto 7px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(56, 189, 248, .24), rgba(19, 184, 138, .18));
  border: 1px solid rgba(125, 211, 252, .30);
  color: #fff;
  font-size: 13px;
  opacity: 1;
  transition: opacity .18s ease;
}
.sidebar:hover .brand::after,
.sidebar:focus-within .brand::after,
.sidebar.is-expanded .brand::after {
  opacity: 0;
}
.sidebar:not(:hover):not(:focus-within):not(.is-expanded) .brand {
  color: transparent;
}
.brand::before {
  content: "";
  position: absolute;
  left: 12px;
  bottom: 0;
  width: 64px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), var(--mint));
  transition: width .2s ease;
}
.sidebar:not(:hover):not(:focus-within):not(.is-expanded) .brand::before {
  width: 34px;
}
.sidebar nav { display: grid; gap: 7px; }
.sidebar a {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 46px;
  color: #dbeafe;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 800;
  white-space: nowrap;
  transition: background .18s ease, border-color .18s ease, color .18s ease, padding .2s ease;
}
.sidebar a::before {
  content: attr(data-short);
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-right: 10px;
  border-radius: 8px;
  flex: 0 0 30px;
  background: rgba(255,255,255,.08);
  color: #e0f2fe;
  font-size: 12px;
  font-weight: 900;
  transition: background .18s ease, color .18s ease;
}
.sidebar:not(:hover):not(:focus-within):not(.is-expanded) a {
  width: 46px;
  padding: 7px;
  color: transparent;
}
.sidebar:not(:hover):not(:focus-within):not(.is-expanded) a::before {
  margin-right: 0;
}
.sidebar a:hover, .sidebar a.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(56, 189, 248, .22), rgba(19, 184, 138, .16));
  border-color: rgba(125, 211, 252, .32);
}
.sidebar a:hover::before,
.sidebar a.active::before {
  background: linear-gradient(135deg, rgba(56, 189, 248, .34), rgba(19, 184, 138, .25));
  color: #fff;
}
.nav-label {
  min-width: 0;
}
.alert-badge {
  position: static;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border: 2px solid #07111f;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #ff2d55, #dc2626 58%, #991b1b);
  box-shadow:
    0 0 0 3px rgba(239, 68, 68, .18),
    0 0 18px rgba(239, 68, 68, .46),
    0 10px 24px rgba(127, 29, 29, .32);
  font-size: 11px;
  font-weight: 1000;
  line-height: 1;
  letter-spacing: 0;
}
.alert-badge[hidden] {
  display: none;
}
.sidebar:not(:hover):not(:focus-within):not(.is-expanded) .alert-badge {
  position: absolute;
  top: 2px;
  left: 29px;
  margin-left: 0;
}
.notification-popover {
  position: fixed;
  z-index: 240;
  left: 96px;
  top: 92px;
  width: min(330px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  padding: 12px;
  border: 1px solid rgba(103, 232, 249, .32);
  border-radius: 12px;
  background: linear-gradient(180deg, #07111f, #071b2f);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .50), 0 0 0 1px rgba(15, 118, 160, .18);
  isolation: isolate;
}
.notification-popover::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 38px;
  width: 12px;
  height: 12px;
  border-top: 1px solid rgba(103, 232, 249, .32);
  border-left: 1px solid rgba(103, 232, 249, .32);
  background: #07111f;
  transform: rotate(45deg);
}
.notification-popover[hidden] {
  display: none;
}
.notification-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 2px 10px;
  border-bottom: 1px solid rgba(56, 189, 248, .18);
}
.notification-popover-head strong {
  color: #f4f8ff;
  font-size: 13px;
  font-weight: 1000;
}
.notification-popover-head a {
  min-height: auto;
  width: auto;
  padding: 0;
  border: 0;
  color: #93f4df;
  background: transparent;
  font-size: 12px;
  font-weight: 900;
}
.notification-popover-head a::before {
  display: none;
}
.notification-popover-list {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  max-height: min(300px, calc(100vh - 180px));
  overflow-x: hidden;
  overflow-y: auto;
}
.notification-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 58px;
  padding: 11px 12px;
  border: 1px solid rgba(56, 189, 248, .22);
  border-radius: 9px;
  color: #e8f7ff;
  background: rgba(8, 20, 38, .94);
  text-decoration: none;
  white-space: normal;
}
.notification-item::before {
  display: none !important;
  content: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  flex-basis: 0 !important;
}
.sidebar .notification-item,
.sidebar:not(:hover):not(:focus-within):not(.is-expanded) .notification-item {
  width: 100%;
  min-height: 58px;
  padding: 11px 12px;
  color: #e8f7ff;
}
.sidebar .notification-item::before,
.sidebar .notification-item:hover::before,
.sidebar .notification-item.active::before,
.sidebar:not(:hover):not(:focus-within):not(.is-expanded) .notification-item::before {
  display: none !important;
  content: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  flex-basis: 0 !important;
}
.notification-item:hover {
  color: #fff;
  border-color: rgba(103, 232, 249, .42);
  background: rgba(14, 55, 84, .86);
}
.notification-item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(103, 232, 249, .28);
  border-radius: 8px;
  color: #cffafe;
  background: rgba(14, 116, 144, .36);
  font-size: 12px;
  font-weight: 1000;
}
.notification-item-body {
  display: grid;
  min-width: 0;
}
.notification-item-body strong {
  color: #f4f8ff;
  font-size: 13px;
  font-weight: 1000;
  overflow-wrap: anywhere;
}
.notification-item-body small {
  color: #b9cae0;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.notification-empty {
  padding: 12px;
  border: 1px solid rgba(56, 189, 248, .20);
  border-radius: 9px;
  color: #b9cae0;
  background: rgba(8, 20, 38, .56);
  font-size: 12px;
  font-weight: 800;
}
.sidebar .nav-group {
  position: relative;
  display: grid;
  gap: 6px;
  min-width: 0;
}
.sidebar .nav-group-toggle {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 46px;
  color: #dbeafe;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  list-style: none;
  transition: background .18s ease, border-color .18s ease, color .18s ease, padding .2s ease;
}
.sidebar .nav-group-toggle::-webkit-details-marker {
  display: none;
}
.sidebar .nav-group-toggle::before {
  content: attr(data-short);
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-right: 10px;
  border-radius: 8px;
  flex: 0 0 30px;
  background: rgba(255,255,255,.08);
  color: #e0f2fe;
  font-size: 12px;
  font-weight: 900;
  transition: background .18s ease, color .18s ease;
}
.sidebar .nav-group-toggle:hover,
.sidebar .nav-group-toggle.active,
.sidebar .nav-group[open] .nav-group-toggle {
  color: #fff;
  background: linear-gradient(135deg, rgba(56, 189, 248, .22), rgba(19, 184, 138, .16));
  border-color: rgba(125, 211, 252, .32);
}
.sidebar .nav-group-toggle:hover::before,
.sidebar .nav-group-toggle.active::before,
.sidebar .nav-group[open] .nav-group-toggle::before {
  background: linear-gradient(135deg, rgba(56, 189, 248, .34), rgba(19, 184, 138, .25));
  color: #fff;
}
.sidebar .nav-group-chevron {
  margin-left: auto;
  color: #94f7df;
  font-size: 12px;
  font-weight: 900;
  transition: transform .18s ease;
}
.sidebar .nav-group[open] .nav-group-chevron {
  transform: rotate(180deg);
}
.sidebar .nav-submenu {
  display: grid;
  gap: 5px;
  padding-left: 14px;
  margin-left: 15px;
  border-left: 1px solid rgba(125, 211, 252, .28);
}
.sidebar .nav-submenu a {
  min-height: 38px;
  padding: 7px 9px;
  font-size: 14px;
}
.sidebar .nav-submenu a::before {
  width: 26px;
  height: 26px;
  flex-basis: 26px;
}
.sidebar:not(:hover):not(:focus-within):not(.is-expanded) .nav-group-toggle {
  width: 46px;
  padding: 7px;
  color: transparent;
}
.sidebar:not(:hover):not(:focus-within):not(.is-expanded) .nav-group-toggle::before {
  margin-right: 0;
}
.sidebar:not(:hover):not(:focus-within):not(.is-expanded) .nav-group-toggle span,
.sidebar:not(:hover):not(:focus-within):not(.is-expanded) .nav-group-chevron {
  display: none;
}
.sidebar:not(:hover):not(:focus-within):not(.is-expanded) .nav-submenu {
  position: absolute;
  left: 54px;
  top: 0;
  z-index: 20;
  min-width: 172px;
  padding: 8px;
  margin: 0;
  border: 1px solid rgba(125, 211, 252, .30);
  border-radius: 10px;
  background: #071426;
  box-shadow: 0 18px 42px rgba(0,0,0,.34);
}
.mobile-menu-toggle {
  display: none;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.sidebar-preferences {
  position: relative;
  align-self: center;
  width: 100%;
  margin-top: auto;
  padding-top: 10px;
  flex-shrink: 0;
}
.preferences-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(125, 211, 252, .30);
  border-radius: 10px;
  padding: 7px 8px;
  background: linear-gradient(135deg, rgba(56, 189, 248, .18), rgba(20, 184, 166, .12));
  color: #eaf6ff;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(0, 0, 0, .18);
}
.preferences-toggle:hover,
.preferences-toggle:focus-visible,
.sidebar-preferences[open] .preferences-toggle {
  border-color: rgba(94, 234, 212, .62);
  background: linear-gradient(135deg, rgba(56, 189, 248, .26), rgba(20, 184, 166, .20));
}
.preferences-avatar {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.10);
  flex: 0 0 auto;
}
.preferences-avatar img {
  width: 23px;
  height: 16px;
  border-radius: 3px;
  box-shadow: 0 3px 10px rgba(0,0,0,.22);
}
.preferences-summary {
  display: grid;
  gap: 2px;
  min-width: 0;
  text-align: left;
  line-height: 1.1;
}
.preferences-summary strong {
  font-size: 12px;
  font-weight: 900;
}
.preferences-summary small {
  color: #a8c7dd;
  font-size: 11px;
  font-weight: 800;
}
.preferences-chevron {
  margin-left: auto;
  color: #92f5df;
  font-size: 14px;
  font-weight: 900;
  transition: transform .18s ease;
}
.sidebar-preferences[open] .preferences-chevron {
  transform: rotate(180deg);
}
.preferences-popover {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 10px);
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(125, 211, 252, .28);
  border-radius: 12px;
  background: rgba(6, 18, 33, .96);
  box-shadow: 0 22px 50px rgba(0,0,0,.38);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease;
  z-index: 40;
}
.sidebar-preferences[open] .preferences-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.preferences-section {
  display: grid;
  gap: 7px;
}
.preferences-label {
  color: #94a3b8;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.preferences-language,
.preferences-theme {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.preferences-theme {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.language-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 32px;
  border: 1px solid rgba(125, 211, 252, .30);
  border-radius: 999px;
  padding: 5px 7px;
  background: rgba(255,255,255,.08);
  color: #dbeafe;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
}
.language-option img {
  width: 22px;
  height: 15px;
  border-radius: 3px;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.language-option span {
  transition: opacity .18s ease, max-width .18s ease;
  overflow: hidden;
  max-width: 40px;
}
.language-option.active {
  color: #0f172a;
  background: linear-gradient(135deg, #ffffff, #dff7ff);
  border-color: rgba(56, 189, 248, .72);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .18);
}
.theme-switcher {
  display: flex;
  gap: 6px;
  justify-content: center;
  width: auto;
  margin: 0;
  padding: 0;
}
.brand,
.sidebar nav,
.sidebar-preferences {
  flex-shrink: 0;
}
.theme-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  min-height: 32px;
  border: 1px solid rgba(125, 211, 252, .30);
  border-radius: 9px;
  padding: 5px 8px;
  background: rgba(255,255,255,.08);
  color: #dbeafe;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
}
.theme-icon {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(255,255,255,.10);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}
.theme-option.active {
  color: #0f172a;
  background: linear-gradient(135deg, #ffffff, #dff7ff);
  border-color: rgba(56, 189, 248, .72);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .18);
}
.sidebar:not(:hover):not(:focus-within):not(.is-expanded) .sidebar-preferences {
  width: 40px;
}
.sidebar:not(:hover):not(:focus-within):not(.is-expanded) .preferences-toggle {
  justify-content: center;
  min-height: 40px;
  padding: 3px;
}
.sidebar:not(:hover):not(:focus-within):not(.is-expanded) .preferences-summary,
.sidebar:not(:hover):not(:focus-within):not(.is-expanded) .preferences-chevron {
  display: none;
}
.sidebar:not(:hover):not(:focus-within):not(.is-expanded) .preferences-popover {
  left: 48px;
  right: auto;
  bottom: 0;
  width: 220px;
}
.main { margin-left: 72px; padding: 28px; transition: margin-left .24s ease; }
@media (min-width: 861px) and (max-height: 860px) {
  .sidebar {
    padding-top: 16px;
    padding-bottom: 12px;
  }
  .sidebar:hover,
  .sidebar:focus-within,
  .sidebar.is-expanded {
    padding-top: 16px;
    padding-bottom: 12px;
  }
  .brand {
    min-height: 46px;
    margin-bottom: 12px;
    padding-top: 8px;
    padding-bottom: 14px;
  }
  .sidebar nav {
    gap: 5px;
  }
  .sidebar a {
    min-height: 41px;
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .sidebar-preferences { padding-top: 8px; }
  .language-option,
  .theme-option {
    min-height: 30px;
  }
}
.auth-main { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-top-switchers {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 10;
  display: flex;
  gap: 8px;
  align-items: center;
}
.auth-language-switcher {
  display: flex;
  gap: 6px;
  padding: 8px;
  border: 1px solid #d5e6f2;
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow-sm);
}
.auth-language-switcher .language-option {
  color: #0f172a;
  background: #f8fbff;
  border-color: #d5e6f2;
}
.auth-theme-switcher {
  padding: 8px;
  border: 1px solid #d5e6f2;
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow-sm);
}
.auth-theme-switcher .theme-option {
  color: #0f172a;
  background: #f8fbff;
  border-color: #d5e6f2;
  width: 38px;
}
.auth-card, .panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.auth-card { width: min(460px, 100%); padding: 30px; }
.auth-card form { display: grid; gap: 16px; }
.panel { padding: 19px; margin-bottom: 18px; }
.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 15px;
}
.panel-head h2 {
  margin-bottom: 0;
}
.panel-head-actions {
  display: flex;
  gap: 9px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.panel-head-actions form {
  margin: 0;
}
.page-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 20px;
}
.page-head-actions {
  display: grid;
  justify-items: end;
  gap: 12px;
  width: min(760px, 100%);
}
.logs-head .page-head-actions {
  width: min(1120px, 100%);
}
.admin-page-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  white-space: normal;
}
.admin-page-actions .button {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
}
.mobile-filter-toggle,
.mobile-filter-head {
  display: none !important;
}
.employee-search {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(150px, 1fr) minmax(170px, 1fr) auto;
  gap: 10px;
  align-items: end;
  width: 100%;
  padding: 12px;
  border: 1px solid #d5e6f2;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(255,255,255,.95), rgba(236,248,255,.92));
  box-shadow: var(--shadow-sm);
}
.employee-search .actions {
  flex-wrap: nowrap;
}
.timesheet-search {
  grid-template-columns: minmax(180px, 1.4fr) minmax(150px, 1fr) auto;
}
.payment-search {
  grid-template-columns: minmax(190px, 1.4fr) minmax(150px, .9fr) minmax(150px, .9fr) auto;
}
.balance-search {
  grid-template-columns: minmax(190px, 1.4fr) minmax(150px, .8fr) auto;
}
.payroll-search {
  grid-template-columns: minmax(220px, 1.4fr) minmax(170px, .9fr) minmax(170px, .9fr) auto;
}
.log-search {
  grid-template-columns: minmax(220px, 1.2fr) minmax(170px, .8fr) minmax(180px, .8fr) minmax(190px, 1fr);
}
.log-search .actions {
  flex-wrap: nowrap;
}
.payroll-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.payroll-kpi {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.payroll-kpi span {
  display: block;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 900;
  text-transform: uppercase;
}
.payroll-kpi strong {
  display: block;
  margin-top: 8px;
  font-size: 1.45rem;
  line-height: 1.1;
}
.payroll-due-badge,
.timesheet-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(14, 116, 144, .18);
  font-size: .82rem;
  font-weight: 900;
  line-height: 1.15;
  white-space: nowrap;
}
.payroll-due-badge.normal {
  background: #e0f2fe;
  color: #075985;
}
.payroll-due-badge.soon {
  background: #fff7ed;
  color: #c2410c;
}
.payroll-due-badge.due,
.timesheet-status-badge.complete {
  background: #dcfce7;
  color: #166534;
}
.payroll-due-badge.missing,
.timesheet-status-badge.missing {
  background: #fee2e2;
  color: #991b1b;
}
.timesheet-status-badge.incomplete {
  background: #fef3c7;
  color: #92400e;
}
.payroll-summary-cell {
  display: block;
  margin-top: 3px;
}
.payroll-employee-stack {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.payroll-cycle-list {
  display: grid;
  gap: 12px;
}
.payroll-cycle-card {
  display: grid;
  gap: 13px;
  padding: 14px;
  border: 1px solid rgba(14, 116, 144, .22);
  border-radius: 8px;
  background: rgba(255, 255, 255, .72);
  box-shadow: var(--shadow-sm);
}
.payroll-cycle-top {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(250px, 1.4fr) minmax(180px, auto) minmax(140px, .8fr);
  gap: 12px;
  align-items: center;
}
.payroll-cycle-person,
.payroll-cycle-period,
.payroll-cycle-rest {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.payroll-cycle-person strong,
.payroll-cycle-period strong,
.payroll-cycle-rest strong {
  overflow-wrap: anywhere;
}
.payroll-cycle-person span,
.payroll-cycle-period span,
.payroll-cycle-rest span,
.payroll-cycle-metrics span,
.payroll-progress-label span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
}
.payroll-cycle-badges {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  align-items: center;
}
.payroll-cycle-rest {
  justify-items: start;
}
.payroll-cycle-rest strong {
  font-size: 1.25rem;
}
.payroll-cycle-progress {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.payroll-progress-block {
  display: grid;
  gap: 7px;
}
.payroll-progress-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}
.payroll-progress-label strong {
  font-size: .92rem;
  text-align: right;
}
.payroll-progress-bar {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(14, 116, 144, .14);
}
.payroll-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22c55e, #06b6d4);
}
.payroll-cycle-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 9px;
}
.payroll-cycle-metrics div {
  display: grid;
  gap: 5px;
  padding: 9px 10px;
  border: 1px solid rgba(14, 116, 144, .14);
  border-radius: 8px;
  background: rgba(14, 116, 144, .06);
}
.payroll-cycle-metrics strong {
  overflow-wrap: anywhere;
}
.payroll-cycle-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
}
.payroll-cycle-details {
  min-width: 220px;
}
.payroll-cycle-details summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 900;
}
.payroll-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  gap: 8px 14px;
  margin-top: 10px;
}
.payroll-detail-grid span {
  color: var(--muted);
}
.payroll-cycle-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.payroll-cycle-actions form {
  margin: 0;
}
.timesheet-group-list {
  display: grid;
  gap: 10px;
}
.payment-group-list {
  display: grid;
  gap: 10px;
}
.timesheet-employee-group {
  border: 1px solid rgba(14, 116, 144, .22);
  border-radius: 8px;
  background: rgba(255, 255, 255, .72);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.payment-employee-group {
  border: 1px solid rgba(14, 116, 144, .22);
  border-radius: 8px;
  background: rgba(255, 255, 255, .72);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.timesheet-employee-group summary {
  display: grid;
  grid-template-columns: 28px minmax(180px, 1.3fr) repeat(5, minmax(105px, .7fr)) minmax(130px, .8fr);
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  cursor: pointer;
  list-style: none;
}
.payment-employee-group summary {
  display: grid;
  grid-template-columns: 28px minmax(180px, 1.25fr) repeat(5, minmax(105px, .7fr)) minmax(130px, .8fr);
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  cursor: pointer;
  list-style: none;
}
.timesheet-employee-group summary::-webkit-details-marker {
  display: none;
}
.payment-employee-group summary::-webkit-details-marker {
  display: none;
}
.timesheet-employee-group summary::before {
  content: "+";
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(14, 116, 144, .12);
  color: var(--blue);
  font-weight: 900;
}
.payment-employee-group summary::before {
  content: "+";
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(14, 116, 144, .12);
  color: var(--blue);
  font-weight: 900;
}
.timesheet-employee-group[open] summary::before {
  content: "-";
}
.payment-employee-group[open] summary::before {
  content: "-";
}
.timesheet-group-person {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.payment-group-person {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.timesheet-group-person strong {
  overflow-wrap: anywhere;
}
.payment-group-person strong {
  overflow-wrap: anywhere;
}
.timesheet-group-person span,
.timesheet-group-metric small,
.timesheet-group-meta,
.payment-group-person span,
.payment-group-metric small,
.payment-group-meta {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
}
.timesheet-group-meta {
  justify-self: end;
  text-align: right;
  white-space: nowrap;
}
.timesheet-group-metric {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.payment-group-metric {
  display: grid;
  gap: 4px;
}
.timesheet-group-metric strong {
  font-size: 1.04rem;
  overflow-wrap: anywhere;
}
.payment-group-metric strong {
  font-size: 1.04rem;
}
.timesheet-group-body {
  display: grid;
  gap: 12px;
  padding: 0 14px 14px;
}
.payment-group-body {
  display: grid;
  gap: 12px;
  padding: 0 14px 14px;
}
.timesheet-group-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-weight: 900;
}
.payment-group-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-weight: 900;
}
.group-head-actions {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.compact-table-wrap table {
  min-width: 960px;
}
.archive-list {
  display: grid;
  gap: 14px;
}
.archive-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .05);
  padding: 16px;
}
.archive-card-head {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: center;
}
.archive-card h3,
.archive-card h4 {
  margin: 0;
}
.archive-card p {
  margin: 4px 0 0;
  color: var(--muted);
}
.archive-reactivate {
  display: flex;
  gap: 10px;
  align-items: end;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.archive-reactivate label {
  min-width: 180px;
  margin: 0;
}
.archive-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.archive-metrics div,
.archive-line {
  border: 1px solid rgba(62, 154, 210, .34);
  border-radius: 8px;
  padding: 10px;
  background: rgba(9, 22, 38, .35);
}
.archive-metrics span,
.archive-line span {
  display: block;
  color: var(--muted);
  font-weight: 800;
}
.archive-metrics strong {
  display: block;
  margin-top: 3px;
  font-size: 1.05rem;
}
.archive-details {
  margin-top: 14px;
}
.archive-details > summary {
  cursor: pointer;
  color: var(--cyan);
  font-weight: 900;
  padding: 8px 0;
}
.archive-action-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 10px;
  padding-top: 8px;
}
.archive-action-grid .button {
  width: 100%;
  justify-content: center;
}
.employee-status-history {
  padding: 16px 20px;
}
.employee-status-history > summary {
  cursor: pointer;
  color: var(--cyan);
  font-weight: 900;
}
.employee-status-history > h3 {
  margin-top: 14px;
}
.archive-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 8px 0 16px;
}
.archive-line {
  margin-top: 8px;
}
.compact-table {
  margin: 8px 0 16px;
}
.log-maintenance {
  display: grid;
  grid-template-columns: minmax(220px, .8fr) minmax(0, 2.2fr);
  gap: 18px;
  align-items: end;
}
.log-purge-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr)) minmax(210px, 1.2fr) auto;
  gap: 10px;
  align-items: end;
}
.admin-lock-search {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
}
.admin-security-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(420px, 1.35fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid #cfe0ec;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(255,255,255,.97), rgba(236,248,255,.91));
  box-shadow: var(--shadow-sm);
}
.admin-security-copy span {
  display: inline-flex;
  margin-bottom: 8px;
  color: #0f5f8f;
  font-size: 12px;
  font-weight: 1000;
  text-transform: uppercase;
}
.admin-security-copy h2 {
  margin-bottom: 6px;
  font-size: 21px;
}
.admin-security-copy p {
  margin-bottom: 0;
}
.admin-security-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 12px;
}
.admin-security-metrics div {
  display: grid;
  gap: 8px;
  align-content: center;
  min-height: 92px;
  padding: 14px;
  border: 1px solid #d5e6f2;
  border-radius: 9px;
  background: rgba(255,255,255,.72);
}
.admin-security-metrics span {
  color: #64748b;
  font-size: 11px;
  font-weight: 1000;
  text-transform: uppercase;
}
.admin-security-metrics strong {
  color: #102033;
  font-size: 22px;
  font-weight: 1000;
}
.admin-health-panel {
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid #d5e6f2;
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}
.admin-health-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.admin-health-card {
  display: grid;
  gap: 6px;
  min-height: 96px;
  align-content: center;
  padding: 13px;
  border: 1px solid #d5e6f2;
  border-radius: 9px;
  background: linear-gradient(135deg, #f8fcff, #eef8ff);
}
.admin-health-card.warning {
  border-color: #fecaca;
  background: linear-gradient(135deg, #fff7ed, #fff1f2);
}
.admin-health-card span,
.admin-health-activity span {
  color: #64748b;
  font-size: 11px;
  font-weight: 1000;
  text-transform: uppercase;
}
.admin-health-card strong {
  color: #102033;
  font-size: 22px;
  font-weight: 1000;
}
.admin-health-card small,
.admin-health-activity small,
.admin-health-activity p {
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}
.admin-health-card small.micro {
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.35;
  opacity: .9;
}
.admin-health-activity {
  display: grid;
  grid-template-columns: minmax(220px, .75fr) minmax(0, 1.35fr);
  gap: 10px;
  align-items: start;
  margin-top: 10px;
}
.admin-health-activity > div {
  display: grid;
  gap: 7px;
  padding: 11px 12px;
  border: 1px solid #d5e6f2;
  border-radius: 9px;
  background: rgba(248, 252, 255, .82);
}
.admin-health-activity > div > strong {
  display: grid;
  gap: 3px;
  color: #102033;
  font-size: 15px;
}
.admin-health-log-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.admin-health-log-list li {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
  min-height: 36px;
  padding: 6px 9px;
  border-radius: 8px;
  background: #fff;
}
.admin-health-log-list strong {
  color: #102033;
  font-size: 13px;
}
.admin-lock-search input {
  min-width: 220px;
}
.check-line {
  display: flex;
  min-height: 50px;
  flex-direction: row;
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid #d5e6f2;
  border-radius: 9px;
  background: #f8fbff;
}
.check-line input {
  width: 18px;
  height: 18px;
  min-height: 18px;
}
.check-line span {
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 6px; font-size: 30px; line-height: 1.12; }
h2 { margin-bottom: 15px; font-size: 18px; }
p { color: var(--muted); line-height: 1.45; }
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(145px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.kpi {
  position: relative;
  overflow: hidden;
  min-height: 104px;
  padding: 15px;
  border: 1px solid #cfe0ec;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(236, 248, 255, .90));
  box-shadow: var(--shadow-sm);
}
.kpi::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--blue-2), var(--mint));
}
.kpi span { display: block; color: #475569; font-size: 12px; font-weight: 900; text-transform: uppercase; }
.kpi strong { display: block; margin-top: 12px; font-size: 22px; }
.dashboard-alerts {
  display: grid;
  gap: 12px;
  margin: 0 0 18px;
}
.dashboard-alerts-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}
.dashboard-alerts-head h2 {
  margin-bottom: 4px;
}
.dashboard-alerts-head p {
  margin-bottom: 0;
}
.dashboard-alert-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 12px;
}
.dashboard-alert-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 10px;
  align-items: center;
  min-height: 92px;
  padding: 14px;
  overflow: hidden;
  border: 1px solid #cfe0ec;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(255,255,255,.98), rgba(236,248,255,.92));
  color: #102033;
  box-shadow: var(--shadow-sm);
}
.dashboard-alert-main {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-width: 0;
  color: inherit;
}
.dashboard-alert-main:hover {
  color: inherit;
}
.dashboard-alert-card:hover,
.dashboard-alert-card:has(a.dashboard-alert-main:hover) {
  transform: translateY(-1px);
  border-color: #55c7e9;
  box-shadow: 0 16px 34px rgba(14, 95, 143, .16);
}
.dashboard-alert-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--blue-2), var(--mint));
}
.dashboard-alert-card.warning::before {
  background: linear-gradient(90deg, #f59e0b, #22c55e);
}
.dashboard-alert-card.danger::before {
  background: linear-gradient(90deg, #ef4444, #f59e0b);
}
.dashboard-alert-card.success::before {
  background: linear-gradient(90deg, #10b981, #38bdf8);
}
.dashboard-alert-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(14, 165, 198, .28);
  border-radius: 9px;
  color: #075985;
  background: linear-gradient(135deg, rgba(14, 165, 198, .16), rgba(16, 185, 129, .12));
  font-size: 14px;
  font-weight: 1000;
}
.dashboard-alert-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.dashboard-alert-body strong {
  color: #102033;
  font-size: 14px;
  font-weight: 1000;
}
.dashboard-alert-body small {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}
.dashboard-alert-value {
  justify-self: end;
  padding: 7px 10px;
  border: 1px solid rgba(14, 165, 198, .24);
  border-radius: 999px;
  color: #0f4d6f;
  background: rgba(236, 248, 255, .86);
  font-size: 13px;
  font-weight: 1000;
  white-space: nowrap;
}
.dashboard-alert-dismiss {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border: 1px solid rgba(14, 165, 198, .24);
  border-radius: 999px;
  color: #64748b;
  background: rgba(236, 248, 255, .78);
  font-size: 19px;
  line-height: 1;
  font-weight: 900;
}
.dashboard-alert-dismiss:hover {
  color: #0f4d6f;
  border-color: rgba(14, 165, 198, .42);
  background: rgba(224, 247, 255, .96);
}
.dashboard-alert-dismiss:disabled {
  opacity: .55;
  cursor: wait;
}
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #d7e6f1;
  border-radius: 8px;
  background: #fff;
}
.pagination {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #d8e3ef;
  color: #64748b;
  font-weight: 800;
}
.pagination-links {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.page-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid #cbd8e6;
  border-radius: 7px;
  background: linear-gradient(135deg, #f8fbff, #e8eef5);
  color: #111827;
  font-weight: 900;
}
.page-button.active {
  color: #fff;
  border-color: #0ea5c6;
  background: linear-gradient(135deg, #0f5f8f, #13b88a);
  box-shadow: 0 10px 22px rgba(14, 95, 143, .18);
}
.page-button.arrow {
  min-width: 58px;
  font-size: 20px;
}
.page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 40px;
  color: #64748b;
  font-weight: 900;
}
table { width: 100%; border-collapse: collapse; min-width: 900px; }
th {
  background: linear-gradient(180deg, #145f8f, #0d4d76);
  color: #fff;
  font-weight: 900;
  text-align: left;
  padding: 10px;
  border: 1px solid #5fbde9;
  white-space: nowrap;
}
td {
  background: #fbfeff;
  padding: 9px 10px;
  border: 1px solid var(--line);
  vertical-align: middle;
}
tr:nth-child(odd) td { background: var(--blue-soft); }
td:nth-last-child(3) { background: var(--rose-soft); }
td:nth-last-child(2) { background: #dff4eb; }
td:nth-last-child(1) { background: #dcecf7; }
.grid-form { display: grid; grid-template-columns: repeat(4, minmax(160px, 1fr)); gap: 15px; }
.grid-form.compact { grid-template-columns: repeat(3, minmax(180px, 1fr)); }
.span-2 { grid-column: span 2; }
.form-actions, .inline-form, .actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.inline-form select, .inline-form input { min-width: 190px; }
.compact-head {
  align-items: end;
}
.compact-head p {
  margin-bottom: 0;
}
.year-filter-form {
  display: grid;
  min-width: 185px;
  padding: 8px;
  border: 1px solid #d5e6f2;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(236,248,255,.92));
  box-shadow: var(--shadow-sm);
}
.year-filter-form label {
  min-width: 0;
}
.year-filter-form label span {
  display: block;
  margin-bottom: 4px;
  color: #334155;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.year-filter-form select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding-block: 8px;
}
.mail-test-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
  align-items: end;
  gap: 14px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid #d8e5f1;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(241, 249, 255, .96), rgba(255, 255, 255, .94));
  box-shadow: var(--shadow-sm);
}
.mail-test-form h3 {
  margin: 0 0 4px;
  font-size: 16px;
}
.mail-test-form p {
  margin: 0;
  font-size: 13px;
}
.mail-test-form .button {
  min-height: 46px;
}
.backup-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.backup-actions-grid .mail-test-form {
  margin-top: 0;
}
.backup-manual-card {
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 12px;
}
.backup-card-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 10px;
  align-items: stretch;
  min-width: 0;
}
.backup-card-actions form {
  min-width: 0;
  margin: 0;
}
.backup-card-actions .button {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding-inline: 12px;
  font-size: 14px;
  line-height: 1.2;
  white-space: normal;
}
.backup-config-panel,
.backup-validation-panel,
.backup-connection-panel,
.backup-restore-panel {
  margin-top: 18px;
  border: 1px solid #d8e5f1;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(241, 249, 255, .92), rgba(255, 255, 255, .90));
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.backup-config-panel summary,
.backup-validation-panel summary,
.backup-connection-panel summary,
.backup-restore-panel summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  cursor: pointer;
  list-style: none;
}
.backup-config-panel summary::-webkit-details-marker,
.backup-validation-panel summary::-webkit-details-marker,
.backup-connection-panel summary::-webkit-details-marker,
.backup-restore-panel summary::-webkit-details-marker {
  display: none;
}
.backup-config-panel summary span,
.backup-validation-panel summary span,
.backup-connection-panel summary span,
.backup-restore-panel summary span {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.backup-config-panel summary strong,
.backup-validation-panel summary strong,
.backup-connection-panel summary strong,
.backup-restore-panel summary strong {
  color: var(--text);
  font-size: 15px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.backup-config-panel summary small,
.backup-validation-panel summary small,
.backup-connection-panel summary small,
.backup-restore-panel summary small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.backup-config-panel summary b,
.backup-validation-panel summary b,
.backup-connection-panel summary b,
.backup-restore-panel summary b {
  min-height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 0 14px;
  border: 1px solid #c9d9e8;
  border-radius: 9px;
  background: rgba(255,255,255,.72);
  color: var(--blue);
  font-size: 13px;
}
.backup-config-panel[open] summary,
.backup-validation-panel[open] summary,
.backup-connection-panel[open] summary,
.backup-restore-panel[open] summary {
  border-bottom: 1px solid #d8e5f1;
}
.backup-config-panel[open] summary b::after,
.backup-validation-panel[open] summary b::after,
.backup-connection-panel[open] summary b::after,
.backup-restore-panel[open] summary b::after {
  content: " ^";
}
.backup-config-form {
  padding: 14px;
  margin: 0;
}
.backup-config-form .copy-snippet {
  min-height: 44px;
  max-height: 88px;
}
.backup-cron-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}
.backup-cron-grid label {
  min-width: 0;
}
.backup-cron-grid .copy-snippet {
  width: 100%;
  min-height: 58px;
  max-height: 74px;
  overflow: auto;
  resize: vertical;
}
.backup-cron-grid .form-note {
  grid-column: 1 / -1;
  margin-top: 0;
  padding: 10px 12px;
  border: 1px solid rgba(14, 165, 198, .18);
  border-radius: 10px;
  background: rgba(241, 249, 255, .54);
}
.backup-config-form .backup-schedule-card {
  padding: 12px;
}
.backup-config-form .form-actions {
  margin-top: 0;
}
.backup-connection-actions {
  display: grid;
  gap: 12px;
  padding: 12px 14px 14px;
}
.backup-connection-actions .mail-test-form {
  margin: 0;
}
.backup-retention-card {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: 1fr;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid #d8e5f1;
  border-radius: 12px;
  background: rgba(241, 249, 255, .7);
}
.backup-retention-card legend {
  max-width: calc(100% - 18px);
  padding: 0 6px;
  font-size: 13px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: .03em;
  text-transform: uppercase;
}
.backup-retention-status {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  padding: 8px 11px;
  border: 1px solid rgba(14, 165, 198, .24);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(14, 165, 198, .13), rgba(255, 255, 255, .5));
  box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
}
.backup-retention-status span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.backup-retention-status strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}
.backup-retention-status small {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.backup-retention-status.disabled,
.backup-retention-status.unavailable {
  border-color: rgba(148, 163, 184, .28);
  background: rgba(148, 163, 184, .10);
}
.backup-retention-group {
  display: grid;
  grid-template-columns: minmax(170px, .7fr) repeat(2, minmax(140px, 1fr));
  gap: 10px;
  align-items: end;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(14, 165, 198, .18);
  border-radius: 10px;
  background: rgba(255,255,255,.45);
}
.backup-retention-group > strong {
  align-self: center;
  color: var(--text);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.backup-retention-group label {
  min-width: 0;
}
.backup-summary-schedule {
  grid-template-columns: minmax(150px, .55fr) repeat(3, minmax(120px, 1fr));
}
.backup-summary-time-field {
  overflow: hidden;
}
.backup-summary-schedule input[type="time"] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  inline-size: 100%;
  max-width: 100%;
  max-inline-size: 100%;
  min-width: 0;
  min-inline-size: 0;
  margin: 0;
  box-sizing: border-box;
  text-align: center;
}
.backup-summary-schedule .is-hidden {
  display: none;
}
.backup-retention-card .form-note {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(14, 165, 198, .18);
  border-radius: 10px;
  background: rgba(241, 249, 255, .54);
}
.backup-validation-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px 14px 14px;
}
.backup-validation-wide-card {
  display: grid;
  grid-template-columns: minmax(118px, .38fr) minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #d8e5f1;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(241, 249, 255, .74), rgba(255, 255, 255, .70));
}
.backup-validation-wide-card.warning {
  border-color: rgba(239, 68, 68, .42);
  background: linear-gradient(135deg, rgba(254, 242, 242, .92), rgba(255, 255, 255, .80));
}
.backup-validation-status,
.backup-validation-meta {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
}
.backup-validation-status span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.backup-validation-status strong {
  color: var(--text);
  font-size: 20px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.backup-validation-meta span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.backup-restore-guide {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 6px 12px;
  padding: 12px 14px 14px;
}
.backup-restore-guide span {
  display: block;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.backup-validation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.backup-validation-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid #d8e5f1;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(241, 249, 255, .96), rgba(255, 255, 255, .94));
  box-shadow: var(--shadow-sm);
}
.backup-validation-card.warning {
  border-color: rgba(239, 68, 68, .42);
  background: linear-gradient(135deg, rgba(254, 242, 242, .98), rgba(255, 255, 255, .95));
}
.backup-validation-card > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  margin-bottom: 12px;
}
.backup-validation-card span,
.backup-restore-guide > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.backup-validation-card strong {
  min-width: 0;
  font-size: 18px;
  overflow-wrap: anywhere;
}
.backup-validation-card dl {
  display: grid;
  gap: 8px;
  margin: 0;
}
.backup-validation-card dl > div {
  display: grid;
  grid-template-columns: minmax(92px, 128px) minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
}
.backup-validation-card dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.backup-validation-card dd {
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.backup-validation-card p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.backup-schedule-card {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid #d8e5f1;
  border-radius: 12px;
  background: rgba(241, 249, 255, .7);
}
.backup-schedule-card legend {
  max-width: calc(100% - 18px);
  padding: 0 6px;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  white-space: normal;
  overflow-wrap: anywhere;
}
.backup-schedule-card .check-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-column: 1 / -1;
  align-items: center;
  justify-content: start;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
}
.backup-schedule-card .check-row input {
  width: 22px;
  min-width: 22px;
  height: 22px;
}
.backup-schedule-card input,
.backup-schedule-card select {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.backup-schedule-card input[type="time"] {
  -webkit-appearance: none;
  appearance: none;
  text-align: left;
}
.form-note {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.copy-snippet {
  min-height: 58px;
  resize: vertical;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: .9rem;
  line-height: 1.45;
}
.balance-month-form {
  display: grid;
  grid-template-columns: minmax(180px, 220px) auto;
  justify-content: flex-end;
  align-items: end;
  gap: 8px;
  width: fit-content;
  margin-left: auto;
  padding: 8px;
  border: 1px solid #d5e6f2;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(236,248,255,.92));
  box-shadow: var(--shadow-sm);
}
.balance-month-form label {
  min-width: 0;
}
.balance-month-form label span {
  display: block;
  margin-bottom: 4px;
  color: #334155;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.balance-month-form select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding-block: 8px;
}
.history-years {
  display: grid;
  gap: 12px;
}
.history-year {
  border: 1px solid #d5e6f2;
  border-radius: 12px;
  background: linear-gradient(135deg, #f8fcff, #eef9ff);
  overflow: hidden;
}
.history-year summary {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  cursor: pointer;
  padding: 14px 16px;
  color: #111827;
  font-weight: 900;
}
.history-year summary::marker {
  color: #0f8db3;
}
.history-year summary strong {
  color: #64748b;
  font-size: 13px;
}
.history-year .compact-history {
  border-radius: 0;
  border-inline: 0;
  border-bottom: 0;
}
.profile-download-row.compact {
  margin: 0;
  padding: 0 16px 12px;
}
.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}
.permission-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 4px 0 2px;
}
.permission-group {
  border: 1px solid #d5e6f2;
  border-radius: 10px;
  padding: 12px;
  background: rgba(239, 249, 255, .72);
}
.permission-group legend {
  padding: 0 6px;
  font-weight: 900;
  color: #0f172a;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  font-weight: 800;
  color: #334155;
}
.check-row input {
  width: auto;
  min-height: auto;
}
.autocomplete-wrap {
  position: relative;
}
.autocomplete-panel {
  position: absolute;
  z-index: 80;
  top: calc(100% + 7px);
  left: 0;
  right: 0;
  display: none;
  max-height: 230px;
  overflow: auto;
  gap: 5px;
  padding: 7px;
  border: 1px solid #cbd8e6;
  border-radius: 10px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 18px 44px rgba(15, 23, 42, .18);
}
.autocomplete-panel::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 28px;
  width: 12px;
  height: 12px;
  border-left: 1px solid #cbd8e6;
  border-top: 1px solid #cbd8e6;
  background: #fff;
  transform: rotate(45deg);
}
.autocomplete-panel.is-open {
  display: grid;
}
.autocomplete-panel button {
  position: relative;
  z-index: 1;
  width: 100%;
  display: grid;
  gap: 3px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 10px;
  background: linear-gradient(135deg, #f8fcff, #edf7ff);
  color: #111827;
  text-align: left;
  cursor: pointer;
}
.autocomplete-panel button:hover,
.autocomplete-panel button:focus {
  border-color: #8fd3f4;
  background: linear-gradient(135deg, #e5f4ff, #dcfce7);
  outline: none;
}
.autocomplete-panel strong {
  font-size: 13px;
  line-height: 1.25;
}
.autocomplete-panel span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  color: #fff;
  padding: 10px 15px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(14, 95, 143, .22);
}
.button.secondary {
  background: linear-gradient(135deg, #e8eef5, #f8fbff);
  color: #0f172a;
  box-shadow: none;
  border: 1px solid #cbd8e6;
}
.button.danger {
  background: linear-gradient(135deg, #b42318, #ef4444);
  color: #fff;
  box-shadow: 0 10px 22px rgba(180, 35, 24, .18);
}
.button.small { min-height: 32px; padding: 7px 11px; font-size: 13px; }
.hero-action {
  min-width: 190px;
  min-height: 48px;
  border-radius: 10px;
  font-size: 15px;
  background: linear-gradient(135deg, #0f5f8f, #13b88a);
}
.panel-head-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.button.secondary.hero-action {
  background: linear-gradient(135deg, #e8eef5, #f8fbff);
  color: #0f172a;
  border: 1px solid #cbd8e6;
  box-shadow: none;
}
.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}
.modal-shell.is-open {
  opacity: 1;
  pointer-events: auto;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 17, 31, .54);
  backdrop-filter: blur(8px);
}
.modal-card {
  position: relative;
  width: min(1180px, 100%);
  max-height: min(86vh, 900px);
  overflow: auto;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(246,251,255,.96));
  border: 1px solid rgba(216, 227, 239, .95);
  border-radius: 14px;
  box-shadow: 0 30px 90px rgba(9, 17, 31, .34);
  padding: 22px;
  transform: translateY(14px) scale(.98);
  transition: transform .22s ease;
}
.modal-shell.is-open .modal-card {
  transform: translateY(0) scale(1);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #d8e3ef;
}
.modal-head-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.modal-footer-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #d8e3ef;
}
.modal-head h2 {
  margin-bottom: 4px;
  font-size: 22px;
}
.modal-head p {
  margin-bottom: 0;
}
.modal-close {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: #e8eef5;
  color: #0f172a;
  cursor: pointer;
  font-weight: 900;
  font-size: 18px;
}
.modal-close:hover {
  background: #dbe7f2;
}
.employee-modal-card .grid-form {
  grid-template-columns: repeat(3, minmax(190px, 1fr));
}
.employee-profile-card {
  width: min(1120px, 100%);
}
.employee-report-modal-card {
  width: min(1160px, 100%);
  max-height: min(84vh, 820px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.employee-report-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
  flex: 1 1 auto;
}
.employee-report-grid {
  display: grid;
  grid-template-columns: minmax(280px, .95fr) minmax(320px, 1.05fr);
  gap: 16px;
  min-height: 0;
}
.employee-report-section {
  border: 1px solid #d8e3ef;
  border-radius: 12px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(248, 252, 255, .98), rgba(237, 247, 255, .94));
  box-shadow: var(--shadow-sm);
  min-width: 0;
  min-height: 0;
  height: min(52vh, 440px);
  display: flex;
  flex-direction: column;
}
.employee-report-section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}
.employee-report-section-head h3 {
  margin: 0;
  font-size: 16px;
}
.employee-report-list,
.employee-report-field-grid {
  display: grid;
  gap: 9px;
  overflow: auto;
  padding-right: 4px;
  min-height: 0;
}
.employee-report-list {
  grid-auto-rows: min-content;
}
.employee-report-field-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
}
.employee-report-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 11px;
  border: 1px solid #d5e6f2;
  border-radius: 10px;
  background: linear-gradient(135deg, #ffffff, #eef9ff);
  color: #111827;
  cursor: pointer;
  min-width: 0;
}
.employee-report-option.compact {
  min-height: 44px;
  align-items: center;
}
.employee-report-option input[type="checkbox"],
.employee-report-section-head input[type="checkbox"] {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  padding: 0;
  margin: 1px 0 0;
  justify-self: start;
  align-self: flex-start;
  accent-color: var(--blue-2);
}
.employee-report-option.compact input[type="checkbox"],
.employee-report-section-head input[type="checkbox"] {
  margin-top: 0;
}
.employee-report-section-head .document-select-all {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: auto;
  min-width: 0;
  white-space: nowrap;
}
.employee-report-option span {
  display: block;
  min-width: 0;
}
.employee-report-option strong {
  display: block;
  font-size: 14px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.employee-report-option small {
  display: block;
  color: #64748b;
  font-size: 12px;
  margin-top: 3px;
  overflow-wrap: anywhere;
}
.profile-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.profile-grid div {
  background: linear-gradient(135deg, #f8fcff, #edf7ff);
  border: 1px solid #d5e6f2;
  border-radius: 10px;
  padding: 12px;
}
.profile-grid span {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  margin-bottom: 7px;
}
.profile-grid strong {
  display: block;
  color: #111827;
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.profile-download-row {
  display: flex;
  justify-content: flex-end;
  margin: -2px 0 18px;
}
.document-panel {
  border: 1px solid #d8e3ef;
  border-radius: 12px;
  padding: 18px;
  background: linear-gradient(135deg, rgba(248, 252, 255, .98), rgba(237, 247, 255, .94));
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.document-panel h3 {
  margin: 0 0 13px;
  font-size: 17px;
}
.document-upload {
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 15px;
}
.document-bulk-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #d5e6f2;
  border-radius: 10px;
  background: linear-gradient(135deg, #f8fcff, #eef9ff);
}
.document-select-all {
  display: inline-flex;
  grid-template-columns: none;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: #334155;
}
.document-select-all input,
.document-check input {
  width: 18px;
  height: 18px;
  padding: 0;
  accent-color: var(--blue-2);
}
.document-list {
  display: grid;
  gap: 10px;
}
.document-card {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  background: linear-gradient(135deg, #ffffff, #eef9ff);
  border: 1px solid #d5e6f2;
  border-radius: 10px;
  padding: 12px;
}
.document-card.no-check {
  grid-template-columns: minmax(0, 1fr) auto;
}
.document-card.no-actions {
  grid-template-columns: minmax(0, 1fr);
}
.document-card.has-check .document-main {
  grid-column: 2;
}
.document-card.no-check .document-main,
.document-card.no-actions .document-main {
  grid-column: 1;
}
.document-card.has-check .actions {
  grid-column: 3;
}
.document-card.no-check .actions {
  grid-column: 2;
}
.document-check {
  display: inline-flex;
  grid-template-columns: none;
  width: 22px;
  align-items: center;
  justify-content: center;
}
.document-card strong {
  display: block;
  margin-bottom: 4px;
}
.document-card span {
  display: block;
  color: #64748b;
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.doc-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 7px 11px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 900;
  color: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .10);
}
.doc-action:hover {
  color: #fff;
  filter: brightness(1.04);
}
.doc-action.open {
  background: linear-gradient(135deg, #0f5f8f, #0ea5c6);
}
.doc-action.download {
  background: linear-gradient(135deg, #0f766e, #13b88a);
}
.empty-note {
  margin: 0;
  padding: 14px;
  border: 1px dashed #b8c8d8;
  border-radius: 10px;
  background: #f8fbff;
}
.actions {
  white-space: nowrap;
  flex-wrap: nowrap;
}
.page-head-actions .admin-page-actions {
  flex-wrap: wrap;
  white-space: normal;
}
.page-head-actions .admin-page-actions .button {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  white-space: normal;
}
td.actions {
  min-width: 260px;
  gap: 8px;
}
td.actions .button.small,
td.actions .link-danger {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 12px;
  line-height: 1.15;
}
.document-card .actions { justify-content: flex-end; }
.actions form { margin: 0; }
.link-danger {
  border: 0;
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: 7px;
  cursor: pointer;
  padding: 7px 10px;
  font-weight: 900;
}
.alert {
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
  box-shadow: var(--shadow-sm);
}
.alert-error { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.toast-stack {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 3000;
  display: grid;
  gap: 10px;
  max-width: min(420px, calc(100vw - 32px));
}
.app-toast {
  padding: 14px 18px;
  border-radius: 14px;
  color: #fff;
  font-weight: 900;
  box-shadow: 0 18px 40px rgba(15, 57, 82, .22);
  animation: toastIn .24s ease-out;
}
.app-toast-success { background: linear-gradient(135deg, #0f7ea7, #12b48f); }
.app-toast-error { background: linear-gradient(135deg, #b91c1c, #ef4444); }
.app-toast.is-hiding { animation: toastOut .24s ease-in forwards; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateY(8px) scale(.98); }
}
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(280px, 1fr)); gap: 18px; }
.simple-list { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 9px; }
.simple-list li {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  background: linear-gradient(135deg, #edf9ff, #f8fcff);
  border: 1px solid #cde7f5;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 800;
}
.log-details {
  margin-top: 8px;
}
.log-details summary {
  cursor: pointer;
  font-weight: 900;
  color: var(--blue);
}
.log-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.log-detail-grid span {
  display: block;
  margin-bottom: 5px;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
.log-detail-grid pre {
  max-height: 220px;
  overflow: auto;
  margin: 0;
  padding: 10px;
  border: 1px solid #d5e6f2;
  border-radius: 8px;
  background: #f8fbff;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
}
.simple-list form { margin: 0; }
.mini-delete {
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: var(--danger-soft);
  color: var(--danger);
  line-height: 20px;
  padding: 0;
  cursor: pointer;
  font-weight: 900;
}
html.theme-night .auth-card,
html.theme-night .panel,
html.theme-night .employee-search,
html.theme-night .timesheet-search,
html.theme-night .payment-search,
html.theme-night .balance-search,
html.theme-night .payroll-search,
html.theme-night .log-search,
html.theme-night .log-maintenance,
html.theme-night .balance-month-form,
html.theme-night .year-filter-form,
html.theme-night .mail-test-form,
html.theme-night .backup-config-panel,
html.theme-night .backup-validation-panel,
html.theme-night .backup-connection-panel,
html.theme-night .backup-restore-panel,
html.theme-night .backup-schedule-card,
html.theme-night .backup-retention-card,
html.theme-night .backup-validation-card,
html.theme-night .backup-validation-wide-card,
html.theme-night .auth-language-switcher,
html.theme-night .auth-theme-switcher {
  background: linear-gradient(135deg, rgba(15, 27, 45, .96), rgba(12, 38, 56, .90));
  border-color: var(--panel-border);
  box-shadow: var(--shadow-sm);
}
html.theme-night .backup-validation-card.warning,
html.theme-night .backup-validation-wide-card.warning {
  border-color: rgba(248, 113, 113, .48);
  background: linear-gradient(135deg, rgba(69, 22, 32, .92), rgba(15, 27, 45, .90));
}
html.theme-night .backup-config-panel summary,
html.theme-night .backup-validation-panel summary,
html.theme-night .backup-connection-panel summary,
html.theme-night .backup-restore-panel summary {
  border-color: #315171;
}
html.theme-night .backup-config-panel summary strong,
html.theme-night .backup-config-panel summary b,
html.theme-night .backup-validation-panel summary strong,
html.theme-night .backup-validation-panel summary b,
html.theme-night .backup-connection-panel summary strong,
html.theme-night .backup-connection-panel summary b,
html.theme-night .backup-restore-panel summary strong,
html.theme-night .backup-restore-panel summary b,
html.theme-night .backup-restore-guide span {
  color: #e8f7ff;
}
html.theme-night .backup-config-panel summary small,
html.theme-night .backup-validation-panel summary small,
html.theme-night .backup-connection-panel summary small,
html.theme-night .backup-restore-panel summary small {
  color: var(--muted);
}
html.theme-night .backup-config-panel summary b,
html.theme-night .backup-validation-panel summary b,
html.theme-night .backup-connection-panel summary b,
html.theme-night .backup-restore-panel summary b {
  background: rgba(8, 20, 38, .74);
  border-color: #315171;
}
html.theme-night .backup-cron-grid .form-note {
  background: rgba(8, 20, 38, .50);
  border-color: rgba(103, 232, 249, .22);
}
html.theme-night .backup-retention-group,
html.theme-night .backup-retention-card .form-note,
html.theme-night .backup-retention-status {
  background: rgba(8, 20, 38, .50);
  border-color: rgba(103, 232, 249, .22);
}
html.theme-night .backup-retention-card legend,
html.theme-night .backup-retention-group > strong,
html.theme-night .backup-retention-status strong {
  color: #e8f7ff;
}
html.theme-night .backup-retention-status.disabled,
html.theme-night .backup-retention-status.unavailable {
  background: rgba(15, 23, 42, .68);
  border-color: rgba(148, 163, 184, .24);
}
html.theme-night .page-head-actions {
  background: transparent;
  box-shadow: none;
}
html.theme-night .auth-language-switcher .language-option,
html.theme-night .auth-theme-switcher .theme-option,
html.theme-night .language-option.active,
html.theme-night .theme-option.active {
  color: #e8f7ff;
  background: linear-gradient(135deg, rgba(56, 189, 248, .28), rgba(52, 211, 153, .18));
  border-color: rgba(103, 232, 249, .54);
}
html.theme-night .auth-language-switcher .language-option:not(.active),
html.theme-night .auth-theme-switcher .theme-option:not(.active) {
  color: #bfd3ea;
  background: rgba(8, 20, 38, .78);
  border-color: #263b55;
}
html.theme-night p,
html.theme-night .muted,
html.theme-night .pagination-info,
html.theme-night .year-filter-form label span,
html.theme-night .balance-month-form label span,
html.theme-night .document-card span,
html.theme-night .profile-grid span,
html.theme-night .backup-validation-card span,
html.theme-night .backup-validation-status span,
html.theme-night .backup-validation-meta span,
html.theme-night .backup-validation-card dt,
html.theme-night .backup-validation-card p {
  color: var(--muted);
}
html.theme-night .backup-validation-card strong,
html.theme-night .backup-validation-card dd,
html.theme-night .backup-validation-status strong {
  color: #e8f7ff;
}
html.theme-night .table-wrap {
  background: rgba(10, 24, 41, .80);
  border-color: #2879a8;
}
html.theme-night table th {
  background: linear-gradient(180deg, #0e5b83, #0b3e61);
  color: #f8fbff;
}
html.theme-night table td {
  color: #e5edf7;
  border-color: #2879a8;
  background: rgba(12, 27, 45, .88);
}
html.theme-night tr:nth-child(odd) td { background: rgba(14, 55, 84, .74); }
html.theme-night td:nth-last-child(3) { background: rgba(87, 45, 39, .76); }
html.theme-night td:nth-last-child(2) { background: rgba(15, 82, 71, .64); }
html.theme-night td:nth-last-child(1) { background: rgba(15, 46, 76, .78); }
html.theme-night .settings-card,
html.theme-night .profile-grid > div,
html.theme-night .document-card,
html.theme-night .document-bulk-actions,
html.theme-night .document-panel,
html.theme-night .employee-report-section,
html.theme-night .employee-report-option,
html.theme-night .history-year,
html.theme-night .history-list li,
html.theme-night .kpi-card,
html.theme-night .kpi,
html.theme-night .chart-card,
html.theme-night .empty-note {
  background: linear-gradient(135deg, rgba(13, 31, 52, .98), rgba(9, 24, 42, .94));
  border-color: #315171;
}
html.theme-night .kpi span,
html.theme-night .profile-grid span,
html.theme-night .document-card span,
html.theme-night .employee-report-option small {
  color: #b9cae0;
}
html.theme-night .kpi strong,
html.theme-night .profile-grid strong,
html.theme-night .document-card strong,
html.theme-night .employee-report-option,
html.theme-night .employee-report-option strong,
html.theme-night .employee-report-section-head h3,
html.theme-night .history-year summary,
html.theme-night .history-year summary strong {
  color: #f4f8ff;
}
html.theme-night .dashboard-alert-card {
  color: #e5edf7;
  background: linear-gradient(135deg, rgba(13, 31, 52, .98), rgba(9, 24, 42, .94));
  border-color: #315171;
}
html.theme-night .dashboard-alert-card:hover {
  border-color: #38bdf8;
  box-shadow: 0 16px 34px rgba(0, 0, 0, .30);
}
html.theme-night .dashboard-alert-icon {
  color: #cffafe;
  border-color: rgba(103, 232, 249, .30);
  background: linear-gradient(135deg, rgba(14, 165, 233, .22), rgba(16, 185, 129, .16));
}
html.theme-night .dashboard-alert-body strong {
  color: #f4f8ff;
}
html.theme-night .dashboard-alert-body small {
  color: #b9cae0;
}
html.theme-night .dashboard-alert-value {
  color: #dff7ff;
  border-color: rgba(103, 232, 249, .26);
  background: rgba(8, 20, 38, .58);
}
html.theme-night .dashboard-alert-dismiss {
  color: #b9cae0;
  border-color: rgba(103, 232, 249, .22);
  background: rgba(8, 20, 38, .58);
}
html.theme-night .dashboard-alert-dismiss:hover {
  color: #e8f7ff;
  border-color: rgba(103, 232, 249, .42);
  background: rgba(14, 55, 84, .80);
}
html.theme-night .payroll-due-badge.normal {
  background: rgba(14, 165, 233, .18);
  border-color: rgba(56, 189, 248, .35);
  color: #bae6fd;
}
html.theme-night .payroll-due-badge.soon,
html.theme-night .timesheet-status-badge.incomplete {
  background: rgba(217, 119, 6, .20);
  border-color: rgba(251, 191, 36, .38);
  color: #fde68a;
}
html.theme-night .payroll-due-badge.due,
html.theme-night .timesheet-status-badge.complete {
  background: rgba(16, 185, 129, .18);
  border-color: rgba(52, 211, 153, .36);
  color: #bbf7d0;
}
html.theme-night .payroll-due-badge.missing,
html.theme-night .timesheet-status-badge.missing {
  background: rgba(239, 68, 68, .18);
  border-color: rgba(248, 113, 113, .38);
  color: #fecaca;
}
html.theme-night .payroll-cycle-card {
  background: linear-gradient(135deg, rgba(14, 55, 84, .74), rgba(12, 27, 45, .92));
  border-color: #2879a8;
}
html.theme-night .timesheet-employee-group {
  background: linear-gradient(135deg, rgba(14, 55, 84, .74), rgba(12, 27, 45, .92));
  border-color: #2879a8;
}
html.theme-night .payment-employee-group {
  background: linear-gradient(135deg, rgba(14, 55, 84, .74), rgba(12, 27, 45, .92));
  border-color: #2879a8;
}
html.theme-night .payroll-cycle-metrics div {
  background: rgba(8, 20, 38, .45);
  border-color: rgba(56, 189, 248, .22);
}
html.theme-night .payroll-progress-bar {
  background: rgba(56, 189, 248, .14);
}
html.theme-night .payroll-cycle-person span,
html.theme-night .payroll-cycle-period span,
html.theme-night .payroll-cycle-rest span,
html.theme-night .payroll-cycle-metrics span,
html.theme-night .payroll-progress-label span,
html.theme-night .payroll-detail-grid span,
html.theme-night .payroll-cycle-details summary {
  color: #b9cae0;
}
html.theme-night .timesheet-group-person span,
html.theme-night .timesheet-group-metric small,
html.theme-night .timesheet-group-meta,
html.theme-night .timesheet-group-head {
  color: #b9cae0;
}
html.theme-night .payment-group-person span,
html.theme-night .payment-group-metric small,
html.theme-night .payment-group-meta,
html.theme-night .payment-group-head {
  color: #b9cae0;
}
html.theme-night .timesheet-employee-group summary::before {
  background: rgba(56, 189, 248, .16);
  color: #bae6fd;
}
html.theme-night .payment-employee-group summary::before {
  background: rgba(56, 189, 248, .16);
  color: #bae6fd;
}
html.theme-night .permission-group,
html.theme-night .check-line {
  background: linear-gradient(135deg, rgba(13, 31, 52, .98), rgba(11, 34, 50, .92));
  border-color: #315171;
}
html.theme-night .permission-group legend,
html.theme-night .check-row,
html.theme-night .check-line span {
  color: #e8f2ff;
}
html.theme-night .simple-list li {
  color: #e8f2ff;
  background: linear-gradient(135deg, rgba(20, 55, 82, .98), rgba(14, 43, 64, .94));
  border-color: #3b6c8d;
}
html.theme-night .admin-security-panel {
  background: linear-gradient(135deg, rgba(13, 31, 52, .98), rgba(9, 24, 42, .94));
  border-color: #315171;
}
html.theme-night .admin-security-copy span {
  color: #93f4df;
}
html.theme-night .admin-security-copy h2,
html.theme-night .admin-security-metrics strong {
  color: #f4f8ff;
}
html.theme-night .admin-security-metrics div {
  background: rgba(8, 20, 38, .55);
  border-color: rgba(56, 189, 248, .22);
}
html.theme-night .admin-security-metrics span {
  color: #b9cae0;
}
html.theme-night .admin-health-panel {
  background: var(--panel);
  border-color: #315171;
}
html.theme-night .admin-health-card,
html.theme-night .admin-health-activity > div {
  background: rgba(8, 20, 38, .55);
  border-color: rgba(56, 189, 248, .22);
}
html.theme-night .admin-health-card.warning {
  border-color: rgba(251, 146, 60, .45);
  background: rgba(67, 35, 20, .42);
}
html.theme-night .admin-health-card strong,
html.theme-night .admin-health-activity > div > strong,
html.theme-night .admin-health-log-list strong {
  color: #f4f8ff;
}
html.theme-night .admin-health-card span,
html.theme-night .admin-health-activity span,
html.theme-night .admin-health-card small,
html.theme-night .admin-health-activity small,
html.theme-night .admin-health-activity p {
  color: #b9cae0;
}
html.theme-night .admin-health-log-list li {
  background: rgba(15, 35, 58, .76);
}
html.theme-night .mini-delete {
  background: rgba(248, 113, 113, .22);
  color: #fecaca;
}
html.theme-night .modal-backdrop {
  background: rgba(2, 6, 23, .70);
}
html.theme-night .modal-card {
  background: linear-gradient(180deg, rgba(15, 27, 45, .98), rgba(9, 21, 36, .97));
  border-color: #28445f;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
}
html.theme-night .modal-close {
  background: #17263a;
  color: #e5edf7;
}
html.theme-night .autocomplete-panel {
  background: rgba(10, 22, 36, .98);
  border-color: #2d4664;
  box-shadow: 0 18px 45px rgba(0, 0, 0, .45);
}
html.theme-night .autocomplete-panel::before {
  background: #0a1624;
}
html.theme-night .autocomplete-panel button {
  color: #e5edf7;
  background: linear-gradient(135deg, #102033, #0d2a3d);
}
html.theme-night .autocomplete-panel button:hover,
html.theme-night .autocomplete-panel button:focus {
  background: linear-gradient(135deg, rgba(56, 189, 248, .22), rgba(52, 211, 153, .16));
}
html.theme-night .button.secondary,
html.theme-night .pagination a,
html.theme-night .pagination span,
html.theme-night .page-button,
html.theme-night .link-button {
  color: #e5edf7;
  background: linear-gradient(135deg, #15263a, #0f1c2f);
  border-color: #2d4664;
}
html.theme-night .pagination .active,
html.theme-night .page-button.active {
  color: #f8fbff;
  background: linear-gradient(135deg, #0ea5e9, #10b981);
  border-color: rgba(103, 232, 249, .55);
}
html.theme-night .page-ellipsis {
  color: var(--muted);
}
html.theme-night .link-danger {
  background: rgba(127, 29, 29, .50);
  color: #fecaca;
}
html.theme-night .alert {
  background: rgba(20, 83, 45, .62);
  color: #dcfce7;
  border-color: rgba(74, 222, 128, .38);
}
html.theme-night .alert-error {
  background: rgba(127, 29, 29, .62);
  color: #fee2e2;
  border-color: rgba(248, 113, 113, .40);
}
html.theme-night .log-detail-grid span {
  color: #9fb5d1;
}
html.theme-night .log-detail-grid pre {
  background: linear-gradient(135deg, rgba(8, 20, 38, .96), rgba(12, 31, 51, .94));
  border-color: #315171;
  color: #dcecff;
}
html.theme-night .pill {
  background: rgba(14, 55, 84, .78);
  border-color: #2879a8;
  color: #e5edf7;
}
@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .dashboard-alert-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-security-panel {
    grid-template-columns: 1fr;
  }
  .admin-health-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .admin-health-activity {
    grid-template-columns: 1fr;
  }
  .grid-form, .employee-modal-card .grid-form { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
  .profile-grid { grid-template-columns: repeat(2, minmax(170px, 1fr)); }
  .page-head-actions { width: 100%; justify-items: stretch; }
  .employee-search { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
  .document-upload { grid-template-columns: 1fr 1fr; }
  .document-upload .button { grid-column: span 2; }
}
@media (max-width: 860px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }
  .sidebar,
  .sidebar:hover,
  .sidebar:focus-within,
  .sidebar.is-expanded {
    position: sticky;
    top: 0;
    width: 100%;
    min-height: auto;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    overflow: visible;
    box-shadow: 0 12px 32px rgba(9, 17, 31, .18);
  }
  .sidebar .brand,
  .sidebar:not(:hover):not(:focus-within) .brand,
  .sidebar:not(:hover):not(:focus-within):not(.is-expanded) .brand {
    color: #fff;
  }
  .brand {
    min-height: 42px;
    margin: 0;
    padding: 8px 0 12px;
    font-size: 18px;
  }
  .brand::after,
  .sidebar a::before {
    display: none;
  }
  .brand::before,
  .sidebar:not(:hover):not(:focus-within) .brand::before,
  .sidebar:not(:hover):not(:focus-within):not(.is-expanded) .brand::before {
    left: 0;
    width: 64px;
  }
  .mobile-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    border: 1px solid rgba(125, 211, 252, .34);
    border-radius: 9px;
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(56, 189, 248, .22), rgba(19, 184, 138, .16));
    color: #fff;
    font-weight: 900;
    cursor: pointer;
  }
  .sidebar nav,
  .sidebar .sidebar-preferences {
    grid-column: 1 / -1;
    display: none;
  }
  .sidebar.mobile-open nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding-top: 8px;
  }
  .sidebar.mobile-open .sidebar-preferences {
    display: block;
    width: min(320px, 100%);
    justify-self: center;
    margin: 8px 0 0;
    padding-top: 0;
  }
  .sidebar a,
  .sidebar:not(:hover):not(:focus-within) a,
  .sidebar:not(:hover):not(:focus-within):not(.is-expanded) a {
    width: auto;
    min-height: 42px;
    padding: 10px 12px;
    color: #dbeafe;
  }
  .sidebar .language-option,
  .sidebar .theme-option,
  .sidebar:not(:hover):not(:focus-within) .language-option,
  .sidebar:not(:hover):not(:focus-within) .theme-option,
  .sidebar:not(:hover):not(:focus-within):not(.is-expanded) .language-option,
  .sidebar:not(:hover):not(:focus-within):not(.is-expanded) .theme-option {
    width: auto;
    justify-content: center;
    padding: 5px 7px;
  }
  .sidebar .language-option span,
  .sidebar .theme-option span:not(.theme-icon),
  .sidebar:not(:hover):not(:focus-within) .language-option span,
  .sidebar:not(:hover):not(:focus-within) .theme-option span:not(.theme-icon),
  .sidebar:not(:hover):not(:focus-within):not(.is-expanded) .language-option span,
  .sidebar:not(:hover):not(:focus-within):not(.is-expanded) .theme-option span:not(.theme-icon) {
    opacity: 1;
    max-width: 40px;
    display: inline;
  }
  .sidebar:not(:hover):not(:focus-within):not(.is-expanded) .sidebar-preferences {
    width: min(320px, 100%);
  }
  .sidebar:not(:hover):not(:focus-within):not(.is-expanded) .preferences-toggle {
    justify-content: flex-start;
    min-height: 48px;
    padding: 7px 8px;
  }
  .sidebar:not(:hover):not(:focus-within):not(.is-expanded) .preferences-summary,
  .sidebar:not(:hover):not(:focus-within):not(.is-expanded) .preferences-chevron {
    display: grid;
  }
  .sidebar:not(:hover):not(:focus-within):not(.is-expanded) .preferences-chevron {
    display: inline-block;
  }
  .sidebar:not(:hover):not(:focus-within):not(.is-expanded) .preferences-popover,
  .preferences-popover {
    left: 0;
    right: 0;
    bottom: calc(100% + 10px);
    width: auto;
  }
  .notification-popover {
    top: 74px;
    left: 14px;
    right: 14px;
    width: auto;
    max-width: none;
  }
  .main {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-left: 0;
    padding: 18px;
    overflow-x: hidden;
  }
  .page-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    min-width: 0;
    width: 100%;
  }
  .page-head > *,
  .panel,
  .admin-security-panel,
  .admin-health-panel {
    min-width: 0;
    max-width: 100%;
  }
  .page-head h1,
  .page-head p,
  .admin-security-copy h2,
  .admin-security-copy p,
  .admin-health-panel h2,
  .admin-health-panel p {
    max-width: 100%;
    overflow-wrap: anywhere;
    text-align: left;
  }
  .panel-head { align-items: stretch; display: grid; }
  .panel-head-actions {
    justify-content: stretch;
  }
  .panel-head-actions .button {
    width: 100%;
  }
  .page-head-actions {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    justify-items: stretch;
  }
  .page-head-actions .actions {
    width: 100%;
    min-width: 0;
    justify-content: stretch;
  }
  .page-head-actions .actions .button {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
  }
  .log-maintenance,
  .log-purge-form,
  .admin-lock-search,
  .mail-test-form {
    grid-template-columns: 1fr;
  }
  .backup-actions-grid,
  .backup-card-actions,
  .backup-validation-grid,
  .backup-cron-grid,
  .backup-validation-row,
  .backup-restore-guide,
  .backup-retention-card,
  .backup-retention-group,
  .backup-schedule-card {
    grid-template-columns: 1fr;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
  .backup-validation-card,
  .backup-config-panel,
  .backup-validation-panel,
  .backup-connection-panel,
  .backup-restore-panel,
  .backup-validation-wide-card {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
  .backup-validation-wide-card {
    grid-template-columns: 1fr;
  }
  .backup-summary-schedule {
    justify-items: stretch;
    overflow: hidden;
  }
  .backup-summary-schedule label,
  .backup-summary-schedule input,
  .backup-summary-schedule select {
    width: 100%;
    inline-size: 100%;
    max-width: 100%;
    max-inline-size: 100%;
    min-width: 0;
    min-inline-size: 0;
    justify-self: stretch;
  }
  .backup-summary-schedule input[type="time"] {
    width: calc(100% - 2px);
    inline-size: calc(100% - 2px);
    justify-self: center;
  }
  .backup-validation-card > div:first-child {
    display: grid;
    align-items: start;
  }
  .backup-validation-card dl > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
  .backup-retention-status {
    grid-template-columns: 1fr;
    justify-items: start;
    width: 100%;
    border-radius: 10px;
  }
  .backup-actions-grid .button,
  .backup-card-actions .button,
  .backup-schedule-card label,
  .backup-schedule-card input,
  .backup-schedule-card select {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
  .backup-schedule-card input[type="time"] {
    justify-self: stretch;
    text-align: left;
  }
  .log-maintenance,
  .log-purge-form,
  .log-purge-form label,
  .log-purge-form input,
  .log-purge-form select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  .admin-lock-search {
    display: grid;
    align-items: stretch;
  }
  .admin-security-metrics {
    grid-template-columns: 1fr;
    width: 100%;
    min-width: 0;
  }
  .admin-security-metrics div,
  .admin-health-card {
    width: 100%;
    min-width: 0;
    justify-items: start;
    text-align: left;
  }
  .admin-security-metrics span,
  .admin-security-metrics strong,
  .admin-health-card span,
  .admin-health-card strong,
  .admin-health-card small {
    max-width: 100%;
    overflow-wrap: anywhere;
  }
  .log-purge-form .button,
  .mail-test-form .button {
    width: 100%;
  }
  .mobile-filter-toggle {
    display: inline-flex !important;
    width: auto;
    min-width: 150px;
    max-width: 180px;
    min-height: 46px;
    padding-inline: 24px;
  }
  .mobile-filter-head {
    display: flex !important;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #d8e5f1;
  }
  .mobile-filter-head h2 {
    margin-bottom: 3px;
    font-size: 21px;
  }
  .mobile-filter-head p {
    margin-bottom: 0;
  }
  .payroll-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .payroll-cycle-top,
  .payroll-cycle-progress {
    grid-template-columns: 1fr;
  }
  .payroll-cycle-metrics,
  .payroll-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .payroll-cycle-footer {
    display: grid;
    align-items: stretch;
  }
  .payroll-cycle-actions {
    justify-content: flex-start;
  }
  .timesheet-employee-group summary {
    grid-template-columns: 28px minmax(0, 1fr) repeat(2, minmax(90px, .5fr));
  }
  .payment-employee-group summary {
    grid-template-columns: 28px minmax(0, 1fr) repeat(2, minmax(90px, .5fr));
  }
  .timesheet-group-meta {
    grid-column: 2 / -1;
  }
  .payment-group-meta {
    grid-column: 2 / -1;
  }
  .employee-search,
  .timesheet-search,
  .payment-search,
  .balance-search,
  .payroll-search,
  .log-search,
  .archive-search {
    display: none;
  }
  .employee-search.is-filter-open,
  .timesheet-search.is-filter-open,
  .payment-search.is-filter-open,
  .balance-search.is-filter-open,
  .payroll-search.is-filter-open,
  .log-search.is-filter-open,
  .archive-search.is-filter-open {
    position: fixed;
    z-index: 150;
    inset: 9vh 14px auto;
    max-height: 82vh;
    overflow: auto;
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    width: auto;
    padding: 18px;
    border-radius: 13px;
    background: linear-gradient(135deg, rgba(255,255,255,.98), rgba(235,247,255,.96));
    box-shadow: 0 0 0 999px rgba(15, 23, 42, .58), 0 26px 70px rgba(2, 6, 23, .30);
  }
  html.theme-night .employee-search.is-filter-open,
  html.theme-night .timesheet-search.is-filter-open,
  html.theme-night .payment-search.is-filter-open,
  html.theme-night .balance-search.is-filter-open,
  html.theme-night .payroll-search.is-filter-open,
  html.theme-night .log-search.is-filter-open,
  html.theme-night .archive-search.is-filter-open {
    background: linear-gradient(135deg, rgba(15, 27, 45, .98), rgba(12, 38, 56, .96));
    box-shadow: 0 0 0 999px rgba(2, 6, 23, .70), 0 26px 70px rgba(0, 0, 0, .46);
  }
  .employee-search.is-filter-open .actions,
  .timesheet-search.is-filter-open .actions,
  .payment-search.is-filter-open .actions,
  .balance-search.is-filter-open .actions,
  .payroll-search.is-filter-open .actions,
  .log-search.is-filter-open .actions,
  .archive-search.is-filter-open .actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .pagination { align-items: flex-start; display: grid; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-alert-grid { grid-template-columns: 1fr; }
  .grid-form, .grid-form.compact, .settings-grid, .employee-modal-card .grid-form { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .profile-grid, .document-upload { grid-template-columns: 1fr; }
  .document-upload .button { grid-column: auto; }
  .document-bulk-actions { align-items: stretch; display: grid; }
  .document-card.has-check { grid-template-columns: 28px minmax(0, 1fr); }
  .document-card.no-check,
  .document-card.no-actions { grid-template-columns: minmax(0, 1fr); }
  .document-card.has-check .document-main { grid-column: 2; }
  .document-card.no-check .document-main,
  .document-card.no-actions .document-main { grid-column: 1; }
  .document-card.has-check .actions { grid-column: 2; }
  .document-card.no-check .actions,
  .document-card.no-actions .actions { grid-column: 1; }
  .document-card .actions { justify-content: flex-start; white-space: normal; }
  .profile-download-row { justify-content: stretch; }
  .profile-download-row .button { width: 100%; }
  .archive-card-head,
  .archive-detail-grid,
  .archive-metrics,
  .archive-action-grid {
    grid-template-columns: 1fr;
  }
  .archive-reactivate,
  .archive-reactivate label,
  .archive-reactivate .button {
    width: 100%;
  }
  .archive-reactivate {
    justify-content: stretch;
  }
  .balance-month-form {
    width: 100%;
    grid-template-columns: 1fr;
  }
  .history-year summary {
    align-items: flex-start;
    display: grid;
  }
}
@media (max-width: 560px) {
  .notification-popover {
    top: 68px;
    left: 12px;
    right: 12px;
    padding: 10px;
  }
  .notification-item {
    grid-template-columns: 34px minmax(0, 1fr);
  }
  .admin-security-panel {
    padding: 14px;
  }
  .admin-security-copy h2 {
    font-size: 19px;
  }
  .admin-security-metrics div {
    min-height: 78px;
    padding: 12px;
  }
  .admin-health-panel {
    padding: 12px;
  }
  .admin-health-grid {
    grid-template-columns: 1fr;
  }
  .admin-health-card {
    min-height: 78px;
    padding: 11px;
  }
  .admin-health-log-list li {
    display: grid;
  }
  .payroll-kpi-grid {
    grid-template-columns: 1fr;
  }
  .payroll-cycle-card {
    padding: 12px;
  }
  .payroll-cycle-metrics,
  .payroll-detail-grid {
    grid-template-columns: 1fr;
  }
  .payroll-progress-label {
    display: grid;
  }
  .payroll-progress-label strong {
    text-align: left;
  }
  .payroll-cycle-actions .button {
    width: 100%;
  }
  .timesheet-employee-group summary {
    grid-template-columns: 28px minmax(0, 1fr);
  }
  .payment-employee-group summary {
    grid-template-columns: 28px minmax(0, 1fr);
  }
  .timesheet-group-metric,
  .timesheet-group-meta,
  .payment-group-metric,
  .payment-group-meta {
    grid-column: 2;
  }
  .timesheet-group-head {
    display: grid;
    align-items: stretch;
  }
  .payment-group-head {
    display: grid;
    align-items: stretch;
  }
  .timesheet-group-head .button {
    width: 100%;
  }
  .payment-group-head .button {
    width: 100%;
  }
  .group-head-actions {
    display: grid;
    width: 100%;
    justify-content: stretch;
  }
  .group-head-actions .button {
    width: 100%;
  }
  .sidebar nav, .kpi-grid { grid-template-columns: 1fr; }
  .dashboard-alert-card {
    grid-template-columns: minmax(0, 1fr) 30px;
    min-height: 88px;
    padding: 13px;
  }
  .dashboard-alert-main {
    grid-template-columns: 38px minmax(0, 1fr);
  }
  .dashboard-alert-icon {
    width: 38px;
    height: 38px;
  }
  .dashboard-alert-value {
    grid-column: 2;
    justify-self: start;
  }
  .main { padding: 12px; }
  .page-head {
    gap: 12px;
  }
  .page-head h1 {
    font-size: clamp(28px, 9vw, 34px);
    line-height: 1.08;
  }
  .page-head p {
    font-size: clamp(15px, 4.5vw, 18px);
  }
  .page-head-actions .actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
  .page-head-actions .actions .button {
    width: 100%;
    min-height: 48px;
    padding-inline: 12px;
    line-height: 1.2;
  }
  .admin-security-panel {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
  }
  .admin-security-metrics div {
    min-height: 74px;
    padding: 11px;
  }
  .admin-security-metrics strong,
  .admin-health-card strong {
    font-size: clamp(20px, 7vw, 26px);
    line-height: 1.15;
  }
  .auth-top-switchers {
    top: 10px;
    right: 10px;
    left: 10px;
    justify-content: center;
    flex-wrap: wrap;
  }
  .auth-language-switcher,
  .auth-theme-switcher {
    padding: 6px;
  }
  .panel { padding: 14px; }
  .page-head {
    margin-bottom: 16px;
  }
  h1 {
    font-size: 32px;
  }
  .panel-head {
    gap: 14px;
  }
  .hero-action {
    width: 100%;
  }
  .mobile-filter-toggle {
    width: auto;
    min-width: 150px;
    max-width: 170px;
    padding-inline: 24px;
  }
  .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }
  table {
    min-width: 0;
    display: block;
  }
  thead {
    display: none;
  }
  tbody {
    display: grid;
    gap: 12px;
  }
  tr {
    display: grid;
    gap: 0;
    overflow: hidden;
    border: 1px solid #c9e0ef;
    border-radius: 10px;
    background: linear-gradient(135deg, #ffffff, #edf8ff);
    box-shadow: var(--shadow-sm);
  }
  html.theme-night tr {
    border-color: #28445f;
    background: linear-gradient(135deg, rgba(15, 27, 45, .96), rgba(12, 35, 55, .90));
  }
  td {
    display: grid;
    grid-template-columns: minmax(108px, 38%) minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-height: 48px;
    padding: 11px 12px;
    border: 0;
    border-bottom: 1px solid #d8e8f2;
    background: transparent !important;
    word-break: break-word;
  }
  td:last-child {
    border-bottom: 0;
  }
  td[data-label]::before {
    content: attr(data-label);
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
  }
  html.theme-night td[data-label]::before {
    color: #9fb0c7;
  }
  td:not([data-label]) {
    display: block;
  }
  .payroll-employee-stack {
    grid-column: 2;
  }
  .payroll-summary-cell {
    margin-top: 0;
  }
  .log-details {
    min-width: 0;
  }
  td[data-label] .log-details {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
  }
  .log-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 100%;
  }
  .log-detail-grid > div {
    min-width: 0;
  }
  .log-detail-grid pre {
    max-width: 100%;
    overflow-x: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    font-size: 11px;
    line-height: 1.35;
  }
  .timesheet-status-badge.incomplete {
    justify-self: stretch;
    width: 100%;
    max-width: 100%;
    min-height: 46px;
    padding: 10px 14px;
    white-space: normal;
    line-height: 1.25;
    text-align: center;
  }
  .payroll-due-table tr {
    max-width: 100%;
  }
  .payroll-due-table td {
    grid-template-columns: minmax(92px, 34%) minmax(0, 1fr);
    overflow: hidden;
  }
  .payroll-due-table td:nth-child(3) .payroll-due-badge,
  .payroll-due-table td:nth-child(4) .timesheet-status-badge {
    justify-self: start;
    width: auto;
    max-width: 100%;
    min-height: 36px;
    padding: 8px 12px;
    border-radius: 14px;
    white-space: normal;
    text-align: left;
    overflow-wrap: anywhere;
  }
  .payroll-due-table td:nth-child(4) .timesheet-status-badge.incomplete {
    width: auto;
    min-height: 36px;
    line-height: 1.2;
    text-align: left;
  }
  td.actions {
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    justify-content: stretch;
    gap: 10px;
  }
  td.actions::before {
    display: block;
  }
  td.actions > .button,
  td.actions > form {
    width: 100%;
  }
  td.actions form {
    display: block;
  }
  td.actions .button,
  td.actions .link-danger {
    width: 100%;
    justify-content: center;
    min-height: 38px;
    padding: 8px 11px;
    font-size: 13px;
  }
  td[colspan] {
    display: block;
  }

  .compact-table-wrap {
    overflow-x: auto;
    border: 1px solid #2d8fc0;
    border-radius: 8px;
    background: rgba(255, 255, 255, .94);
    -webkit-overflow-scrolling: touch;
  }

  html.theme-night .compact-table-wrap {
    background: rgba(10, 26, 43, .94);
    border-color: #1d84b6;
  }

  .compact-table-wrap table {
    display: table;
    min-width: 760px;
    width: 100%;
  }

  .compact-table-wrap thead {
    display: table-header-group;
  }

  .compact-table-wrap tbody {
    display: table-row-group;
  }

  .compact-table-wrap tr {
    display: table-row;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .compact-table-wrap td,
  .compact-table-wrap th {
    display: table-cell;
    min-height: 0;
    padding: 10px 11px;
    border-bottom: 1px solid #1b82b2;
    word-break: normal;
    overflow-wrap: anywhere;
    vertical-align: middle;
  }

  .compact-table-wrap td[data-label]::before {
    content: none;
  }

  .compact-table-wrap td.actions {
    display: table-cell;
    min-width: 210px;
    white-space: nowrap;
  }

  .compact-table-wrap td.actions > .button,
  .compact-table-wrap td.actions > form,
  .compact-table-wrap td.actions .button,
  .compact-table-wrap td.actions .link-danger {
    width: auto;
  }

  .compact-table-wrap td.actions form {
    display: inline-block;
    margin: 0 0 0 6px;
  }

  .compact-table-wrap td.actions .button,
  .compact-table-wrap td.actions .link-danger {
    min-height: 34px;
    padding: 7px 10px;
  }
}
@media (max-width: 380px) {
  .log-detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* v99 final UI fixes: keep at the end so responsive/theme rules cannot override it. */
html.theme-night select,
html.theme-night select option,
html.theme-night select optgroup {
  background: #0f1d31 !important;
  background-color: #0f1d31 !important;
  color: #e8f4ff !important;
}

html.theme-night select option:checked,
html.theme-night select option:hover {
  background: #1f9bd7 !important;
  background-color: #1f9bd7 !important;
  color: #fff !important;
}

html.theme-night select optgroup {
  color: #9fc3df !important;
  font-weight: 900 !important;
}

html.theme-night .log-detail-grid pre,
html.theme-night .log-detail-grid textarea,
html.theme-night .log-detail-grid input,
html.theme-night .log-details pre,
html.theme-night .log-details textarea,
html.theme-night .log-details input {
  background: #071524 !important;
  color: #dceafe !important;
  border-color: #31506c !important;
}

html.theme-night .log-detail-grid span,
html.theme-night .log-details span {
  color: #9fb8d4 !important;
}

.mail-test-form,
.employee-modal-card .document-upload,
.employee-modal-card .document-bulk-actions,
.employee-modal-card .document-empty,
.employee-modal-card .document-card {
  border-radius: 8px !important;
}

.mail-test-form,
.employee-modal-card .document-upload {
  overflow: hidden !important;
}

@media (min-width: 861px) {
  .sidebar {
    overflow: hidden !important;
  }

  .sidebar nav {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    padding-right: 2px !important;
    scrollbar-width: thin;
  }

  .sidebar:hover,
  .sidebar:focus-within,
  .sidebar.is-expanded {
    gap: 8px !important;
    padding-top: 16px !important;
    padding-bottom: 10px !important;
  }

  .sidebar:hover .brand,
  .sidebar:focus-within .brand,
  .sidebar.is-expanded .brand {
    min-height: 44px !important;
    margin-bottom: 6px !important;
    padding-bottom: 10px !important;
  }

  .sidebar:hover nav,
  .sidebar:focus-within nav,
  .sidebar.is-expanded nav {
    gap: 4px !important;
  }

  .sidebar:hover a,
  .sidebar:focus-within a,
  .sidebar.is-expanded a {
    min-height: 36px !important;
    padding-top: 6px !important;
    padding-bottom: 6px !important;
  }

  .sidebar .sidebar-preferences {
    flex: 0 0 auto !important;
    margin-top: 6px !important;
  }
}

@media (max-width: 860px) {
  .log-maintenance,
  .log-purge-form,
  .log-purge-form > *,
  .log-purge-form label {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .log-purge-form input,
  .log-purge-form select,
  .log-purge-form .button {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    inline-size: 100% !important;
    box-sizing: border-box !important;
  }

  .log-purge-form input[type="month"],
  .log-purge-form input[type="date"],
  .log-purge-form input[type="number"] {
    display: block !important;
    -webkit-appearance: none;
    appearance: none;
  }

  .log-purge-form .check-line {
    display: grid !important;
    grid-template-columns: 28px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 10px !important;
  }

  .log-purge-form .check-line input[type="checkbox"] {
    width: 22px !important;
    max-width: 22px !important;
    min-width: 22px !important;
    inline-size: 22px !important;
    height: 22px !important;
    flex: 0 0 22px !important;
  }

  .log-purge-form .check-line span {
    min-width: 0 !important;
    overflow-wrap: anywhere !important;
  }
}

@media (max-width: 560px) {
  .logs-table tr,
  .logs-table td,
  .logs-table td[data-label],
  .logs-table td[data-label] .log-details {
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  td[data-label] .log-details,
  .logs-table td[data-label] .log-details {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }

  .log-detail-grid,
  .logs-table .log-detail-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }

  .log-detail-grid > div,
  .logs-table .log-detail-grid > div {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }

  .log-detail-grid pre,
  .logs-table .log-detail-grid pre {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 96px !important;
    max-height: 230px !important;
    overflow: auto !important;
    white-space: pre !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    font-size: 9.5px !important;
    line-height: 1.32 !important;
    padding: 8px !important;
    box-sizing: border-box !important;
  }

  .timesheet-status-badge.incomplete {
    display: inline-flex !important;
    width: auto !important;
    max-width: 100% !important;
    min-width: min(100%, 270px) !important;
    min-height: 58px !important;
    padding: 12px 18px !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    line-height: 1.25 !important;
    text-align: center !important;
    justify-content: center !important;
    align-items: center !important;
    font-size: clamp(12px, 3.05vw, 15px) !important;
  }
}

@media (max-width: 380px) {
  .log-detail-grid,
  .logs-table .log-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* v150 preferences repair: final override for the compact sidebar popover. */
.sidebar .sidebar-preferences {
  position: relative !important;
  align-self: center !important;
  width: 100% !important;
  margin-top: auto !important;
  padding-top: 8px !important;
  flex-shrink: 0 !important;
  z-index: 80 !important;
}

.sidebar .preferences-toggle {
  appearance: none !important;
  -webkit-appearance: none !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  width: 100% !important;
  min-height: 46px !important;
  border: 1px solid rgba(125, 211, 252, .34) !important;
  border-radius: 10px !important;
  padding: 7px 8px !important;
  background: linear-gradient(135deg, rgba(56, 189, 248, .22), rgba(20, 184, 166, .16)) !important;
  color: #eaf6ff !important;
  box-shadow: 0 14px 30px rgba(0,0,0,.20) !important;
  cursor: pointer !important;
  text-align: left !important;
  list-style: none !important;
}

.sidebar .preferences-toggle::-webkit-details-marker {
  display: none !important;
}

.sidebar .preferences-avatar {
  display: inline-grid !important;
  place-items: center !important;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  border-radius: 9px !important;
  background: rgba(255,255,255,.10) !important;
}

.sidebar .preferences-avatar img {
  width: 23px !important;
  height: 16px !important;
  border-radius: 3px !important;
}

.sidebar .preferences-summary {
  display: grid !important;
  gap: 2px !important;
  min-width: 0 !important;
}

.sidebar .preferences-summary strong {
  color: #f8fbff !important;
  font-size: 12px !important;
  font-weight: 900 !important;
}

.sidebar .preferences-summary small {
  color: #a8c7dd !important;
  font-size: 11px !important;
  font-weight: 800 !important;
}

.sidebar .preferences-chevron {
  display: inline-block !important;
  margin-left: auto !important;
  color: #92f5df !important;
  font-weight: 900 !important;
}

.sidebar .preferences-popover {
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  bottom: calc(100% + 10px) !important;
  width: auto !important;
  display: none !important;
  gap: 12px !important;
  padding: 12px !important;
  border: 1px solid rgba(125, 211, 252, .34) !important;
  border-radius: 12px !important;
  background: #071426 !important;
  box-shadow: 0 24px 52px rgba(0,0,0,.45) !important;
  z-index: 100 !important;
}

.sidebar .sidebar-preferences[open] .preferences-popover {
  display: grid !important;
}

.sidebar .preferences-language,
.sidebar .preferences-theme {
  display: grid !important;
  gap: 6px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.sidebar .preferences-language {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.sidebar .preferences-theme {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.sidebar .language-option,
.sidebar .theme-option {
  width: auto !important;
  min-height: 32px !important;
  justify-content: center !important;
  border-radius: 999px !important;
  padding: 5px 7px !important;
  background: rgba(255,255,255,.08) !important;
  color: #dbeafe !important;
}

.sidebar .language-option.active,
.sidebar .theme-option.active {
  color: #0f172a !important;
  background: linear-gradient(135deg, #ffffff, #dff7ff) !important;
}

.sidebar:not(:hover):not(:focus-within):not(.is-expanded) .sidebar-preferences {
  width: 40px !important;
}

.sidebar:not(:hover):not(:focus-within):not(.is-expanded) .preferences-toggle {
  justify-content: center !important;
  min-height: 40px !important;
  padding: 3px !important;
}

.sidebar:not(:hover):not(:focus-within):not(.is-expanded) .preferences-summary,
.sidebar:not(:hover):not(:focus-within):not(.is-expanded) .preferences-chevron {
  display: none !important;
}

  .sidebar:not(:hover):not(:focus-within):not(.is-expanded) .preferences-popover {
    left: 48px !important;
    right: auto !important;
    bottom: 0 !important;
    width: 220px !important;
  }

@media (max-width: 860px) {
  .sidebar .nav-group,
  .sidebar:not(:hover):not(:focus-within):not(.is-expanded) .nav-group {
    width: 100% !important;
    grid-column: 1 / -1 !important;
  }

  .sidebar .nav-group-toggle,
  .sidebar:not(:hover):not(:focus-within):not(.is-expanded) .nav-group-toggle {
    width: 100% !important;
    min-height: 46px !important;
    padding: 11px 12px !important;
    color: #dbeafe !important;
  }

  .sidebar .nav-group-toggle::before,
  .sidebar:not(:hover):not(:focus-within):not(.is-expanded) .nav-group-toggle::before {
    margin-right: 10px !important;
  }

  .sidebar .nav-group-toggle span,
  .sidebar .nav-group-chevron,
  .sidebar:not(:hover):not(:focus-within):not(.is-expanded) .nav-group-toggle span,
  .sidebar:not(:hover):not(:focus-within):not(.is-expanded) .nav-group-chevron {
    display: inline-flex !important;
  }

  .sidebar .nav-submenu,
  .sidebar:not(:hover):not(:focus-within):not(.is-expanded) .nav-submenu {
    position: static !important;
    min-width: 0 !important;
    width: 100% !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
    padding: 8px !important;
    margin: 6px 0 0 !important;
    border: 1px solid rgba(125, 211, 252, .22) !important;
    border-radius: 12px !important;
    background: rgba(5, 13, 27, .34) !important;
    box-shadow: none !important;
  }

  .sidebar .nav-submenu a,
  .sidebar:not(:hover):not(:focus-within):not(.is-expanded) .nav-submenu a {
    width: 100% !important;
    min-height: 40px !important;
    justify-content: center !important;
    padding: 8px 7px !important;
    color: #dbeafe !important;
    text-align: center !important;
  }

  .sidebar .sidebar-preferences,
  .sidebar:not(:hover):not(:focus-within):not(.is-expanded) .sidebar-preferences {
    width: min(320px, 100%) !important;
  }

  .sidebar.mobile-open .sidebar-preferences {
    display: block !important;
  }

  .sidebar:not(.mobile-open) .sidebar-preferences {
    display: none !important;
  }

  .sidebar .preferences-toggle,
  .sidebar:not(:hover):not(:focus-within):not(.is-expanded) .preferences-toggle {
    justify-content: flex-start !important;
    min-height: 46px !important;
    padding: 7px 8px !important;
  }

  .sidebar .preferences-summary,
  .sidebar .preferences-chevron,
  .sidebar:not(:hover):not(:focus-within):not(.is-expanded) .preferences-summary,
  .sidebar:not(:hover):not(:focus-within):not(.is-expanded) .preferences-chevron {
    display: grid !important;
  }

  .sidebar .preferences-chevron,
  .sidebar:not(:hover):not(:focus-within):not(.is-expanded) .preferences-chevron {
    display: inline-block !important;
  }

  .sidebar .preferences-popover,
  .sidebar:not(:hover):not(:focus-within):not(.is-expanded) .preferences-popover {
    left: 0 !important;
    right: 0 !important;
    bottom: calc(100% + 10px) !important;
    width: auto !important;
  }
}

/* v162 final grouped navigation layout. Keep this at the very end. */
.sidebar .nav-group,
.sidebar:not(:hover):not(:focus-within):not(.is-expanded) .nav-group {
  position: relative !important;
  display: block !important;
  min-height: 0 !important;
  min-width: 0 !important;
}

.sidebar .nav-submenu,
.sidebar:not(:hover):not(:focus-within):not(.is-expanded) .nav-submenu {
  display: none !important;
}

.sidebar .nav-group[open] .nav-submenu,
.sidebar:not(:hover):not(:focus-within):not(.is-expanded) .nav-group[open] .nav-submenu {
  position: static !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 5px !important;
  width: 100% !important;
  min-width: 0 !important;
  padding: 8px !important;
  margin: 7px 0 0 !important;
  border: 1px solid rgba(125, 211, 252, .24) !important;
  border-radius: 10px !important;
  background: rgba(3, 10, 24, .38) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04) !important;
}

.sidebar:not(:hover):not(:focus-within):not(.is-expanded) .nav-group[open] .nav-submenu {
  display: none !important;
}

.sidebar .nav-submenu a,
.sidebar:not(:hover):not(:focus-within):not(.is-expanded) .nav-submenu a {
  width: 100% !important;
  min-height: 34px !important;
  justify-content: flex-start !important;
  padding: 6px 8px !important;
  text-align: left !important;
  font-size: 13px !important;
}

.sidebar .sidebar-preferences:not([open]) .preferences-popover,
.sidebar:not(:hover):not(:focus-within):not(.is-expanded) .sidebar-preferences:not([open]) .preferences-popover {
  display: none !important;
}

@media (max-width: 860px) {
  .sidebar.mobile-open nav {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    align-items: start !important;
    gap: 10px !important;
    overflow: visible !important;
  }

  .sidebar .nav-group,
  .sidebar:not(:hover):not(:focus-within):not(.is-expanded) .nav-group {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    min-height: 0 !important;
  }

  .sidebar .nav-group-toggle,
  .sidebar:not(:hover):not(:focus-within):not(.is-expanded) .nav-group-toggle {
    width: 100% !important;
    min-height: 48px !important;
    padding: 10px 12px !important;
    color: #dbeafe !important;
  }

  .sidebar .nav-group-toggle::before,
  .sidebar:not(:hover):not(:focus-within):not(.is-expanded) .nav-group-toggle::before {
    display: grid !important;
    margin-right: 10px !important;
  }

  .sidebar .nav-group-toggle span,
  .sidebar .nav-group-chevron,
  .sidebar:not(:hover):not(:focus-within):not(.is-expanded) .nav-group-toggle span,
  .sidebar:not(:hover):not(:focus-within):not(.is-expanded) .nav-group-chevron {
    display: inline-flex !important;
  }

  .sidebar .nav-group[open] .nav-submenu,
  .sidebar:not(:hover):not(:focus-within):not(.is-expanded) .nav-group[open] .nav-submenu {
    position: static !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    width: 100% !important;
    margin: 8px 0 0 !important;
    padding: 8px !important;
    border: 1px solid rgba(125, 211, 252, .24) !important;
    border-radius: 12px !important;
    background: rgba(3, 10, 24, .34) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04) !important;
  }

  .sidebar .nav-submenu a,
  .sidebar:not(:hover):not(:focus-within):not(.is-expanded) .nav-submenu a {
    min-height: 40px !important;
    padding: 8px 9px !important;
    font-size: 14px !important;
  }

  .sidebar .nav-submenu a::before,
  .sidebar:not(:hover):not(:focus-within):not(.is-expanded) .nav-submenu a::before {
    display: grid !important;
    width: 26px !important;
    height: 26px !important;
    flex-basis: 26px !important;
    margin-right: 8px !important;
  }

  .sidebar .sidebar-preferences:not([open]) .preferences-popover,
  .sidebar:not(:hover):not(:focus-within):not(.is-expanded) .sidebar-preferences:not([open]) .preferences-popover {
    display: none !important;
  }
}

/* v165 cleaned sidebar final rules: keep logout anchored and mobile icon visible. */
@media (min-width: 861px) {
  .sidebar nav,
  .sidebar:hover nav,
  .sidebar:focus-within nav,
  .sidebar.is-expanded nav {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
  }

  .sidebar nav > a[data-short="X"] {
    margin-top: auto !important;
  }
}

@media (max-width: 860px) {
  .sidebar.mobile-open nav {
    display: grid !important;
  }

  .sidebar.mobile-open nav > a[data-short="X"] {
    grid-column: 1 / -1 !important;
    justify-self: stretch !important;
    margin-top: 14px !important;
  }

  .sidebar.mobile-open nav > a[data-short="X"]::before,
  .sidebar.mobile-open:not(:hover):not(:focus-within):not(.is-expanded) nav > a[data-short="X"]::before {
    display: grid !important;
    margin-right: 10px !important;
  }
}

@media (max-width: 860px) {
  .backup-schedule-card input[type="time"] {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    justify-self: stretch !important;
    box-sizing: border-box !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    text-align: left !important;
  }
}

.work-summary-grid {
    margin-bottom: 22px;
}

.work-archive-search {
    grid-template-columns: minmax(260px, 360px) auto;
    width: min(560px, 100%);
    justify-self: end;
}

.profile-grid .work-summary-action {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    grid-column: 4;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
}

.work-summary-action .button {
    min-width: 190px;
}

.work-project-list {
    display: grid;
    gap: 16px;
}

.work-project-card {
    border: 1px solid rgba(14, 165, 198, .28);
    border-radius: 8px;
    background: rgba(255, 255, 255, .78);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.work-project-main {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(520px, 1.8fr);
    gap: 18px;
    align-items: center;
    padding: 18px;
}

.work-project-main h3 {
    margin: 4px 0 6px;
    font-size: 22px;
}

.work-project-main p {
    margin: 0;
    color: var(--muted);
}

.work-card-metrics,
.work-detail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.work-card-metrics span,
.work-detail-grid div {
    min-width: 0;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 12px;
    background: rgba(255, 255, 255, .72);
}

.work-card-metrics small,
.work-detail-grid span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-weight: 800;
    font-size: 11px;
    text-transform: uppercase;
}

.work-card-metrics strong,
.work-detail-grid strong {
    display: block;
    font-size: 16px;
}

.work-project-details {
    border-top: 1px solid rgba(14, 165, 198, .22);
}

.work-project-details > summary,
.work-subpanel > summary {
    cursor: pointer;
    padding: 13px 18px;
    font-weight: 900;
    color: var(--blue);
}

.work-project-details[open] > summary,
.work-subpanel[open] > summary {
    border-bottom: 1px solid rgba(14, 165, 198, .22);
}

.work-project-details > *:not(summary) {
    margin: 16px 18px;
}

.work-note {
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 12px;
    background: rgba(14, 165, 198, .06);
    color: var(--muted);
}

.work-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.work-actions form {
    margin: 0;
}

.work-subpanel {
    border: 1px solid rgba(14, 165, 198, .28);
    border-radius: 8px;
    background: rgba(14, 165, 198, .05);
}

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

.work-ledger h4 {
    margin: 0 0 12px;
    font-size: 18px;
}

.work-transaction-form {
    margin-bottom: 14px;
    padding: 14px;
    border: 1px solid rgba(14, 165, 198, .24);
    border-radius: 8px;
    background: rgba(14, 165, 198, .05);
}

.inline-edit-details {
    width: 100%;
}

.inline-edit-details summary {
    cursor: pointer;
    color: var(--blue);
    font-weight: 900;
}

.inline-edit-details .grid-form {
    margin-top: 10px;
    padding: 12px;
    border: 1px solid rgba(14, 165, 198, .24);
    border-radius: 8px;
}

.is-muted-row {
    opacity: .62;
}

html.theme-night .work-project-card,
html.theme-night .work-card-metrics span,
html.theme-night .work-detail-grid div,
html.theme-night .work-transaction-form,
html.theme-night .work-subpanel,
html.theme-night .inline-edit-details .grid-form {
    background: rgba(9, 25, 42, .78);
    border-color: rgba(86, 158, 204, .45);
}

html.theme-night .work-project-main p,
html.theme-night .work-card-metrics small,
html.theme-night .work-detail-grid span,
html.theme-night .work-note {
    color: #b8cce0;
}

@media (max-width: 1180px) {
    .profile-grid .work-summary-action {
        grid-column: auto;
    }

    .work-project-main,
    .work-ledger {
        grid-template-columns: 1fr;
    }

    .work-card-metrics,
    .work-detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .work-archive-search {
        width: 100%;
        justify-self: stretch;
    }

    .work-search.is-filter-open .actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }
}

@media (max-width: 560px) {
    .profile-grid .work-summary-action,
    .work-summary-action .button {
        width: 100%;
    }

    .work-project-main {
        padding: 14px;
    }

    .work-card-metrics,
    .work-detail-grid {
        grid-template-columns: 1fr;
    }

    .work-project-details > *:not(summary) {
        margin: 12px;
    }

    .work-actions,
    .work-actions .button,
    .work-actions form {
        width: 100%;
    }
}

@media (max-width: 860px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    .content,
    .panel,
    .page-head,
    .page-head-actions,
    .profile-grid,
    .payroll-cycle-card,
    .backup-config-form,
    .backup-schedule-card {
        min-width: 0;
        max-width: 100%;
    }

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

    .profile-grid > div {
        min-width: 0;
    }

    .profile-grid strong {
        overflow-wrap: anywhere;
    }

    .payroll-kpi-grid,
    .payroll-cycle-top,
    .payroll-cycle-progress,
    .payroll-cycle-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .payroll-cycle-card {
        overflow: hidden;
    }

    .payroll-cycle-badges,
    .payroll-cycle-actions {
        justify-content: stretch;
    }

    .payroll-cycle-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .payroll-cycle-actions form,
    .payroll-cycle-actions .button {
        width: 100%;
    }

    .timesheet-status-badge,
    .payroll-due-badge {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        white-space: normal;
        text-align: center;
    }
}

@media (max-width: 560px) {
    input[type="date"],
    input[type="time"] {
        min-height: 48px;
        line-height: 48px;
        padding-top: 0;
        padding-bottom: 0;
        box-sizing: border-box;
        text-align: left;
    }

    input[type="date"]::-webkit-date-and-time-value,
    input[type="time"]::-webkit-date-and-time-value {
        min-height: 48px;
        text-align: left;
    }

    input[type="date"]::-webkit-calendar-picker-indicator,
    input[type="time"]::-webkit-calendar-picker-indicator {
        margin-left: 6px;
    }

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

    .profile-grid div {
        padding: 12px;
    }

    .profile-grid span {
        font-size: 10px;
        line-height: 1.25;
    }

    .profile-grid strong {
        font-size: clamp(15px, 4.2vw, 18px);
        line-height: 1.2;
    }

    .payroll-kpi-grid,
    .payroll-cycle-top,
    .payroll-cycle-progress,
    .payroll-cycle-metrics {
        grid-template-columns: 1fr;
    }

    .payroll-cycle-card {
        padding: 12px;
    }

    .payroll-cycle-rest strong,
    .payroll-cycle-metrics strong {
        font-size: clamp(18px, 5.2vw, 23px);
        overflow-wrap: anywhere;
    }

    .backup-config-form,
    .backup-schedule-card,
    .backup-retention-card,
    .backup-actions-grid {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .backup-schedule-card {
        padding: 16px 12px;
        overflow: hidden;
    }

    .backup-schedule-card label,
    .backup-retention-group label {
        min-width: 0;
        width: 100%;
    }

    .backup-schedule-card input,
    .backup-schedule-card select,
    .backup-summary-schedule input[type="time"],
    .copy-snippet {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .backup-schedule-card input[type="time"],
    .backup-summary-schedule input[type="time"] {
        padding-right: 38px;
    }

    .modal-card,
    .panel,
    .grid-form,
    .grid-form > *,
    .settings-grid,
    .settings-grid > *,
    .profile-grid,
    .profile-grid > *,
    .document-panel,
    .document-upload,
    .document-upload > *,
    .document-list,
    .document-card,
    .employee-modal-card,
    .employee-profile-card,
    .backup-config-form,
    .backup-schedule-card,
    .backup-retention-card,
    .archive-card,
    .archive-detail-grid,
    .archive-metrics,
    .work-card,
    .work-metrics,
    .work-detail-grid {
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }

    .grid-form input,
    .grid-form select,
    .grid-form textarea,
    .settings-grid input,
    .settings-grid select,
    .settings-grid textarea,
    .document-upload input,
    .document-upload select,
    .employee-modal-card input,
    .employee-modal-card select,
    .employee-modal-card textarea,
    .employee-profile-card input,
    .employee-profile-card select,
    .employee-profile-card textarea,
    .archive-card input,
    .archive-card select,
    .archive-card textarea,
    .work-card input,
    .work-card select,
    .work-card textarea {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }

    .grid-form input[type="date"],
    .grid-form input[type="time"],
    .settings-grid input[type="date"],
    .settings-grid input[type="time"],
    .employee-modal-card input[type="date"],
    .employee-modal-card input[type="time"],
    .employee-profile-card input[type="date"],
    .employee-profile-card input[type="time"],
    .work-card input[type="date"],
    .work-card input[type="time"] {
        inline-size: 100%;
        min-inline-size: 0;
        max-inline-size: 100%;
    }
}

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

@media (max-width: 860px) {
    label,
    .grid-form label,
    .settings-grid label,
    .modal-card label,
    .panel label {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }

    input:not([type="checkbox"]):not([type="radio"]),
    select,
    textarea {
        display: block;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }

    input[type="date"],
    input[type="time"],
    input[type="month"],
    select {
        inline-size: 100%;
        min-inline-size: 0;
        max-inline-size: 100%;
    }
}

@media (max-width: 860px) and (-webkit-touch-callout: none) {
    .grid-form input:not([type="checkbox"]):not([type="radio"]),
    .grid-form select,
    .grid-form textarea,
    .settings-grid input:not([type="checkbox"]):not([type="radio"]),
    .settings-grid select,
    .settings-grid textarea,
    .modal-card input:not([type="checkbox"]):not([type="radio"]),
    .modal-card select,
    .modal-card textarea,
    .panel input:not([type="checkbox"]):not([type="radio"]),
    .panel select,
    .panel textarea {
        width: -webkit-fill-available !important;
        min-width: 0 !important;
        max-width: -webkit-fill-available !important;
    }

    input[type="date"],
    input[type="time"],
    input[type="month"] {
        min-inline-size: 0 !important;
        max-inline-size: -webkit-fill-available !important;
    }
}

@media (max-width: 860px) {
    .modal-shell {
        padding-left: 12px;
        padding-right: 12px;
    }

    .employee-modal-card,
    .employee-profile-card {
        width: calc(100vw - 24px) !important;
        max-width: calc(100vw - 24px) !important;
        overflow-x: hidden !important;
    }

    .employee-modal-card .grid-form {
        grid-template-columns: minmax(0, 1fr) !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
    }

    .employee-modal-card .grid-form label,
    .employee-modal-card .grid-form .span-2,
    .employee-modal-card .grid-form .form-actions {
        grid-column: 1 / -1 !important;
        display: grid !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }

    .employee-modal-card .grid-form input:not([type="checkbox"]):not([type="radio"]),
    .employee-modal-card .grid-form select,
    .employee-modal-card .grid-form textarea {
        display: block !important;
        width: 100% !important;
        inline-size: 100% !important;
        min-width: 0 !important;
        min-inline-size: 0 !important;
        max-width: 100% !important;
        max-inline-size: 100% !important;
        box-sizing: border-box !important;
    }

    .employee-modal-card .grid-form input[type="date"],
    .employee-modal-card .grid-form input[type="time"],
    .employee-modal-card .grid-form input[type="month"] {
        -webkit-appearance: none !important;
        appearance: none !important;
        padding-right: 14px !important;
    }

    .employee-modal-card .grid-form input[type="date"]::-webkit-date-and-time-value,
    .employee-modal-card .grid-form input[type="time"]::-webkit-date-and-time-value,
    .employee-modal-card .grid-form input[type="month"]::-webkit-date-and-time-value {
        width: 100% !important;
        max-width: 100% !important;
        text-align: left !important;
    }

    .modal-card .grid-form,
    .panel .grid-form,
    .settings-grid,
    .backup-schedule-card,
    .backup-retention-card,
    .work-card,
    .archive-card {
        min-width: 0 !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }

    .modal-card .grid-form input:not([type="checkbox"]):not([type="radio"]),
    .modal-card .grid-form select,
    .modal-card .grid-form textarea,
    .panel .grid-form input:not([type="checkbox"]):not([type="radio"]),
    .panel .grid-form select,
    .panel .grid-form textarea,
    .settings-grid input:not([type="checkbox"]):not([type="radio"]),
    .settings-grid select,
    .settings-grid textarea,
    .backup-schedule-card input:not([type="checkbox"]):not([type="radio"]),
    .backup-schedule-card select,
    .backup-schedule-card textarea,
    .backup-retention-card input:not([type="checkbox"]):not([type="radio"]),
    .backup-retention-card select,
    .backup-retention-card textarea,
    .work-card input:not([type="checkbox"]):not([type="radio"]),
    .work-card select,
    .work-card textarea,
    .archive-card input:not([type="checkbox"]):not([type="radio"]),
    .archive-card select,
    .archive-card textarea {
        width: 100% !important;
        inline-size: 100% !important;
        min-width: 0 !important;
        min-inline-size: 0 !important;
        max-width: 100% !important;
        max-inline-size: 100% !important;
        box-sizing: border-box !important;
    }

    .modal-card input[type="date"],
    .modal-card input[type="time"],
    .modal-card input[type="month"],
    .panel input[type="date"],
    .panel input[type="time"],
    .panel input[type="month"],
    .work-card input[type="date"],
    .work-card input[type="time"],
    .work-card input[type="month"],
    .archive-card input[type="date"],
    .archive-card input[type="time"],
    .archive-card input[type="month"] {
        -webkit-appearance: none !important;
        appearance: none !important;
        padding-right: 14px !important;
    }
}

@media (max-width: 860px) {
    input[type="date"],
    input[type="time"],
    input[type="month"],
    .grid-form input[type="date"],
    .grid-form input[type="time"],
    .grid-form input[type="month"],
    .settings-grid input[type="date"],
    .settings-grid input[type="time"],
    .settings-grid input[type="month"],
    .modal-card input[type="date"],
    .modal-card input[type="time"],
    .modal-card input[type="month"],
    .panel input[type="date"],
    .panel input[type="time"],
    .panel input[type="month"],
    .employee-modal-card input[type="date"],
    .employee-modal-card input[type="time"],
    .employee-modal-card input[type="month"],
    .employee-profile-card input[type="date"],
    .employee-profile-card input[type="time"],
    .employee-profile-card input[type="month"],
    .backup-schedule-card input[type="time"],
    .backup-summary-schedule input[type="time"],
    .work-card input[type="date"],
    .work-card input[type="time"],
    .work-card input[type="month"],
    .archive-card input[type="date"],
    .archive-card input[type="time"],
    .archive-card input[type="month"] {
        display: block !important;
        width: 100% !important;
        inline-size: 100% !important;
        max-width: 100% !important;
        max-inline-size: 100% !important;
        min-width: 0 !important;
        min-inline-size: 0 !important;
        box-sizing: border-box !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        transform: none !important;
        -webkit-appearance: none !important;
        appearance: none !important;
    }

    input[type="date"]::-webkit-date-and-time-value,
    input[type="time"]::-webkit-date-and-time-value,
    input[type="month"]::-webkit-date-and-time-value {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        text-align: left !important;
    }
}

@media (max-width: 860px) {
    label:has(> input[type="date"]),
    label:has(> input[type="time"]),
    label:has(> input[type="month"]),
    .grid-form label:has(> input[type="date"]),
    .grid-form label:has(> input[type="time"]),
    .grid-form label:has(> input[type="month"]),
    .settings-grid label:has(> input[type="date"]),
    .settings-grid label:has(> input[type="time"]),
    .settings-grid label:has(> input[type="month"]),
    .modal-card label:has(> input[type="date"]),
    .modal-card label:has(> input[type="time"]),
    .modal-card label:has(> input[type="month"]),
    .panel label:has(> input[type="date"]),
    .panel label:has(> input[type="time"]),
    .panel label:has(> input[type="month"]),
    .employee-modal-card label:has(> input[type="date"]),
    .employee-modal-card label:has(> input[type="time"]),
    .employee-modal-card label:has(> input[type="month"]),
    .employee-profile-card label:has(> input[type="date"]),
    .employee-profile-card label:has(> input[type="time"]),
    .employee-profile-card label:has(> input[type="month"]),
    .backup-schedule-card label:has(> input[type="time"]),
    .backup-summary-schedule label:has(> input[type="time"]),
    .work-card label:has(> input[type="date"]),
    .work-card label:has(> input[type="time"]),
    .work-card label:has(> input[type="month"]),
    .archive-card label:has(> input[type="date"]),
    .archive-card label:has(> input[type="time"]),
    .archive-card label:has(> input[type="month"]) {
        padding-right: 52px !important;
        box-sizing: border-box !important;
    }

    label:has(> input[type="date"]) > input,
    label:has(> input[type="time"]) > input,
    label:has(> input[type="month"]) > input {
        width: 100% !important;
        inline-size: 100% !important;
        max-width: 100% !important;
        max-inline-size: 100% !important;
    }
}

@media (max-width: 860px) {
    label.mobile-date-field,
    .grid-form label.mobile-date-field,
    .settings-grid label.mobile-date-field,
    .modal-card label.mobile-date-field,
    .panel label.mobile-date-field,
    .employee-modal-card label.mobile-date-field,
    .employee-profile-card label.mobile-date-field,
    .backup-schedule-card label.mobile-date-field,
    .backup-summary-schedule label.mobile-date-field,
    .work-card label.mobile-date-field,
    .archive-card label.mobile-date-field {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        padding-right: 0 !important;
        box-sizing: border-box !important;
        overflow: visible !important;
    }

    label.mobile-date-field > input[type="date"],
    label.mobile-date-field > input[type="time"],
    label.mobile-date-field > input[type="month"] {
        display: block !important;
        width: calc(100% - 52px) !important;
        inline-size: calc(100% - 52px) !important;
        max-width: calc(100% - 52px) !important;
        max-inline-size: calc(100% - 52px) !important;
        min-width: 0 !important;
        min-inline-size: 0 !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        justify-self: stretch !important;
        transform: none !important;
        -webkit-appearance: none !important;
        appearance: none !important;
    }
}

@media (max-width: 860px) {
  .employee-report-grid,
  .employee-report-field-grid {
    grid-template-columns: 1fr;
  }
  .employee-report-modal-card {
    overflow: auto;
  }
  .employee-report-grid {
    overflow: visible;
  }
  .employee-report-section {
    height: auto;
    max-height: none;
  }
  .employee-report-section-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .employee-report-list {
    max-height: 34vh;
  }
  .employee-report-field-grid {
    max-height: 34vh;
  }
}

@media (max-width: 640px) {
  .panel-head-actions {
    justify-content: stretch;
    width: 100%;
  }
  .panel-head-actions .button {
    width: 100%;
  }
}
