/* ==========================================================================
   Финансы ПВЗ - Core Design System & Styles
   ========================================================================== */

:root {
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --border-color: #e2e8f0;
  --border-focus: #3b82f6;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-light: #e0f2fe;
  
  --ozon-blue: #005bff;
  --ozon-blue-hover: #004ecc;
  --ozon-light: #eff6ff;

  --success: #16a34a;
  --success-bg: #f0fdf4;
  --success-border: #bbf7d0;

  --warning: #d97706;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;

  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.05);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  font-size: 15px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ================= Navbar ================= */
.navbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text-main);
  text-decoration: none;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.brand-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.company-badge {
  font-size: 0.78rem;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  color: var(--text-muted);
  font-weight: 600;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: middle;
}

.trial-badge {
  font-size: 0.75rem;
  background: #fef3c7;
  color: #92400e;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  font-weight: 700;
  border: 1px solid #fde68a;
  text-decoration: none;
  white-space: nowrap;
  display: inline-block;
}
.trial-badge:hover {
  text-decoration: none;
  background: #fde68a;
}

.nav-divider {
  width: 1px;
  height: 20px;
  background-color: var(--border-color);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-link {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  white-space: nowrap;
}
.nav-link:hover {
  color: var(--text-main);
  background-color: var(--bg-card-subtle);
  text-decoration: none;
}
.nav-link.active {
  color: var(--primary);
  background-color: var(--primary-light);
  font-weight: 700;
}

.user-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.user-badge {
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--bg-card-subtle);
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.logout-btn {
  padding: 0.25rem 0.55rem;
  font-size: 0.82rem;
}

@media (max-width: 1200px) {
  .nav-container {
    padding: 0.45rem 0.75rem;
    gap: 0.5rem;
  }
  .brand-text {
    font-size: 1rem;
  }
  .nav-link {
    padding: 0.3rem 0.5rem;
    font-size: 0.84rem;
  }
  .branch-select {
    max-width: 140px;
    font-size: 0.82rem;
  }
  .branch-selector-label {
    display: none;
  }
}

/* ================= Layout & Container ================= */
.main-container {
  max-width: 1360px;
  width: 100%;
  margin: 1.5rem auto;
  padding: 0 1.5rem;
  flex: 1;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.page-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ================= Buttons ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  font-family: inherit;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
}
.btn-primary:hover {
  background-color: var(--primary-hover);
  text-decoration: none;
}

.btn-ozon {
  background-color: var(--ozon-blue);
  color: #ffffff;
}
.btn-ozon:hover {
  background-color: var(--ozon-blue-hover);
  text-decoration: none;
}

.btn-outline {
  background-color: var(--bg-card);
  border-color: var(--border-color);
  color: var(--text-main);
}
.btn-outline:hover {
  background-color: var(--bg-card-subtle);
  border-color: #cbd5e1;
  text-decoration: none;
}

.btn-success {
  background-color: var(--success);
  color: #ffffff;
}
.btn-success:hover {
  background-color: #15803d;
}

.btn-danger {
  background-color: var(--danger);
  color: #ffffff;
}
.btn-danger:hover {
  background-color: #b91c1c;
}

.btn-sm {
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
}

.btn-icon {
  padding: 0.35rem 0.5rem;
}

/* ================= Quick Action Bar ================= */
.quick-actions-bar {
  background: var(--bg-card);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.quick-label {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 0.25rem;
}

/* ================= Cards & Grid ================= */
.cards-grid-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.stat-card.featured-ozon {
  background: linear-gradient(135deg, #ffffff 0%, var(--ozon-light) 100%);
  border-color: #bfdbfe;
}

.stat-card.featured-cash {
  background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
  border-color: var(--success-border);
}

.stat-card.featured-profit {
  background: linear-gradient(135deg, #ffffff 0%, #fef3c7 100%);
  border-color: var(--warning-border);
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.4rem;
}

.stat-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.stat-value {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
  line-height: 1.2;
}

.stat-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* ================= Partner Distribution Cards ================= */
.partner-results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.partner-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
}

.partner-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

.partner-name {
  font-size: 1.25rem;
  font-weight: 700;
}

.partner-share-badge {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
}

.user-badge {
  display: inline-block;
  padding: 0.2rem 0.45rem;
  border-radius: 9999px;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  border: 1px solid transparent;
}

.partner-line {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.partner-line-val {
  font-weight: 600;
  color: var(--text-main);
}

.partner-total-box {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-card-subtle);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.partner-total-label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
}

.partner-total-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

/* ================= Alert & Deficit Box ================= */
.alert-box {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  border: 1px solid transparent;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.alert-danger {
  background-color: var(--danger-bg);
  border-color: var(--danger-border);
  color: #991b1b;
}

.alert-warning {
  background-color: var(--warning-bg);
  border-color: var(--warning-border);
  color: #92400e;
}

.alert-success {
  background-color: var(--success-bg);
  border-color: var(--success-border);
  color: #166534;
}

.alert-title {
  font-weight: 700;
  margin-bottom: 0.25rem;
}

/* ================= Financial Sections & Tables ================= */
.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.section-card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  background: #fafafa;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.section-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-card-body {
  padding: 1.25rem;
}

.table-responsive {
  overflow-x: auto;
}

.app-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

.app-table th {
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background-color: #f8fafc;
  border-bottom: 1px solid var(--border-color);
}

.app-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.app-table tbody tr:last-child td {
  border-bottom: none;
}

.app-table tbody tr:hover {
  background-color: #f8fafc;
}

.text-right {
  text-align: right;
}
.text-center {
  text-align: center;
}
.font-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.font-bold {
  font-weight: 700;
}

/* ================= Forms & Inputs ================= */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.form-control {
  width: 100%;
  padding: 0.55rem 0.75rem;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: #ffffff;
  color: var(--text-main);
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

/* ================= Modal ================= */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 550px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  animation: modalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  padding: 0.25rem;
}
.modal-close:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  background: #fafafa;
}

/* ================= Toast Notification ================= */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: #1e293b;
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.25s ease;
  pointer-events: none;
  z-index: 200;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ================= Shifts Calendar & Modules ================= */
.month-nav-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.month-nav-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.month-title-main {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.emp-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.85rem;
}

.emp-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.emp-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.emp-stat-top {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.emp-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.emp-stat-info {
  flex: 1;
  min-width: 0;
}

.emp-stat-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.emp-stat-breakdown {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.emp-stat-total {
  text-align: right;
}

.emp-total-num {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
}

.emp-total-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.emp-stat-rate {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border-color);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ================= Calendar Grid ================= */
.calendar-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 2rem;
}

.calendar-header-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color);
}

.calendar-weekday-col {
  padding: 0.75rem 0.5rem;
  text-align: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-right: 1px solid var(--border-color);
  min-width: 0;
  overflow: hidden;
}
.calendar-weekday-col:last-child {
  border-right: none;
}
.calendar-weekday-col.weekend {
  color: #ef4444;
}

.calendar-days-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  background: var(--border-color);
  gap: 1px;
}

