@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css");

:root {
  --bg: #f4f6f9;
  --surface: #fff;
  --border: #d8dee9;
  --text: #1a2332;
  --muted: #5c6b7a;
  --brand: #1e4d6b;
  --brand-light: #2a6f94;
  --accent: #0d9488;
  --err: #b91c1c;
  --ok: #047857;
  --radius: 10px;
  --font: "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

.hidden { display: none !important; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--brand);
  color: #e8f0f6;
  padding: 1.25rem 0;
}

.sidebar .logo {
  padding: 0 1.25rem 1rem;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  margin-bottom: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
}

.sidebar .logo .logo-img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  background: #fff;
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
  object-fit: contain;
}

.sidebar .logo .logo-icon {
  font-size: 1.35rem;
  opacity: 0.95;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.sidebar .logo small {
  display: block;
  font-weight: 400;
  font-size: 0.72rem;
  opacity: 0.85;
  margin-top: 0.25rem;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 1.25rem;
  color: #c5d9e8;
  text-decoration: none;
  font-size: 0.88rem;
}

.sidebar nav a .bi {
  font-size: 1.05rem;
  opacity: 0.9;
}

.sidebar-active-store {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0.5rem 0.85rem 0;
  padding: 0.6rem 0.7rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  font-size: 0.75rem;
  line-height: 1.35;
  color: #c5d9e8;
}

.sidebar-active-store.hidden {
  display: none;
}

.sidebar-active-store > .bi {
  font-size: 1.1rem;
  color: #6ee7b7;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.sidebar-active-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.sidebar-active-body strong {
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  word-break: break-word;
}

.sidebar-active-body span {
  font-size: 0.72rem;
  opacity: 0.92;
}

.sidebar nav a:hover,
.sidebar nav a.active {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.main { padding: 1.5rem 2rem; max-width: 960px; }

.page-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--brand);
  margin-bottom: 0.35rem;
}

.page-title-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.page-title-bar .page-title {
  margin-bottom: 0;
  flex: 1;
  min-width: 0;
}

.page-back-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  margin-top: 0.05rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 0.45rem;
  background: var(--surface);
  color: var(--brand);
  cursor: pointer;
  line-height: 1;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.page-back-btn:hover {
  background: #eef1f5;
  border-color: #cbd5e1;
  color: var(--brand);
}

.page-back-btn .bi {
  font-size: 1.1rem;
}

.page-title .bi {
  color: var(--brand-light);
  font-size: 1.15em;
}

.sync-meta-line {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: -0.35rem;
}

.sync-meta-line a {
  color: var(--brand-light);
}

.page-desc {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}

