/* ============================================================
   KITA Zeiterfassung - Main Stylesheet
   ============================================================ */

/* CSS Custom Properties */
:root {
  --primary: #2E7D5E;
  --primary-dark: #1a5c44;
  --primary-light: #4CAF84;
  --accent: #f0a500;
  --accent-dark: #d4900a;
  --error: #c0392b;
  --error-light: #fdecea;
  --success: #27ae60;
  --success-light: #eafaf1;
  --warning: #f39c12;
  --warning-light: #fef9e7;
  --bg: #f5f7fa;
  --card-bg: #ffffff;
  --border: #e0e4ea;
  --text: #2c3e50;
  --text-secondary: #6b7c93;
  --text-light: #95a5a6;
  --nav-height: 64px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
  --radius: 8px;
  --radius-sm: 4px;
  --radius-lg: 12px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}

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

a:hover {
  text-decoration: underline;
}

ul {
  list-style: none;
}

input, select, textarea, button {
  font-family: var(--font);
  font-size: 1rem;
}

/* ============================================================
   Utilities
   ============================================================ */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-secondary { color: var(--text-secondary); }
.text-error { color: var(--error); }
.text-success { color: var(--success); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.flex-gap { display: flex; gap: 0.75rem; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.w-full { width: 100%; }

/* ============================================================
   Navbar
   ============================================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.nav-logo {
  font-size: 1.4rem;
}

.nav-title {
  font-size: 1.1rem;
  font-weight: 700;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
  padding-left: 1rem;
}

.nav-link {
  color: rgba(255,255,255,0.85);
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.nav-link:hover {
  background: rgba(255,255,255,0.15);
  color: white;
  text-decoration: none;
}

.nav-link.active {
  background: rgba(255,255,255,0.2);
  color: white;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  margin-left: auto;
}

#navUserName {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.9);
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  margin-left: auto;
}

/* ============================================================
   Main Content Area
   ============================================================ */
#app {
  margin-top: var(--nav-height);
  min-height: calc(100vh - var(--nav-height));
  padding: 2rem 1.5rem;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  margin-top: calc(var(--nav-height) + 0px);
}

/* ============================================================
   Loading Screen
   ============================================================ */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 1rem;
  color: var(--text-secondary);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  border: 1px solid var(--border);
}

/* Tabs */
.tab-bar {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 2px solid var(--border);
}

.tab-btn {
  padding: 0.5rem 1.25rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.15s, border-color 0.15s;
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.tab-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

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

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.card-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

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

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: white;
  text-decoration: none;
}

.btn-secondary {
  background: white;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--primary);
  color: white;
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  color: white;
  border-color: rgba(255,255,255,0.6);
}

.btn-outline:hover:not(:disabled) {
  background: rgba(255,255,255,0.15);
  text-decoration: none;
}

.btn-danger {
  background: var(--error);
  color: white;
  border-color: var(--error);
}

.btn-danger:hover:not(:disabled) {
  background: #a93226;
  border-color: #a93226;
  text-decoration: none;
}

.btn-success {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

.btn-success:hover:not(:disabled) {
  background: #229954;
  text-decoration: none;
}

.btn-warning {
  background: var(--warning);
  color: white;
  border-color: var(--warning);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
}

.btn-lg {
  padding: 0.85rem 2rem;
  font-size: 1.1rem;
  border-radius: var(--radius);
}

.btn-icon {
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
}

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

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

.form-control {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  color: var(--text);
  background: white;
  transition: border-color 0.15s, box-shadow 0.15s;
  line-height: 1.5;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(46,125,94,0.12);
}

.form-control.error {
  border-color: var(--error);
}

.form-error {
  font-size: 0.8rem;
  color: var(--error);
  margin-top: 0.3rem;
}

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

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

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

.form-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

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

.checkbox-group input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary);
  cursor: pointer;
}

.checkbox-group label {
  cursor: pointer;
  font-size: 0.9rem;
}

/* ============================================================
   Alert / Messages
   ============================================================ */