.calendar-day-cell {
  background: #ffffff;
  min-height: 115px;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
  position: relative;
  min-width: 0;
  overflow: hidden;
}

.calendar-day-cell:hover {
  background-color: #f8fafc;
}

.calendar-day-cell.other-month {
  background-color: #fbfcfd;
  opacity: 0.45;
  cursor: default;
}

.calendar-day-cell.weekend {
  background-color: #fafbfc;
}
.calendar-day-cell.weekend:hover {
  background-color: #f1f5f9;
}

.calendar-day-cell.today {
  background-color: #f0f9ff;
  border: 2px solid var(--primary);
  z-index: 1;
}

.day-cell-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.day-number {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.day-number.today-badge {
  background-color: var(--primary);
  color: #ffffff;
}

.today-text-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.1rem 0.4rem;
  border-radius: 9999px;
}

.day-cell-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.empty-shift-hint {
  font-size: 0.8rem;
  color: var(--text-light);
  text-align: center;
  padding: 0.5rem 0.25rem;
  border-radius: var(--radius-sm);
  border: 1px dashed transparent;
  transition: all 0.15s ease;
}
.calendar-day-cell:hover .empty-shift-hint {
  color: var(--primary);
  border-color: var(--primary-light);
  background: var(--primary-light);
  font-weight: 600;
}

