:root {
  --bg-color: #f3f4f6;
  --surface: #fff;
  --surface-muted: #f3f4f6;
  --text-main: #1f2937;
  --text-muted: #6b7280;
  --border: #d1d5db;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary: #6b7280;
  --secondary-hover: #4b5563;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --danger-text: #991b1b;
  --success-bg: #f0fdf4;
  --success-border: #bbf7d0;
  --success-text: #166534;
  --code-bg: #1f2937;
  --code-text: #4ade80;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --font-family: system-ui, -apple-system, sans-serif;
  --radius-sm: 4px;
  --radius-md: 8px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #121212;
    --surface: #1e1e1e;
    --surface-muted: #2d2d2d;
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --border: #444;
    --success-bg: #16231b;
    --success-border: #244234;
    --success-text: #b7dcc2;
    --shadow: none;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-family);
}

body.audit-page {
  align-items: flex-start;
}
body.error-page {
  padding-top: 100px;
  text-align: center;
}

.page-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0 0 1.5rem 0;
}

h1 {
  margin: 0;
  color: var(--text-main);
  font-size: 1.5rem;
}

.page-title-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.page-title-icon {
  flex: 0 0 auto;
  width: 2.75rem;
  height: 2.75rem;
  vertical-align: middle;
}

label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
}

.container {
  width: 100%;
  max-width: 560px;
  padding: 2rem;
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.container-large {
  max-width: 1000px;
  margin: 0 auto;
}
body.audit-page .container-large {
  max-width: none;
  margin: 0;
}
.login-container {
  display: flex;
  min-height: 380px;
  flex-direction: column;
}
.login-container > h1,
.login-container > p {
  min-height: 3rem;
}

.login-container > p {
  margin: 0 0 1rem;
}

.login-form {
  margin-top: auto;
}

.form-group {
  margin-bottom: 1rem;
}
.form-row {
  display: flex;
  gap: 1rem;
}
.form-row .form-group {
  flex: 1;
}
.required-indicator {
  color: #dc2626;
  font-weight: 700;
}

:is(
  input[type="text"],
  input[type="number"],
  input[type="email"],
  input[type="password"]
) {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-main);
  font-family: var(--font-family);
}

input[disabled] {
  cursor: not-allowed;
  opacity: 0.7;
}

.hidden-file-input {
  display: none;
}

.dropzone {
  display: flex;
  height: 140px;
  margin-bottom: 1.5rem;
  padding: 2rem 1rem;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--primary);
  background: #eff6ff;
}

@media (prefers-color-scheme: dark) {
  .dropzone:hover,
  .dropzone.dragover {
    background: rgba(37, 99, 235, 0.12);
  }
}

.dropzone.invalid {
  border-color: var(--danger-text);
  background: var(--danger-bg);
}

.dropzone p {
  margin: 0;
  color: var(--text-muted);
}
.file-name {
  display: none;
  margin-top: 0.5rem;
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 700;
}
.file-name.visible {
  display: block;
}
.file-error {
  display: none;
  margin-top: 0.5rem;
  color: var(--danger-text);
  font-size: 0.875rem;
  font-weight: 700;
}
.file-error.visible {
  display: block;
}
.field-error {
  display: none;
  margin-top: 0.5rem;
  color: var(--danger-text);
  font-size: 0.875rem;
  font-weight: 700;
}
.field-error.visible {
  display: block;
}

.btn {
  width: 100%;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.2s;
}

.btn:hover {
  background: var(--primary-hover);
}
.btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  background: var(--secondary);
}
.btn-secondary {
  display: inline-block;
  width: auto;
  background: var(--secondary);
}
.btn-secondary:hover {
  background: var(--secondary-hover);
}

.upload-progress {
  margin-top: 1rem;
}

.upload-progress-label,
.upload-progress-value {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.upload-progress-value {
  margin-top: 0.35rem;
  font-weight: 700;
}

.upload-progress-bar {
  margin-top: 0.5rem;
  height: 0.7rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-muted);
}

.upload-progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width 0.15s ease;
}

.upload-request-error {
  margin-top: 1rem;
}

.alert-success,
.alert-error {
  border: 1px solid;
  border-radius: var(--radius-sm);
}

.alert-success {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success-text);
}

.alert-error {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger-text);
}

.alert-success code {
  display: block;
  margin-top: 0.5rem;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--code-bg);
  color: var(--code-text);
  font-size: 0.85rem;
  word-break: break-all;
  user-select: all;
}