.steps {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.step {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: #e8eef3;
  color: var(--muted);
}

.step.active {
  background: var(--brand);
  color: #fff;
}

.step.done {
  background: #d1fae5;
  color: var(--ok);
}

label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

label .bi {
  font-size: 1rem;
  color: var(--brand-light);
}

input, select {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.work-card-form .form-row {
  grid-template-columns: 1fr;
  margin-bottom: 0.75rem;
}

.work-card-form label,
.work-card-form .label-like {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.work-card-form select,
.work-card-form input[type="text"] {
  width: 100%;
  max-width: 28rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.radio-row label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}

.work-card-terminal {
  text-align: center;
  margin-bottom: 1rem;
  background: linear-gradient(180deg, #f8fafc 0%, #edf2f7 100%);
  border-top: 3px solid var(--brand-light);
}

.terminal-clock {
  font-size: 2.2rem;
  font-weight: 700;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  color: #0f172a;
  letter-spacing: 0.05em;
  margin: 0.25rem 0 0.5rem;
}

.terminal-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.terminal-badge.online {
  background: #e6f4ea;
  color: #137333;
}

.terminal-badge-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.work-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.work-card-declare-card {
  margin-bottom: 1rem;
}

.work-card-declare-title {
  font-size: 1rem;
  margin: 0 0 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.work-card-declare-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 20rem);
  gap: 1.25rem;
  align-items: start;
}

.work-card-form-hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0.25rem 0 0;
}

.work-card-retro {
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  padding: 1rem;
  background: #f8fafc;
}

.work-card-retro--required {
  border-color: var(--err);
  background: #fef2f2;
}

.btn.work-card-action--required {
  border-color: var(--err) !important;
  color: var(--err) !important;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2);
}

.work-card-retro-title {
  font-size: 0.95rem;
  margin: 0 0 0.35rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  color: var(--text);
}

.work-card-retro-optional {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
}

.work-card-retro-desc {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 0.75rem;
  line-height: 1.4;
}

.work-card-retro .form-row input.input-time-24 {
  width: 100%;
  max-width: none;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.work-card-retro .form-row input[type="time"] {
  width: 100%;
  max-width: none;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.notify-recipients-wrap {
  margin-bottom: 0.5rem;
  overflow-x: auto;
}

.notify-recipients-table input {
  width: 100%;
  min-width: 6rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.88rem;
}

.notify-recipients-table input[readonly] {
  background: #f8fafc;
  color: var(--muted);
}

.work-card-actions-retro {
  border-top-color: #e2e8f0;
}

@media (max-width: 900px) {
  .work-card-declare-grid {
    grid-template-columns: 1fr;
  }
}

.btn-outline-primary {
  background: #fff;
  color: var(--brand-light);
  border: 2px solid var(--brand-light);
}

.btn-outline-primary:hover {
  background: #f0f4f8;
  color: var(--brand);
}

.work-card-form .ac-wrap {
  max-width: 28rem;
}

.work-card-employee-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 28rem;
}

.work-card-employee-row .ac-wrap {
  flex: 1;
  min-width: 0;
  max-width: none;
  margin-bottom: 0;
}

.work-card-employee-row input[type="text"] {
  max-width: none;
}

.work-card-employee-history {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 2.375rem;
  height: calc(0.5rem * 2 + 1.25rem + 2px);
  padding: 0 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--brand-light);
  text-decoration: none;
  flex-shrink: 0;
  line-height: 1;
}

.work-card-employee-history:hover {
  color: var(--brand);
  border-color: var(--brand-light);
  background: #f8fafc;
}

.work-card-employee-history .bi {
  font-size: 1rem;
}

.work-card-employee-history.hidden {
  display: none;
}

.page-back {
  margin: 0 0 0.75rem;
}

.page-back.hidden {
  display: none;
}

.page-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--brand-light);
  text-decoration: none;
}

.page-back-link:hover {
  color: var(--brand);
  text-decoration: underline;
}

.work-log-history-page-card {
  margin-top: 0.5rem;
}

.work-card-form .ac-wrap.field-err input {
  border-color: var(--err);
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.12);
}

.work-card-section {
  margin-bottom: 1rem;
}

.work-card-section-title {
  font-size: 1rem;
  margin: 0 0 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.work-card-section-desc {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 0.75rem;
  line-height: 1.45;
}

.work-card-section-desc a {
  color: var(--brand-light);
}

.btn,
a.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  border: none;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  background: var(--brand-light);
  color: #fff;
}

.btn:hover {
  background: var(--brand);
  color: #fff;
}

.btn:hover .bi {
  color: #fff;
}

.btn-secondary {
  background: #fff;
  color: var(--brand);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--brand);
}

.btn-danger {
  background: #fff;
  color: var(--err);
  border: 1px solid #fecaca;
}

.btn-danger .bi { color: var(--err); }

.btn-danger:hover {
  background: var(--err);
  color: #fff;
  border-color: var(--err);
}

.btn-danger:hover .bi {
  color: #fff;
}

.btn-select {
  background: #fff;
  color: var(--accent);
  border: 1px solid #99f6e4;
}

.btn-select:hover {
  background: #ecfdf5;
  color: #0f766e;
}

.btn-select .bi { color: var(--accent); }

.btn-sm {
  padding: 0.32rem 0.6rem;
  font-size: 0.75rem;
  gap: 0.35rem;
}

.btn .bi {
  font-size: 1.05em;
  line-height: 1;
}

.btn-sm .bi { font-size: 1.1em; }