.plus-icon {
  font-weight: 800;
}

/* Single Full Shift Card */
.shift-card-full {
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  transition: transform 0.15s ease;
}
.calendar-day-cell:hover .shift-card-full {
  transform: scale(1.02);
}

.shift-card-emp {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.2;
}

.shift-emp-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shift-badge-pill {
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.shift-comment-note {
  font-size: 0.72rem;
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.1rem;
}

/* Dual Split Half Shift Card */
.shift-card-dual {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: transform 0.15s ease;
}
.calendar-day-cell:hover .shift-card-dual {
  transform: scale(1.02);
}

.shift-half-slot {
  padding: 0.3rem 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.82rem;
  border-radius: 4px;
}

.shift-half-prefix {
  font-size: 0.72rem;
  opacity: 0.85;
  font-weight: 600;
  white-space: nowrap;
}

.shift-half-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.85rem;
}

.shift-comment-note-dual {
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 0 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ================= Shift Mode Radio Selector ================= */
.shift-mode-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.mode-radio-label {
  cursor: pointer;
}
.mode-radio-label input[type="radio"] {
  display: none;
}

.mode-radio-card {
  padding: 0.75rem 0.5rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  text-align: center;
  background: var(--bg-card);
  transition: all 0.15s ease;
}

.mode-radio-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-main);
  margin-bottom: 0.2rem;
}

.mode-radio-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.mode-radio-label input[type="radio"]:checked + .mode-radio-card {
  border-color: var(--primary);
  background-color: var(--primary-light);
}
.mode-radio-label input[type="radio"]:checked + .mode-radio-card .mode-radio-title {
  color: var(--primary);
}

.btn-danger-hover:hover {
  background-color: var(--danger) !important;
  color: #ffffff !important;
  border-color: var(--danger) !important;
}

/* ================= Bulk Shift Mode Banner & Styles ================= */
.bulk-mode-banner {
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  border: 2px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.15);
  position: sticky;
  top: 0.75rem;
  z-index: 50;
  backdrop-filter: blur(8px);
  animation: fadeInDown 0.2s ease-out;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.bulk-banner-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.bulk-banner-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.bulk-icon {
  font-size: 1.3rem;
  background: #ffffff;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid #bfdbfe;
  flex-shrink: 0;
}

.bulk-banner-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
}

.bulk-emp-select-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 240px;
}

.bulk-select-label {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-main);
  white-space: nowrap;
}

.bulk-select {
  flex: 1;
  font-weight: 600;
  border: 2px solid var(--primary);
  background: #ffffff;
}