.alert-meta {
  margin-top: 0.5rem;
  font-size: 0.875rem;
}
.account-meta {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.875rem;
}
.account-meta strong {
  color: var(--secondary);
  font-weight: 600;
}
.alert-divider {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}
.link-expires-at {
  margin-top: 1rem;
}
.alert-success input[readonly],
.alert-divider code {
  margin-top: 0.5rem;
}
.home-cli-hint {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.home-help {
  margin-top: 1.5rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.home-help summary {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  list-style: none;
}

.home-help[open] summary {
  margin-bottom: 1rem;
}

.home-help summary::marker {
  content: "";
}

.home-help summary::-webkit-details-marker {
  display: none;
}

.home-help-summary-icon {
  display: inline-flex;
  width: 1.4rem;
  height: 1.4rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 0.85rem;
  line-height: 1;
}

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

.home-help-card {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.home-help-card h3 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}

.home-help-card ol {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text-muted);
}

.home-help-card li + li {
  margin-top: 0.45rem;
}

.home-cli-hint .alert-meta {
  margin: 0 0 0.5rem;
}

.home-cli-hint code {
  display: block;
  margin-top: 0.5rem;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  color: var(--text-main);
  font-size: 0.85rem;
  word-break: break-all;
  user-select: all;
}

.back-link,
.utility-link,
.nav-links a,
.lang-link {
  text-decoration: none;
}
.utility-link,
.nav-links a,
.lang-link {
  color: var(--text-muted);
}
.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--primary);
  font-weight: 500;
}
.back-link:hover {
  text-decoration: underline;
}
.utility-link:hover,
.nav-links a:hover,
.lang-link:hover {
  color: var(--primary);
}

.lang-switch {
  display: inline-block;
  font-size: 0.8rem;
  margin-left: auto;
}
.lang-link.active {
  color: var(--text-main);
  font-weight: 700;
}

.actions-centered {
  margin: 1rem 0 1.5rem;
  text-align: center;
}

.nav-links {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.nav-links a {
  margin: 0 0.75rem;
  font-size: 0.875rem;
}

.audit-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}

.audit-summary-link {
  color: inherit;
  text-decoration: none;
}

.audit-chart-panel {
  margin: 1.25rem 0 1.5rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: linear-gradient(
    180deg,
    var(--surface-muted) 0%,
    var(--surface) 100%
  );
}

.audit-chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.audit-chart-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.audit-chart-navigation {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.audit-chart-window {
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.audit-chart-nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--text-main);
  text-decoration: none;
  transition: all 0.15s ease;
  border: 1px solid var(--border);
}

.audit-chart-nav-button:hover {
  background: var(--border);
  transform: scale(1.05);
  border-color: var(--primary); /* Blue border on hover using primary color */
}

.audit-chart-nav-icon {
  fill: currentColor;
  width: 20px;
  height: 20px;
}

/* Dark theme adjustments */
@media (prefers-color-scheme: dark) {
  .audit-chart-nav-button {
    border-color: var(--border);
  }

  .audit-chart-nav-button:hover {
    background: var(--surface-muted);
    border-color: var(--primary); /* Blue border on hover using primary color */
  }
}

.audit-chart-card {
  position: relative;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.audit-chart-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.audit-chart-meta-combined {
  align-items: flex-start;
}

.audit-chart-legend {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.audit-chart-legend-right {
  text-align: right;
}

.audit-chart-label {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.audit-chart-label-files {
  color: #007f5f;
}
.audit-chart-label-links {
  color: #2563eb;
}
.audit-chart-label-size {
  color: #c97a00;
}

.audit-chart-meta strong {
  font-size: 1rem;
}

.audit-chart-svg {
  width: 100%;
  height: auto;
  aspect-ratio: 8 / 1;
  display: block;
  overflow: visible;
}

.audit-chart-svg-compact {
  height: auto;
}

.audit-chart-frame {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 80px;
  gap: 0.6rem;
  align-items: stretch;
}

.audit-chart-scale {
  position: relative;
  color: var(--text-muted);
  font-size: 0.72rem;
  overflow: visible;
  z-index: 2;
}

.audit-chart-scale span {
  position: absolute;
  transform: translateY(-50%);
  line-height: 1;
  white-space: nowrap;
  font-weight: 600;
}

.audit-chart-scale-left span {
  left: 0.2rem;
  color: var(--text-muted);
}

.audit-chart-scale-right span {
  right: 0.2rem;
  color: #c97a00;
}

.audit-chart-gridline {
  stroke: var(--border);
  stroke-width: 1;
}

.audit-chart-bar-files {
  fill: rgba(0, 127, 95, 0.32);
  stroke: rgba(0, 127, 95, 0.7);
  stroke-width: 1;
}

.audit-chart-bar-links {
  fill: rgba(37, 99, 235, 0.28);
  stroke: rgba(37, 99, 235, 0.72);
  stroke-width: 1;
}

.audit-chart-line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.audit-chart-line-files {
  stroke: #007f5f;
  stroke-dasharray: 5 8;
}
.audit-chart-line-size {
  stroke: #c97a00;
  filter: drop-shadow(0 1px 1px rgba(201, 122, 0, 0.18));
}

.audit-chart-point {
  stroke-width: 1.5;
}

.audit-chart-point-size {
  fill: #c97a00;
  stroke: var(--surface);
}

.audit-chart-hover-target {
  fill: transparent;
  cursor: crosshair;
}

.audit-chart-tooltip {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  min-width: 190px;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface) 94%, white 6%);
  box-shadow: var(--shadow);
  pointer-events: none;
  z-index: 3;
}

.audit-chart-tooltip-date {
  margin-bottom: 0.45rem;
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 700;
}

.audit-chart-tooltip-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
}