.steps .step {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.steps .step .bi { font-size: 0.85em; }

.banner-active {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.banner-active .bi {
  font-size: 1.15rem;
  flex-shrink: 0;
}

.msg.show {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.msg .bi {
  flex-shrink: 0;
  margin-top: 0.1rem;
  margin-inline-end: 0.15rem;
}

@keyframes office-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.bi-spin {
  display: inline-block;
  animation: office-spin 0.85s linear infinite;
}

.btn.is-loading {
  opacity: 0.88;
  cursor: wait;
}

.meta-line {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  margin-bottom: 0.15rem;
}

.meta-line .bi {
  font-size: 0.8rem;
  color: var(--brand-light);
  width: 1rem;
  flex-shrink: 0;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.banner-active {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: var(--ok);
  padding: 0.65rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.88rem;
}

.banner-active.hidden { display: none; }

.table-loading {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 0.5rem 0;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  line-height: 1.35;
}

table.data th, table.data td {
  border-bottom: 1px solid var(--border);
  padding: 0.4rem 0.45rem;
  text-align: left;
}

table.data th {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

table.data tbody td {
  color: #3d4a57;
}

table.data tr:hover > td {
  background-color: #e2e8f0;
}

.cred-section-title {
  font-size: 0.92rem;
  margin: 1.1rem 0 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--brand);
}

.field-hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0 0 0.5rem;
  line-height: 1.35;
}

.ac-wrap { position: relative; }

.ac-list {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  list-style: none;
  display: none;
}

.ac-list.show { display: block; }

.ac-list li {
  padding: 0.5rem 0.7rem;
  cursor: pointer;
  font-size: 0.85rem;
}

.ac-list li:hover,
.ac-list li.highlighted {
  background: #e8f4fa;
}

.ac-list li.highlighted {
  outline: 2px solid var(--brand-light);
  outline-offset: -2px;
}

input[role="combobox"] {
  margin-bottom: 0;
}

.ac-wrap {
  margin-bottom: 1rem;
}

.msg {
  padding: 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  margin-top: 1rem;
  display: none;
}

.msg.ok { background: #ecfdf5; color: var(--ok); }
.msg.err { background: #fef2f2; color: var(--err); }
.msg.loading { background: #e0f2fe; color: #0369a1; }

.msg.loading .sync-loading-text {
  display: block;
  flex: 1;
  min-width: 0;
}

.sync-progress {
  width: 100%;
  flex: 1 1 100%;
  height: 6px;
  margin-top: 0.35rem;
  background: rgba(3, 105, 161, 0.15);
  border-radius: 999px;
  overflow: hidden;
}

.sync-progress-bar {
  height: 100%;
  background: #0284c7;
  border-radius: 999px;
  transition: width 0.25s ease;
}

.msg.show.loading {
  flex-wrap: wrap;
  align-items: center;
}

.card.sync-active .list-wrap {
  display: none;
}

.msg.sync-panel {
  display: flex !important;
  flex-direction: column;
  margin-top: 0;
  min-height: 8rem;
  padding: 1.5rem 1.25rem;
  font-size: 1rem;
  align-items: stretch;
}

.msg.sync-panel .sync-loading-text {
  font-size: 1rem;
  font-weight: 500;
}

.msg.sync-panel .sync-progress {
  height: 8px;
  margin-top: 0.65rem;
}

.sync-log-lines {
  max-height: 14rem;
  overflow-y: auto;
  margin-top: 1rem;
  padding: 0.75rem;
  background: rgba(15, 23, 42, 0.04);
  border-radius: 6px;
  font-size: 0.75rem;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  line-height: 1.45;
  width: 100%;
}

.sync-log-line + .sync-log-line {
  margin-top: 0.2rem;
}

.sync-log-line.sync-log-error {
  color: var(--err, #b91c1c);
}

.sync-log-line.sync-log-warn {
  color: #b45309;
}

.sync-log-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.sync-log-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: var(--muted);
  cursor: pointer;
}

.sync-log-detail-card {
  margin-top: 1rem;
}

.sync-log-detail-card.hidden {
  display: none;
}

.sync-log-detail-title {
  font-size: 1rem;
  margin: 0 0 0.75rem;
}

.sync-log-detail-meta {
  margin-bottom: 1rem;
}

.sync-log-meta-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.sync-log-meta-full {
  flex: 1 1 100%;
}

.sync-log-detail-lines {
  max-height: 28rem;
  overflow: auto;
  padding: 0.75rem;
  background: rgba(15, 23, 42, 0.04);
  border-radius: 6px;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.5;
}

.sync-log-detail-lines .sync-log-line-ts {
  color: var(--muted);
}

.sync-log-detail-lines .sync-log-line-level {
  font-weight: 600;
}

.sync-log-detail-lines .sync-log-fields {
  color: var(--muted);
}

.sync-log-runs-table .sync-log-ts {
  font-size: 0.78rem;
  white-space: nowrap;
}

.sync-log-runs-table .sync-log-duration {
  font-size: 0.78rem;
  white-space: nowrap;
  color: var(--muted);
}

.sync-log-runs-table tr.sync-log-run-row {
  cursor: pointer;
}

.sync-log-runs-table tr.sync-log-run-row.selected {
  background: rgba(37, 99, 235, 0.08);
}

.sync-status-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.sync-status-done {
  background: #dcfce7;
  color: #166534;
}

.sync-status-error {
  background: #fee2e2;
  color: #991b1b;
}

.sync-status-running {
  background: #dbeafe;
  color: #1d4ed8;
}

.table-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border, #e5e7eb);
  font-size: 0.85rem;
}

.table-pager-btn {
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  border: 1px solid var(--border, #d1d5db);
  border-radius: 6px;
  background: #fff;
  color: var(--text, #111827);
  cursor: pointer;
}

.table-pager-btn:hover:not(:disabled) {
  background: #f3f4f6;
}

.table-pager-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.table-pager-pages {
  color: var(--muted);
  min-width: 6.5rem;
  text-align: center;
}

.table-pager-info {
  margin-left: auto;
  color: var(--muted);
}

/* Toolbar ημερομηνιών */
.toolbar-dates {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
}

.toolbar-dates-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
}

.table-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Inline date range */
.dp-mount {
  flex: 1;
  min-width: 0;
}

.dp-mount.dp-single .dp-sep,
.dp-mount.dp-single .dp-field-end {
  display: none !important;
}

.dp-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 1rem;
}

.dp-bar--inline {
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.65rem;
}

.dp-mount--inline .dp-field-label {
  display: none;
}

.dp-bar--inline .dp-period {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

.sync-hub-log-card {
  margin-top: 0.75rem;
}

.sync-hub-section-title {
  font-size: 0.95rem;
  margin: 0 0 0.65rem;
  font-weight: 600;
}

.field-inline {
  display: inline-flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.input-select {
  min-width: 7rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  font-size: 0.88rem;
  color: var(--text);
}

.sync-hub-log-title {
  font-size: 0.92rem;
  margin: 0 0 0.5rem;
}

.sync-hub-log-wrap {
  max-height: min(52vh, 420px);
  overflow: auto;
  font-size: 0.76rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  background: #f8fafc;
}

.sync-hub-progress {
  margin: 0 0 0.5rem;
}

.sync-hub-log-live {
  margin-top: 0.35rem;
}

.dp-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.dp-chip {
  padding: 0.38rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.dp-chip:hover {
  border-color: var(--brand-light);
  color: var(--brand);
  background: #eef4f8;
}

.dp-chip.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.dp-period {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.6rem;
}

.dp-period-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.dp-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

.dp-field {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.dp-mount.dp-single .dp-field-label {
  display: none;
}

.dp-field-label {
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  line-height: 1;
}

.dp-date-field {
  position: relative;
}

.dp-date-control {
  display: inline-flex;
  align-items: stretch;
  width: auto;
  max-width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(26, 35, 50, 0.04);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.dp-date-control:focus-within {
  border-color: var(--brand-light);
  box-shadow: 0 0 0 3px rgba(42, 111, 148, 0.15);
}

.dp-date-control:focus-within .dp-text {
  outline: none;
  box-shadow: none;
}

.dp-cal-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  flex-shrink: 0;
  border: none;
  border-right: 1px solid var(--border);
  border-radius: 6px 0 0 6px;
  background: #eef1f5;
  color: #4a5568;
  cursor: pointer;
  padding: 0;
}

.dp-cal-btn:hover:not(:disabled) {
  background: #e2e8f0;
  color: var(--brand);
}

.dp-cal-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.dp-cal-btn .bi {
  font-size: 0.88rem;
}

.dp-text {
  flex: 0 0 auto;
  width: 7.1rem;
  min-width: 7.1rem;
  border: none;
  background: transparent;
  font-size: 0.84rem;
  font-family: inherit;
  color: var(--text);
  padding: 0.26rem 0.4rem 0.26rem 0.25rem;
  line-height: 1.25;
  outline: none;
  box-shadow: none;
  appearance: none;
  letter-spacing: 0;
  margin-bottom: 0;
}

.dp-text:disabled {
  color: var(--muted);
  cursor: not-allowed;
}

.dp-sep {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1;
  user-select: none;
}

.dp-cal-popup {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  z-index: 1300;
  width: 17.5rem;
  padding: 0.65rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
}

.dp-cal-popup.hidden {
  display: none;
}

.dp-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.dp-cal-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.dp-cal-nav {
  width: 1.75rem;
  height: 1.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.dp-cal-nav:hover {
  border-color: var(--brand-light);
  color: var(--brand);
}

.dp-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.15rem;
  margin-bottom: 0.25rem;
}

.dp-cal-weekdays span {
  text-align: center;
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
}

.dp-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.15rem;
}

.dp-cal-day {
  width: 100%;
  aspect-ratio: 1;
  border: none;
  border-radius: 999px;
  background: transparent;
  font-size: 0.76rem;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
}

.dp-cal-day:hover:not(:disabled):not(.outside) {
  background: #eef4f8;
}

.dp-cal-day.outside {
  color: #c5cdd8;
  cursor: default;
}

.dp-cal-day:disabled {
  color: #d5dbe3;
  cursor: not-allowed;
}

.dp-cal-day.selected {
  background: var(--brand);
  color: #fff;
}

.dp-cal-day.in-range:not(.selected) {
  background: #e8f1f7;
  border-radius: 0;
}

.dp-cal-day.range-start {
  border-radius: 999px 0 0 999px;
}

.dp-cal-day.range-end {
  border-radius: 0 999px 999px 0;
}

.work-card-retro .dp-date-field {
  width: 100%;
}

.work-card-retro .dp-date-control {
  width: 100%;
  min-width: 0;
}

.store-id-badge {
  display: inline-block;
  min-width: 1.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: #f1f5f9;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
}

.env-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.env-badge.env-production {
  background: #e0f2f1;
  color: #0f766e;
}

.env-badge.env-trial {
  background: #fef3c7;
  color: #b45309;
}

.report-summary {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.88rem;
}

.report-meta-line {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
}

.report-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.report-chip {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
}

.status-badge {
  display: inline-block;
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 500;
  white-space: nowrap;
  line-height: 1.25;
}

.status-ok { background: #d1fae5; color: var(--ok); }
.status-warn { background: #fef3c7; color: #b45309; }
.status-info { background: #e0f2fe; color: #0369a1; }
.status-err { background: #fee2e2; color: var(--err); }
.status-muted { background: #eef2f6; color: var(--muted); }

.report-chip.status-ok { background: #d1fae5; color: var(--ok); }
.report-chip.status-warn { background: #fef3c7; color: #b45309; }
.report-chip.status-info { background: #e0f2fe; color: #0369a1; }
.report-chip.status-err { background: #fee2e2; color: var(--err); }
.report-chip.status-muted { background: #eef2f6; color: var(--muted); }

table.data.report-table {
  font-size: 0.74rem;
  line-height: 1.3;
}

table.data.report-table th,
table.data.report-table td {
  padding: 0.28rem 0.38rem;
}

table.data.report-table th {
  font-size: 0.64rem;
}

table.data.report-table tbody td {
  color: #4a5568;
}

table.data.report-table td.col-action {
  max-width: 11rem;
  font-size: 0.7rem;
  color: var(--muted);
  line-height: 1.28;
}

table.data.report-table td.col-name {
  font-weight: 500;
  color: var(--text);
}

table.data.report-table td.col-afm {
  font-variant-numeric: tabular-nums;
  font-size: 0.7rem;
  color: var(--muted);
}

table.data td.col-flex,
table.data.report-table td.col-flex {
  font-variant-numeric: tabular-nums;
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
}

table.data.report-table td.col-hours {
  white-space: nowrap;
}

.report-missing-time {
  display: inline-flex;
  align-items: center;
  color: var(--err);
  vertical-align: middle;
}

.report-missing-time .bi {
  font-size: 0.95rem;
}

table.data.report-table td.work-log-action-cell {
  text-align: center;
  width: 2.75rem;
}

.report-notes {
  margin: 0.2rem 0 0 0.85rem;
  padding: 0;
  font-size: 0.68rem;
  color: var(--muted);
  line-height: 1.25;
}

.btn-leave {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  padding: 0.28rem 0.55rem;
}

.office-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.office-modal.hidden {
  display: none;
}

.office-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.work-log-name-cell {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

table.data th.col-history,
table.data td.col-history {
  width: 2.5rem;
  text-align: center;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
  white-space: nowrap;
}

.work-log-history-cell {
  vertical-align: middle;
}

.work-log-history-btn {
  flex-shrink: 0;
  padding: 0.12rem 0.32rem;
  line-height: 1;
}

.work-log-card-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-light);
  text-decoration: none;
  line-height: 1;
}

.work-log-card-link:hover {
  color: var(--brand);
}

.work-log-card-link .bi {
  font-size: 1.1rem;
}

.work-log-card-link--required {
  color: var(--err);
}

.work-log-card-link--required:hover {
  color: #b91c1c;
}

.work-log-action-cell {
  width: 2.75rem;
  text-align: center;
  white-space: nowrap;
}

.work-log-history-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  margin-top: 0.25rem;
}

.work-log-history-wrap table.work-log-history-table {
  font-size: 0.72rem;
  table-layout: auto;
}

.work-log-history-wrap table.work-log-history-table th,
.work-log-history-wrap table.work-log-history-table td {
  padding: 0.35rem 0.5rem;
}

.work-log-history-wrap table.work-log-history-table th:nth-child(1),
.work-log-history-wrap table.work-log-history-table td:nth-child(1) {
  white-space: nowrap;
}

tr.work-log-row--deficient td {
  color: var(--err);
}

tr.work-log-row--deficient td strong {
  color: var(--err);
}

.work-log-time-missing {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1;
}

tr.work-log-row--deficient .work-log-time-missing {
  color: var(--err);
}

table.data tbody tr.work-log-row--deficient td,
table.data tbody tr.work-log-row--deficient td strong {
  color: var(--err);
}

.office-modal-panel {
  position: relative;
  width: min(100%, 400px);
  max-height: min(92vh, 520px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 0.95rem 0.95rem;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
  font-size: 0.78rem;
}

.office-modal-panel.office-modal-panel--history {
  width: min(100%, 1000px);
  max-width: 92vw;
  max-height: min(92vh, 680px);
}

.office-modal-title {
  margin: 0 0 0.25rem;
  font-size: 0.9rem;
}

.office-modal-sub {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.3;
}

.office-modal-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 0.85rem;
}

.field-label {
  display: block;
  font-size: 0.68rem;
  color: var(--muted);
  margin: 0.3rem 0 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.field-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.38rem 0.5rem;
  font: inherit;
  font-size: 0.74rem;
  background: var(--bg);
  color: var(--text);
}

.office-modal-panel textarea.field-input {
  resize: vertical;
  min-height: 2.5rem;
}

.leave-type-picker {
  position: relative;
}

.leave-type-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  text-align: left;
  cursor: pointer;
}

.leave-type-trigger::after {
  content: "▾";
  font-size: 0.65rem;
  color: var(--muted);
  flex-shrink: 0;
}

.leave-type-trigger[aria-expanded="true"]::after {
  content: "▴";
}

.leave-type-list {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 2px);
  z-index: 5;
  margin: 0;
  padding: 0.15rem 0;
  list-style: none;
  max-height: 8.5rem;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
  font-size: 0.68rem;
  line-height: 1.28;
}

.leave-type-list.show {
  display: block;
}

.leave-type-list li {
  padding: 0.32rem 0.45rem;
  cursor: pointer;
  color: var(--text);
}

.leave-type-list li:hover,
.leave-type-list li.selected {
  background: var(--brand);
  color: #fff;
}

.leave-type-list li .leave-type-code {
  font-weight: 600;
  margin-right: 0.25rem;
}

@media (max-width: 768px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { padding-bottom: 0.5rem; }
  .form-row { grid-template-columns: 1fr; }
  .dp-bar { flex-direction: column; align-items: stretch; }
  .dp-fields { width: 100%; }
  .dp-field { flex: 1; min-width: 140px; }
  .dp-date-control { width: 100%; }
  .dp-text { width: 100%; flex: 1; min-width: 0; }
  .dp-period { width: 100%; }
}

body.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: linear-gradient(160deg, #1e4d6b 0%, #0f2d42 55%, #0d3d4a 100%);
}

.login-shell {
  width: 100%;
  max-width: 420px;
}

.login-card {
  padding: 1.75rem;
}

.login-brand {
  text-align: center;
  margin-bottom: 1.25rem;
}

.login-brand .logo-img {
  max-width: 180px;
  height: auto;
  margin: 0 auto 0.5rem;
  display: block;
}

.login-subtitle {
  color: var(--muted);
  font-size: 0.88rem;
}

.login-title {
  font-size: 1.25rem;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.login-card label {
  display: block;
  margin-top: 0.75rem;
  margin-bottom: 0.25rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.login-card input {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
}

.sidebar nav a[data-nav="logout"] {
  margin-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 0.75rem;
  opacity: 0.9;
}