.alert {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.alert-error {
  background: var(--error-light);
  border: 1px solid #f1948a;
  color: #922b21;
}

.alert-success {
  background: var(--success-light);
  border: 1px solid #82e0aa;
  color: #1e8449;
}

.alert-warning {
  background: var(--warning-light);
  border: 1px solid #f9e27a;
  color: #9a7d0a;
}

.alert-info {
  background: #ebf5fb;
  border: 1px solid #85c1e9;
  color: #1a5276;
}

/* ============================================================
   Tables
   ============================================================ */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead {
  background: #f8f9fb;
}

thead th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

tbody tr:last-child {
  border-bottom: none;
}

tbody tr:hover {
  background: #f8fafb;
}

tbody td {
  padding: 0.75rem 1rem;
  color: var(--text);
  vertical-align: middle;
}

tfoot tr {
  background: #f0f4f8;
  border-top: 2px solid var(--border);
}

tfoot td {
  padding: 0.75rem 1rem;
  font-weight: 700;
  color: var(--text);
}

.table-actions {
  display: flex;
  gap: 0.4rem;
  justify-content: flex-end;
}

/* ============================================================
   Status Badges
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-green, .badge-approved, .badge-active {
  background: #d5f5e3;
  color: #1e8449;
}

.badge-amber, .badge-pending {
  background: #fef9e7;
  color: #9a7d0a;
  border: 1px solid #f9e27a;
}

.badge-red, .badge-rejected, .badge-inactive {
  background: #fdedec;
  color: #922b21;
}

.badge-blue {
  background: #ebf5fb;
  color: #1a5276;
}

.badge-gray {
  background: #f2f3f4;
  color: #626567;
}

/* ============================================================
   Modal
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: white;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
  animation: slideIn 0.2s ease;
}

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

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

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

.modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text-secondary);
  line-height: 1;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  transition: color 0.1s;
}

.modal-close:hover {
  color: var(--text);
  background: var(--bg);
}

.modal-body {
  padding: 1.5rem;
}

/* ============================================================
   Login Page
   ============================================================ */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--nav-height));
  padding: 2rem 1rem;
}

.login-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
}

.login-logo {
  text-align: center;
  margin-bottom: 1.5rem;
}

.login-logo-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 0.5rem;
}

.login-logo h1 {
  font-size: 1.5rem;
  color: var(--primary);
}

.login-logo p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ============================================================
   Dashboard
   ============================================================ */
.page-header {
  margin-bottom: 1.75rem;
}

.page-header h1 {
  font-size: 1.6rem;
  color: var(--text);
}

.page-header p {
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

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

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
}

.stat-card.accent {
  border-left-color: var(--accent);
}

.stat-card.error {
  border-left-color: var(--error);
}

.stat-card.success {
  border-left-color: var(--success);
}