.audit-chart-tooltip-row + .audit-chart-tooltip-row {
  margin-top: 0.22rem;
}

.audit-chart-tooltip-swatch {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
  flex: 0 0 auto;
}

.audit-chart-tooltip-swatch-files {
  background: #007f5f;
}
.audit-chart-tooltip-swatch-links {
  background: #2563eb;
}
.audit-chart-tooltip-swatch-size {
  background: #c97a00;
}

.audit-chart-tooltip-label {
  color: var(--text-muted);
}

.audit-chart-tooltip-value {
  margin-left: auto;
  color: var(--text-main);
}

.audit-chart-axis {
  position: relative;
  height: 1rem;
  margin-top: 0.6rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.audit-chart-axis-frame {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 80px;
  gap: 0.6rem;
  align-items: start;
}

.audit-chart-axis span {
  position: absolute;
  transform: translateX(-50%);
  white-space: nowrap;
}

.audit-chart-axis span:first-child {
  left: 0 !important;
  transform: none;
}

.audit-chart-axis span:last-child {
  left: 100% !important;
  transform: translateX(-100%);
}

.audit-summary-item {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.audit-summary-item-interactive {
  transition:
    border-color 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.audit-summary-link:hover .audit-summary-item-interactive,
.audit-summary-link:focus-visible .audit-summary-item-interactive {
  border-color: var(--primary);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.audit-summary-link-disabled:hover .audit-summary-item-interactive,
.audit-summary-link-disabled:focus-visible .audit-summary-item-interactive,
.audit-summary-item-disabled {
  border-color: var(--border);
  box-shadow: none;
  transform: none;
}

.audit-summary-label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.audit-summary-value-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.audit-summary-subvalue {
  color: var(--text-muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.audit-summary-item-files .audit-summary-value-row strong,
.audit-summary-item-files .audit-summary-subvalue {
  color: #007f5f;
}

.audit-summary-item-links .audit-summary-value-row strong,
.audit-summary-item-links .audit-summary-subvalue {
  color: #2563eb;
}

.audit-summary-item-size .audit-summary-value-row strong,
.audit-summary-item-size .audit-summary-subvalue {
  color: #c97a00;
}

.audit-log-header {
  margin-top: 1.5rem;
}

.admin-filter-form {
  margin: 0;
  display: inline-block;
}

.admin-filter-form input.admin-filter-input {
  width: 11rem;
  max-width: 100%;
  display: inline-block;
}

.audit-log-header-with-filter {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.audit-log-header-with-filter .audit-header-content {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
}

.audit-log-header-with-filter .audit-header-content h1 {
  margin: 0;
}

.audit-log-header-with-filter .audit-filter-container {
  flex: 0 0 auto;
  margin-left: auto;
}

.audit-page-right {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.admin-files-header {
  margin-top: 0;
  margin-bottom: 1rem;
}

.storage-bars-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.storage-bars-summary {
  display: flex;
  align-items: baseline;
  gap: 2rem;
  flex-wrap: wrap;
  color: var(--text-muted);
}

.storage-bars-summary-total {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.storage-bars-summary strong {
  color: var(--text-main);
  font-size: 1.1rem;
}

.storage-bars-item {
  display: grid;
  grid-template-columns: 10rem 1fr 10rem;
  gap: 1rem;
  align-items: center;
  white-space: nowrap;
  padding-right: 1rem;
}
.storage-bars-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.storage-bars-legend {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.storage-bars-name {
  font-weight: 600;
}

.storage-bars-legend-item::before {
  content: "";
  width: 0.8rem;
  height: 0.8rem;
  display: inline-block;
  margin-right: 0.4rem;
  border-radius: 999px;
  vertical-align: -0.1rem;
}

.storage-bars-legend-item-employee::before {
  background: #c97a00;
}

.storage-bars-legend-item-client::before {
  background: #007f5f;
}

.storage-bars-meta {
  display: flex;
  gap: 0.9rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  white-space: nowrap;
}

.storage-bars-track {
  height: 0.9rem;
  border-radius: 999px;
  background: var(--surface-muted);
  overflow: hidden;
  display: flex;
}

.storage-bars-fill {
  height: 100%;
  flex: 0 0 auto;
}

.storage-bars-fill-employee {
  background: #c97a00;
}

.storage-bars-fill-client {
  background: #007f5f;
}

table {
  width: 100%;
  margin-top: 1rem;
  border-collapse: collapse;
}

th,
td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}

.admin-data-table {
  table-layout: auto;
}

.employee-files-table th:nth-child(3),
.employee-files-table td:nth-child(3),
.employee-files-table th:nth-child(4),
.employee-files-table td:nth-child(4),
.employee-files-table th:nth-child(5),
.employee-files-table td:nth-child(5) {
  white-space: nowrap;
  overflow-wrap: normal;
}

.employee-files-table th:nth-child(3),
.employee-files-table td:nth-child(3) {
  width: 12rem;
}

.employee-files-table th:nth-child(4),
.employee-files-table td:nth-child(4) {
  width: auto;
}

.employee-files-table th:nth-child(5),
.employee-files-table td:nth-child(5) {
  width: 7rem;
}

.audit-log-table th:nth-child(2),
.audit-log-table td:nth-child(2),
.audit-log-table th:nth-child(3),
.audit-log-table td:nth-child(3),
.audit-log-table th:nth-child(4),
.audit-log-table td:nth-child(4) {
  white-space: nowrap;
  overflow-wrap: normal;
}

.audit-log-table th:nth-child(2),
.audit-log-table td:nth-child(2) {
  width: 9rem;
}

.audit-log-table th:nth-child(3),
.audit-log-table td:nth-child(3) {
  width: 7rem;
}

.audit-log-table th:nth-child(4),
.audit-log-table td:nth-child(4) {
  width: 9rem;
}

.upload-links-table {
  table-layout: auto;
}

.upload-links-table th:nth-child(4),
.upload-links-table td:nth-child(4) {
  white-space: nowrap;
  overflow-wrap: normal;
}

.upload-links-table td:nth-child(4) .audit-file-link {
  white-space: nowrap;
  overflow-wrap: normal;
  font-size: 0.8rem;
}

th {
  background: var(--surface-muted);
  font-weight: 700;
}
.font-mono {
  font-family: monospace;
}

.audit-sort-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: inherit;
  text-decoration: none;
}

.audit-sort-link:hover {
  color: var(--primary);
}

.audit-sort-indicator {
  color: var(--primary);
  font-size: 0.75rem;
}

.audit-file-link {
  color: var(--primary);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.file-source-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  margin-right: 0.35rem;
  vertical-align: text-bottom;
}

.file-source-icon svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.file-source-icon-employee {
  color: var(--text-muted);
}

.file-source-icon-client {
  color: #2563eb;
}

.audit-file-link:hover {
  text-decoration: underline;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  font-size: 0.875rem;
}

.pagination-summary,
.error-message {
  color: var(--text-muted);
}
.pagination-links {
  display: flex;
  gap: 1rem;
}

.lazy-load-container {
  margin-top: 1rem;
}
.lazy-load-items {
  display: contents;
}
.lazy-load-more {
  text-align: center;
  margin-top: 1rem;
}
.lazy-load-btn {
  padding: 0.5rem 1rem;
}

.admin-status {
  margin: 1rem 0 1.25rem;
}

.audit-col-delete {
  width: 5.5rem;
  white-space: nowrap;
  overflow-wrap: normal;
}

.audit-delete-cell {
  width: 5.5rem;
  text-align: center;
}

.audit-delete-cell form {
  margin: 0;
}

.delete-icon-button {
  width: 1.5rem;
  height: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition:
    color 0.15s ease,
    transform 0.15s ease;
}

.delete-icon-button:hover {
  color: #f3f4f6;
  transform: translateY(-1px);
}

.delete-icon-button svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: currentColor;
}

.audit-delete-placeholder {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
}

.error-code {
  margin: 0;
  color: #dc3545;
  font-size: 80px;
  font-weight: 700;
}

.error-message {
  margin-bottom: 30px;
  font-size: 20px;
}

@media (max-width: 432px) {
  .audit-chart-panel {
    display: none;
  }
}

@media (max-width: 940px) {
  body {
    padding: 12px;
  }

  .container {
    padding: 1rem;
  }

  .audit-chart-header {
    flex-direction: column;
  }

  .audit-chart-navigation {
    width: 100%;
    justify-content: space-between;
  }

  .audit-chart-meta-combined {
    flex-direction: column;
  }

  .audit-chart-legend-right {
    text-align: left;
  }

  .audit-chart-frame {
    grid-template-columns: 52px minmax(0, 1fr) 66px;
    gap: 0.45rem;
  }

  .audit-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .audit-table,
  .audit-table tbody,
  .audit-table tr,
  .audit-table td {
    display: block;
  }

  .audit-table {
    margin-top: 1rem;
  }

  .audit-table tr {
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    overflow: hidden;
  }

  .audit-table td {
    display: grid;
    grid-template-columns: minmax(0, 8.5rem) minmax(0, 1fr);
    gap: 0.5rem;
    align-items: start;
    padding: 0.75rem 1rem;
    word-break: break-word;
    min-width: 100%;
  }

  .audit-table td::before {
    content: attr(data-label);
    color: var(--text-muted);
    font-weight: 700;
  }

  .audit-table td:last-child {
    border-bottom: none;
  }

  .audit-delete-cell {
    text-align: left;
  }

  .audit-table td.empty {
    display: block;
    text-align: left;
  }

  .audit-table td.empty::before {
    content: none;
  }

  .employee-files-table td {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .employee-files-table .file-link {
    white-space: nowrap;
  }

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

  .audit-log-header-with-filter {
    align-items: flex-start;
    flex-direction: column;
  }

  .storage-bars-item {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }

  .storage-bars-meta {
    flex-wrap: wrap;
    white-space: normal;
  }
}

.copy-button {
  position: relative;
  padding: 0.25rem 0.5rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s ease;
}
.copy-button:hover {
  color: var(--primary);
}
.copy-button.copied {
  color: var(--success-text);
}
.copy-button svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.copy-tooltip {
  position: fixed;
  z-index: 1000;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-main);
  font-size: 0.85rem;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  white-space: nowrap;
}
.copy-tooltip.visible {
  opacity: 1;
  pointer-events: none;
}
.copy-tooltip svg {
  fill: var(--success-text);
}
.copy-tooltip.top-center {
  top: 2rem;
  left: 50%;
  transform: translateX(-50%);
}

.field-copy-group {
  display: flex;
  align-items: flex-start;
  gap: 0.25rem;
  margin-top: 0.5rem;
}
.field-copy-group .copy-button {
  margin-top: 0.25rem;
}
.field-copy-group > *:first-child {
  flex: 1;
}
.field-copy-group .copy-button {
  flex-shrink: 0;
}

/* Visually hidden for screen readers */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  padding: 0.75rem 1.5rem;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 0;
  outline: 3px solid var(--primary-hover);
  outline-offset: 0;
}

.skip-link:focus:not(:focus-visible) {
  top: -100%;
}

.skip-link:focus-visible {
  top: 0;
  outline: 3px solid var(--primary-hover);
  outline-offset: 0;
}

/* Focus visible styles for interactive elements */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

.btn:focus-visible {
  outline: 3px solid var(--primary-hover);
  outline-offset: 2px;
}

.copy-button:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 2px;
}

.delete-icon-button:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 2px;
}

.admin-filter-input:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 0;
  border-color: var(--primary);
}

.lang-link:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 2px;
}

.back-link:focus-visible,
.nav-links a:focus-visible,
.utility-link:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 2px;
}

.audit-sort-link:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 2px;
}

.audit-file-link:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 2px;
}

.audit-chart-nav-button:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

.audit-chart-hover-target:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 0;
}

.lazy-load-btn:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
}

.modal-overlay[hidden] {
  display: none;
}

.modal-dialog {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  max-width: 28rem;
  width: 90%;
  box-shadow: var(--shadow);
}

.modal-message {
  margin: 0 0 1.25rem;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-main);
  word-break: break-word;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.modal-actions .btn {
  width: auto;
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
}

.btn-danger {
  background: var(--danger-text);
}

.btn-danger:hover {
  background: #7f1d1d;
}