.select-highlight-error {
  animation: shake 0.3s ease-in-out;
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25) !important;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.bulk-stats-pill {
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.9rem;
  color: var(--text-main);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

.bulk-stats-pill strong {
  color: var(--primary);
  font-size: 1.05rem;
}

.bulk-actions-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Bulk Mode Calendar Grid Interactivity */
.calendar-bulk-mode .calendar-day-cell:not(.other-month) {
  cursor: pointer;
  border: 2px dashed transparent;
  transition: all 0.15s ease;
}

.calendar-bulk-mode .calendar-day-cell:not(.other-month):hover {
  background-color: #f0f9ff;
  border-color: #38bdf8;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);
}

.calendar-day-cell.bulk-selected {
  border: 2px solid var(--primary) !important;
  background-color: #f8fafc !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.bulk-check-mark {
  font-size: 0.75rem;
  font-weight: 800;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: var(--primary);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  margin-left: auto;
  margin-right: 0.35rem;
  animation: popIn 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  0% { transform: scale(0); }
  80% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.shift-card-bulk-preview {
  animation: popIn 0.15s ease-out;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

/* ================= Log Badges ================= */
.log-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.log-create {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.log-update {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid #bfdbfe;
}

.log-delete {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}

.log-bulk {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.log-text {
  font-size: 0.92rem;
  color: var(--text-main);
  line-height: 1.4;
}

.log-group-row {
  background-color: #fafbfc;
  transition: background-color 0.15s ease;
}

.log-group-row:hover {
  background-color: #f1f5f9 !important;
}

.log-group-cell {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.log-group-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-group-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  padding: 0.25rem 0.6rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.btn-group-toggle:hover {
  background: var(--bg-card-subtle);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-group-toggle-active {
  background: var(--primary-light) !important;
  color: var(--primary) !important;
  border-color: #93c5fd !important;
}

.log-group-date-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #b45309;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 0.2rem 0.5rem;
  white-space: nowrap;
}

.log-group-subtable-wrap {
  margin-top: 0.35rem;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-left: 3px solid #f59e0b;
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  animation: fadeIn 0.15s ease-out;
}

.log-subtable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.log-subtable th {
  text-align: left;
  padding: 0.35rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.log-subtable td {
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.log-subtable tr:last-child td {
  border-bottom: none;
}

/* ================= Mobile & Desktop Payroll View ================= */
.btn-block {
  width: 100%;
  display: inline-flex;
  justify-content: center;
}

.modal-payroll-card {
  max-width: 860px;
  width: 100%;
}

.payroll-section-header {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.payroll-desktop-view {
  display: block;
}

.payroll-mobile-view {
  display: none !important;
}

.payroll-cards-list {
  flex-direction: column;
  gap: 0.75rem;
}

.payroll-item-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.payroll-item-card.is-paid {
  background-color: #f0fdf4 !important;
  border-color: var(--success-border);
}

.payroll-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.payroll-card-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-main);
}

.payroll-card-amount {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.payroll-amount-value {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--success);
}

.payroll-card-details {
  background: var(--bg-card-subtle);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-size: 0.88rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.payroll-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.payroll-card-action {
  margin-top: 0.2rem;
}

.payroll-card-action .btn {
  width: 100%;
  padding: 0.65rem 1rem;
  font-size: 0.95rem;
  font-weight: 700;
}

/* ================= Responsive Breakpoints ================= */
@media (max-width: 768px) {
  body {
    padding-bottom: env(safe-area-inset-bottom, 1rem);
  }

  .main-container {
    margin: 1rem auto;
    padding: 0 0.75rem;
  }

  /* Switch Payroll Modal to Mobile Cards */
  .payroll-desktop-view {
    display: none !important;
  }

  .payroll-mobile-view {
    display: flex !important;
  }

  /* Modals on mobile */
  .modal-overlay {
    padding: 0.5rem;
    align-items: flex-end;
  }

  .modal-card {
    max-width: 100%;
    width: 100%;
    max-height: 94vh;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    margin: 0 auto;
  }

  .modal-header {
    padding: 1rem;
  }

  .modal-title {
    font-size: 1.05rem;
  }

  .modal-body {
    padding: 1rem;
    -webkit-overflow-scrolling: touch;
  }

  .modal-footer {
    padding: 0.75rem 1rem;
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  }

  .btn-block-mobile {
    width: 100%;
  }

  /* Quick Actions Bar horizontally scrollable chips */
  .quick-actions-bar {
    overflow-x: auto;
    flex-wrap: nowrap;
    white-space: nowrap;
    padding: 0.6rem 0.75rem;
    gap: 0.5rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-bottom: 1rem;
  }
  .quick-actions-bar::-webkit-scrollbar {
    display: none;
  }
  .quick-label {
    display: none;
  }
  .quick-actions-bar .btn {
    flex-shrink: 0;
    padding: 0.45rem 0.75rem;
    font-size: 0.82rem;
  }

  /* Form controls iOS auto-zoom fix (16px) */
  input[type="text"],
  input[type="number"],
  input[type="password"],
  input[type="date"],
  select,
  textarea {
    font-size: 16px !important;
  }

  /* Cards Grid on mobile */
  .cards-grid-summary {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .stat-card {
    padding: 1rem;
  }

  .stat-value {
    font-size: 1.6rem;
  }

  .partner-results-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .partner-card {
    padding: 1rem;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
  }

  .page-title {
    font-size: 1.45rem;
  }

  .page-actions {
    width: 100%;
  }

  .page-actions .btn {
    flex: 1;
    width: 100%;
    padding: 0.75rem 1rem;
  }

  .nav-container {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.6rem 0.85rem;
  }

  .nav-links {
    order: 3;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    padding-top: 0.35rem;
    scrollbar-width: none;
  }
  .nav-links::-webkit-scrollbar {
    display: none;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .settings-top-grid {
    grid-template-columns: 1fr !important;
  }

  /* Shifts Calendar & Navigation on mobile */
  .month-nav-bar {
    padding: 0.6rem 0.75rem;
    gap: 0.5rem;
  }

  .month-nav-left {
    width: 100%;
    justify-content: space-between;
    gap: 0.35rem;
  }

  .month-nav-left .btn {
    padding: 0.35rem 0.55rem;
    font-size: 0.8rem;
  }

  .month-title-main {
    font-size: 1.05rem;
    white-space: nowrap;
  }

  .month-nav-right {
    width: 100%;
  }

  .month-nav-right .btn {
    width: 100%;
  }

  .emp-stats-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .calendar-container {
    margin-bottom: 1.25rem;
    border-radius: var(--radius-md);
  }

  .calendar-header-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .calendar-weekday-col {
    padding: 0.4rem 0.1rem;
    font-size: 0.72rem;
    letter-spacing: 0;
    min-width: 0;
    overflow: hidden;
  }

  .calendar-days-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 1px;
  }

  .calendar-day-cell {
    min-height: 52px;
    padding: 2px 2px 3px 2px;
    min-width: 0;
    overflow: hidden;
  }

  .day-cell-top {
    margin-bottom: 2px;
    align-items: center;
    justify-content: space-between;
    gap: 2px;
    min-height: 18px;
  }

  .day-number {
    width: 19px;
    height: 19px;
    font-size: 0.72rem;
    font-weight: 700;
  }

  .today-text-label {
    display: none;
  }

  .bulk-check-mark {
    width: 14px;
    height: 14px;
    font-size: 0.6rem;
    margin-right: 0;
    margin-left: auto;
  }

  .day-cell-content {
    min-width: 0;
    overflow: hidden;
  }

  .shift-card-full {
    padding: 2px 2px;
    border-radius: 4px;
    gap: 0;
    min-width: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    overflow: hidden;
  }

  .shift-card-full .shift-icon,
  .shift-card-full .shift-badge-pill,
  .shift-card-full .shift-comment-note {
    display: none;
  }

  .shift-card-emp {
    gap: 0;
    min-width: 0;
    justify-content: center;
    overflow: hidden;
  }

  .shift-emp-name {
    font-size: 0.68rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    display: block;
  }

  .shift-card-dual {
    gap: 1px;
    border-radius: 3px;
    min-width: 0;
    overflow: hidden;
  }

  .shift-half-slot {
    padding: 1px 2px;
    border-radius: 2px;
    justify-content: center;
    gap: 0;
    min-width: 0;
    overflow: hidden;
  }

  .shift-half-prefix {
    display: none;
  }

  .shift-half-name {
    font-size: 0.62rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    display: block;
  }

  .shift-comment-note-dual {
    display: none;
  }

  .empty-shift-hint {
    padding: 2px 0;
    font-size: 0.75rem;
    min-height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .empty-shift-hint .empty-hint-text {
    display: none;
  }

  .empty-shift-hint .plus-icon {
    font-size: 0.85rem;
    line-height: 1;
    color: var(--text-light);
  }

  .shift-mode-selector {
    grid-template-columns: 1fr;
  }

  /* Bulk banner mobile adjustments */
  .bulk-mode-banner {
    padding: 0.75rem 0.85rem;
    top: 0.5rem;
  }
  .bulk-banner-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .bulk-emp-select-wrap {
    min-width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  .bulk-select {
    width: 100%;
  }
  .bulk-stats-pill {
    text-align: center;
    width: 100%;
  }
  .bulk-actions-group {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 0.4rem;
  }
  .bulk-actions-group .btn {
    padding: 0.5rem 0.6rem;
    font-size: 0.82rem;
  }

  /* Make sure all buttons have comfortable tap targets */
  .btn {
    min-height: 38px;
  }
  .btn-sm {
    min-height: 32px;
  }
}

/* ==========================================================================
   Multi-Branch & PWA Mobile Navigation Enhancements
   ========================================================================== */

/* Branch Selector in Navbar */
.nav-brand-group {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.branch-selector-wrapper {
  display: inline-flex;
  align-items: center;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.2rem 0.5rem 0.2rem 0.75rem;
  gap: 0.35rem;
  transition: all 0.15s ease;
}

.branch-selector-wrapper:hover,
.branch-selector-wrapper:focus-within {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 2px var(--primary-light);
}

.branch-selector-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  white-space: nowrap;
}

.branch-select {
  background: transparent;
  border: none;
  padding: 0.25rem 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  outline: none;
  max-width: 200px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.role-tag {
  font-size: 0.75rem;
  opacity: 0.85;
  margin-left: 0.25rem;
  font-weight: 600;
}

/* PWA Mobile Bottom Nav */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  z-index: 1000;
  padding: env(safe-area-inset-bottom, 0.4rem) 0.5rem 0.4rem;
  justify-content: space-around;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  min-width: 54px;
}

.bottom-nav-item.active {
  color: var(--primary);
}

.bottom-nav-item .nav-icon {
  font-size: 1.25rem;
  line-height: 1;
  margin-bottom: 2px;
}

/* Visibility classes */
.mobile-only {
  display: none !important;
}

.desktop-only {
  display: block;
}

.desktop-only.flex,
.nav-links.desktop-only {
  display: flex !important;
}

.desktop-only.inline-flex,
.nav-divider.desktop-only {
  display: inline-block !important;
}

@media (max-width: 768px) {
  body.has-user {
    padding-bottom: 70px;
  }

  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: block !important;
  }

  .mobile-only.flex,
  .mobile-bottom-nav {
    display: flex !important;
  }

  .brand-text {
    display: none;
  }

  .branch-select {
    max-width: 160px;
    font-size: 0.82rem;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

/* Summary Dashboard KPI & Cards */
.summary-header {
  margin-bottom: 1.5rem;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.kpi-card:hover {
  box-shadow: var(--shadow-md);
}

.kpi-card.highlight-card {
  background: linear-gradient(145deg, #f0f9ff 0%, #e0f2fe 100%);
  border-color: #bae6fd;
}

.kpi-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.kpi-card.highlight-card .kpi-label {
  color: #0369a1;
}

.kpi-value {
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
  white-space: nowrap;
}

.kpi-value.highlight-value {
  color: var(--primary);
  font-size: 1.85rem;
}

.kpi-subtext {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.summary-table-card {
  margin-bottom: 2rem;
  width: 100%;
}

.summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.summary-table th {
  padding: 0.75rem 0.75rem;
  font-weight: 700;
  font-size: 0.82rem;
  white-space: nowrap;
}

.summary-table td {
  padding: 0.75rem 0.75rem;
  vertical-align: middle;
}

.summary-table th.highlight-col,
.summary-table td.highlight-cell {
  background-color: #f0f9ff;
}

.summary-total-row td {
  border-top: 2px solid var(--border-color);
  font-weight: 700;
  background-color: #f8fafc;
  padding: 0.85rem 0.75rem;
}

/* Branch Summary Cards on Mobile */
.branch-cards-list {
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.branch-summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}

.branch-card-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.branch-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 0.85rem 0;
  padding: 0.75rem 0;
  border-top: 1px dashed var(--border-color);
  border-bottom: 1px dashed var(--border-color);
}

.branch-metric {
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.metric-value {
  font-size: 0.95rem;
}

.highlight-metric {
  grid-column: span 2;
  background: #f0f9ff;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid #bae6fd;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  background: #fafafa;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.card-body {
  padding: 1.25rem;
}

.branch-config-card {
  margin-bottom: 1.5rem;
}

.branch-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--success);
  display: inline-block;
}

.branch-title-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.branch-name-title {
  font-size: 1.25rem;
  margin-bottom: 0;
}

.branch-address-tag {
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--bg-card-subtle);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}

.branch-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  width: 100%;
}

.detail-block {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  padding: 1rem 1.15rem;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.detail-block-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.35rem;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  margin-bottom: 0.45rem;
}

.detail-row:last-child {
  margin-bottom: 0;
}

/* Employee Personal Summary */
.branch-payouts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.branch-payout-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem;
}

.b-payout-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.b-payout-shifts {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0.25rem 0;
}

.b-payout-amount {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.4rem;
}

/* Chip tags */
.chip-badge {
  font-size: 0.65rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 0 4px;
  border-radius: 3px;
  margin-left: 2px;
}

.chip-rate {
  font-size: 0.68rem;
  font-weight: 800;
  margin-left: auto;
  opacity: 0.9;
}

/* ==========================================================================
   Settings & Team Management Tabs, Forms & Archive UI
   ========================================================================== */

/* Tabs Navigation Bar */
.tabs-nav-bar {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1.5rem;
  padding-bottom: 0.25rem;
  scrollbar-width: none;
}

.tabs-nav-bar::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.6rem 1.15rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.tab-btn:hover {
  background: var(--bg-card-subtle);
  color: var(--text-main);
  border-color: var(--primary-light, #93c5fd);
}

.tab-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* Button groups and alignment utilities */
.btn-group-sm {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.flex-align-center {
  display: flex;
  align-items: center;
}

.gap-sm {
  gap: 0.5rem;
}

.gap-md {
  gap: 1rem;
}

.gap-lg {
  gap: 1.5rem;
}

.border-muted {
  border: 1px dashed var(--border-color) !important;
}

.opacity-50 {
  opacity: 0.5;
}

/* Archived Employees Table */
.data-table-muted th {
  background-color: #f1f5f9;
  color: #64748b;
}

.row-archived {
  background-color: #fafafa;
  color: #64748b;
}

.row-archived td {
  border-bottom-color: #e2e8f0;
}

/* Form section dividers */
.form-section-divider {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.35rem;
  margin: 1.25rem 0 0.85rem;
}

/* Branch & Checkbox Pills */
.branch-checkboxes-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.checkbox-pill,
.radio-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.checkbox-pill input,
.radio-pill input {
  margin: 0;
  cursor: pointer;
}

.checkbox-pill:hover,
.radio-pill:hover {
  border-color: var(--primary);
  background: #ffffff;
}

.radio-group-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* General Layout & Table wrap fixes */
.page-title {
  font-size: clamp(1.3rem, 2.5vw, 1.85rem);
  line-height: 1.2;
}

.subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  line-height: 1.4;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table th,
.data-table td {
  padding: 0.75rem 0.85rem;
  font-size: 0.88rem;
  vertical-align: middle;
}

.color-badge {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  vertical-align: middle;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.form-color-picker {
  height: 40px;
  padding: 2px 4px;
  cursor: pointer;
}

/* Team and Employees Table compact styles */
#team-main-table th {
  font-size: 0.75rem;
  padding: 0.65rem 0.6rem;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

#team-main-table td {
  padding: 0.75rem 0.6rem;
  font-size: 0.88rem;
}