.stat-label {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.stat-sub {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* Clock In/Out Button */
.clock-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  text-align: center;
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.clock-section h2 {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 1rem;
}

.clock-time {
  font-size: 3rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.5rem;
}

.clock-date {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.clock-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  padding: 0.4rem 1rem;
  border-radius: 999px;
}

.clock-status.active {
  background: var(--success-light);
  color: var(--success);
}

.clock-status.inactive {
  background: #f2f3f4;
  color: var(--text-secondary);
}

.clock-status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.clock-status.active .dot {
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.btn-clock {
  font-size: 1.1rem;
  padding: 0.85rem 2.5rem;
  border-radius: var(--radius);
  font-weight: 700;
}

.btn-clock-in {
  background: var(--primary);
  color: white;
  border: 2px solid var(--primary);
}

.btn-clock-in:hover:not(:disabled) {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: white;
  text-decoration: none;
}

.btn-clock-out {
  background: var(--error);
  color: white;
  border: 2px solid var(--error);
}

.btn-clock-out:hover:not(:disabled) {
  background: #a93226;
  border-color: #a93226;
  color: white;
  text-decoration: none;
}

.clock-duration {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 1rem;
}

/* ============================================================
   Time Page
   ============================================================ */
.month-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.month-selector .form-control {
  width: auto;
}

.hours-worked {
  font-weight: 700;
  color: var(--primary);
}

.hours-overtime-pos {
  color: var(--success);
  font-weight: 600;
}

.hours-overtime-neg {
  color: var(--error);
  font-weight: 600;
}

.entry-form {
  background: #f8fafb;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.entry-form h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--text);
}

/* ============================================================
   Vacation Page
   ============================================================ */
.balance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.balance-item {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.balance-number {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.1;
}

.balance-number.warning {
  color: var(--warning);
}

.balance-number.error {
  color: var(--error);
}

.balance-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
  font-weight: 500;
}

/* ============================================================
   Users Page
   ============================================================ */
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.user-name-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ============================================================
   Section Headers
   ============================================================ */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.section-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* ============================================================
   Empty State
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state p {
  font-size: 0.95rem;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
  :root {
    --nav-height: 56px;
  }

  .navbar {
    padding: 0 1rem;
    flex-wrap: wrap;
    height: auto;
    min-height: var(--nav-height);
  }

  .nav-toggle {
    display: block;
  }

  .nav-links {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    padding: 0.5rem 0;
    display: none;
    gap: 0.1rem;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-link {
    padding: 0.65rem 0.75rem;
  }

  .nav-user {
    margin-left: 0;
    padding: 0.5rem 0;
    border-top: 1px solid rgba(255,255,255,0.2);
    width: 100%;
    justify-content: space-between;
  }

  #app {
    padding: 1rem;
  }

  .form-row, .form-row-3 {
    grid-template-columns: 1fr;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .clock-time {
    font-size: 2rem;
  }

  .modal {
    max-height: 95vh;
  }

  .table-wrapper {
    font-size: 0.82rem;
  }

  thead th, tbody td, tfoot td {
    padding: 0.6rem 0.75rem;
  }

  .balance-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .form-actions {
    flex-direction: column-reverse;
  }

  .form-actions .btn {
    width: 100%;
  }
}

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

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

  .table-actions {
    flex-direction: column;
  }
}

/* ============================================================
   Custom DatePicker
   ============================================================ */

.dp-trigger {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  min-height: 38px;
}

.dp-trigger.dp-placeholder {
  color: var(--text-secondary);
}

.dp-popup {
  display: none;
  position: absolute;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  width: 300px;
  z-index: 999;
  padding: 0.75rem;
}

.dp-popup.dp-open {
  display: block;
}

.dp-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.dp-month-label {
  font-weight: 600;
  font-size: 0.95rem;
}

.dp-nav-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.dp-nav-btn:hover {
  background: var(--bg);
  color: var(--text);
}

.dp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.dp-header-cell {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 4px 0;
}

.dp-header-cell.dp-weekend {
  color: #aaa;
}

.dp-cell {
  position: relative;
  text-align: center;
  padding: 5px 2px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.82rem;
  min-height: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: background 0.1s;
}

.dp-cell:not(.dp-empty):hover {
  background: var(--bg);
}

.dp-cell.dp-empty {
  cursor: default;
}

.dp-day-num {
  line-height: 1;
}

.dp-cell.dp-weekend .dp-day-num {
  color: #aaa;
}

.dp-cell.dp-holiday {
  background: #fff8e6;
}

.dp-cell.dp-holiday .dp-day-num {
  color: var(--accent-dark);
  font-weight: 600;
}

.dp-holiday-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 2px;
  display: block;
}

.dp-cell.dp-today .dp-day-num {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.dp-cell.dp-selected,
.dp-cell.dp-range-start,
.dp-cell.dp-range-end {
  background: var(--primary) !important;
  border-radius: 4px;
}

.dp-cell.dp-selected .dp-day-num,
.dp-cell.dp-range-start .dp-day-num,
.dp-cell.dp-range-end .dp-day-num {
  color: #fff !important;
  font-weight: 600;
}

.dp-cell.dp-selected .dp-holiday-dot,
.dp-cell.dp-range-start .dp-holiday-dot,
.dp-cell.dp-range-end .dp-holiday-dot {
  background: rgba(255,255,255,0.7);
}

.dp-cell.dp-in-range {
  background: rgba(46, 125, 94, 0.12);
  border-radius: 0;
}

.dp-cell.dp-in-range .dp-day-num {
  color: var(--primary-dark);
}

.dp-cell.dp-range-start {
  border-radius: 4px 0 0 4px;
}

.dp-cell.dp-range-end {
  border-radius: 0 4px 4px 0;
}

.dp-legend {
  display: flex;
  gap: 1rem;
  margin-top: 0.6rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.dp-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.dp-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
  flex-shrink: 0;
}

.dp-legend-holiday {
  background: #fff8e6;
  border: 1px solid var(--accent);
}

.dp-legend-weekend {
  background: var(--bg);
  border: 1px solid #ccc;
}

/* ============================================================
   Print styles
   ============================================================ */
@media print {
  .navbar, .btn, .form-actions, .table-actions {
    display: none !important;
  }

  #app {
    margin-top: 0;
    padding: 0;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}
