/* ====================================
   BASKAL'S GARAGE - STYLES
   ==================================== */

/* CSS Variables */
:root {
  --primary: #165bb6;
  --primary-light: #1a6bcf;
  --accent: #165bb6;
  --accent-hover: #124a95;
  --success: #27ae60;
  --success-hover: #229954;
  --warning: #f39c12;
  --warning-hover: #e67e22;
  --danger: #e74c3c;
  --danger-hover: #c0392b;
  --secondary: #95a5a6;
  --secondary-hover: #7f8c8d;
  --admin-primary: #165bb6;
  --admin-primary-hover: #124a95;
  --bg-light: #f5f5f5;
  --bg-white: #ffffff;
  --border: #ecf0f1;
  --text: #2c3e50;
  --text-muted: #7f8c8d;
  --shadow: rgba(0, 0, 0, 0.1);
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

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

body {
  font-family: var(--font-family);
  background: var(--bg-light);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

/* Header */
.header {
  background: var(--primary);
  color: white;
  padding: 10px 20px;
  box-shadow: 0 2px 4px var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header.admin {
  background: var(--admin-primary);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-logo {
  height: 40px;
  width: auto;
}

.header-title {
  font-size: 16px;
  font-weight: 600;
  opacity: 0.9;
}

.header h1 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 4px;
}

.header .user-info {
  font-size: 12px;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 15px;
}

.header .logout-btn {
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: background 0.2s;
}

.header .logout-btn:hover {
  background: rgba(255,255,255,0.3);
}

/* Hamburger Menu Button */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

.hamburger-btn span {
  display: block;
  width: 24px;
  height: 3px;
  background: white;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.hamburger-btn.active span:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}

.mobile-menu-overlay.active {
  display: block;
}

/* Login Logo */
.login-logo {
  width: 200px;
  max-width: 100%;
  height: auto;
  margin-bottom: 20px;
}

.login-box {
  text-align: center;
}

/* Desktop only elements */
.desktop-only {
  display: flex;
}

/* Mobile logout button - hidden on desktop */
.mobile-logout {
  display: none;
}

/* Main Container */
.container {
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 5px;
  margin-bottom: 20px;
  background: var(--bg-white);
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 2px 4px var(--shadow);
  overflow-x: auto;
}

.tab {
  padding: 10px 20px;
  background: var(--bg-light);
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  white-space: nowrap;
  transition: all 0.2s;
  color: var(--text);
}

.tab:hover {
  background: var(--border);
}

.tab.active {
  background: var(--accent);
  color: white;
}

.admin .tab.active {
  background: var(--admin-primary);
}

/* Tab Content */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Cards & Sections */
.card {
  background: var(--bg-white);
  border-radius: 8px;
  box-shadow: 0 2px 4px var(--shadow);
  margin-bottom: 20px;
}

.card-header {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

.card-body {
  padding: 20px;
}

/* Search Bar */
.search-bar {
  background: var(--bg-white);
  padding: 15px;
  margin-bottom: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 4px var(--shadow);
}

.search-input {
  width: 100%;
  padding: 12px 15px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Action Bar */
.action-bar {
  background: var(--bg-white);
  padding: 15px;
  margin-bottom: 15px;
  border-radius: 8px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  box-shadow: 0 2px 4px var(--shadow);
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

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

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

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

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

.btn-success:hover:not(:disabled) {
  background: var(--success-hover);
}

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

.btn-warning:hover:not(:disabled) {
  background: var(--warning-hover);
}

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

.btn-danger:hover:not(:disabled) {
  background: var(--danger-hover);
}

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

.btn-secondary:hover:not(:disabled) {
  background: var(--secondary-hover);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* Tables */
.table-container {
  background: var(--bg-white);
  border-radius: 8px;
  overflow-x: auto;
  box-shadow: 0 2px 4px var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: #f8f9fa;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 10;
}

tr:hover {
  background: #f8f9fa;
}

tr.clickable {
  cursor: pointer;
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  background: var(--bg-light);
  color: var(--text);
}

.status-open {
  background: #d4edda;
  color: #155724;
}

.status-closed {
  background: #d1ecf1;
  color: #0c5460;
}

.status-pending {
  background: #fff3cd;
  color: #856404;
}

.status-paid, .status-completed {
  background: #d4edda;
  color: #155724;
}

.status-in-progress, .status-partially_paid {
  background: #fff3cd;
  color: #856404;
}

/* Forms */
.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  font-size: 13px;
  color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group textarea {
  min-height: 80px;
  resize: vertical;
}

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

@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  overflow-y: auto;
}

.modal.active {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: var(--bg-white);
  padding: 0;
  border-radius: 12px;
  max-width: 700px;
  width: 100%;
  margin: 20px auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-white);
  z-index: 10;
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 15px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.close-btn {
  font-size: 28px;
  font-weight: bold;
  color: var(--secondary);
  cursor: pointer;
  background: none;
  border: none;
  line-height: 1;
  padding: 0;
  width: 30px;
  height: 30px;
}

.close-btn:hover {
  color: var(--danger);
}

/* Messages */
.error-message {
  background: #f8d7da;
  color: #721c24;
  padding: 12px 15px;
  border-radius: 6px;
  margin-bottom: 15px;
  border: 1px solid #f5c6cb;
}

.success-message {
  background: #d4edda;
  color: #155724;
  padding: 12px 15px;
  border-radius: 6px;
  margin-bottom: 15px;
  border: 1px solid #c3e6cb;
}

/* Loading */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

.spinner {
  border: 3px solid #f3f3f3;
  border-top: 3px solid var(--accent);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}

.admin .spinner {
  border-top-color: var(--admin-primary);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 15px;
}

/* Detail View */
.detail-section {
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.detail-section:last-child {
  border-bottom: none;
}

.detail-section h3 {
  font-size: 16px;
  margin-bottom: 15px;
  color: var(--primary);
}

.detail-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  padding: 8px 0;
  border-bottom: 1px solid #f8f9fa;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  font-weight: 500;
  color: var(--text-muted);
}

/* Line Items */
.line-item-row {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 6px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
}

.line-item-row:hover {
  border-color: var(--accent);
}

/* Dropdown */
.dropdown-container {
  position: relative;
}

.dropdown-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 6px 6px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 4px 6px var(--shadow);
}

.dropdown-item {
  padding: 10px 15px;
  cursor: pointer;
  border-bottom: 1px solid #f8f9fa;
}

.dropdown-item:hover {
  background: #f8f9fa;
}

.dropdown-item:last-child {
  border-bottom: none;
}

/* Login Page */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}

.login-box {
  background: var(--bg-white);
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  max-width: 400px;
  width: 100%;
}

.login-box h1 {
  text-align: center;
  margin-bottom: 10px;
  color: var(--primary);
}

.login-box .subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 30px;
}

.login-box .btn {
  width: 100%;
  justify-content: center;
  padding: 12px;
}

/* Utilities */
.text-right {
  text-align: right;
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--text-muted);
}

.mt-1 { margin-top: 5px; }
.mt-2 { margin-top: 10px; }
.mt-3 { margin-top: 15px; }
.mt-4 { margin-top: 20px; }

.mb-1 { margin-bottom: 5px; }
.mb-2 { margin-bottom: 10px; }
.mb-3 { margin-bottom: 15px; }
.mb-4 { margin-bottom: 20px; }

.flex {
  display: flex;
}

.flex-wrap {
  flex-wrap: wrap;
}

.gap-2 {
  gap: 10px;
}

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

.justify-between {
  justify-content: space-between;
}

.justify-end {
  justify-content: flex-end;
}

/* Print Styles */
@media print {
  .header, .tabs, .action-bar, .search-bar, .modal {
    display: none !important;
  }
  
  body {
    background: white;
  }
  
  .container {
    padding: 0;
  }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .header h1 {
    font-size: 18px;
  }
  
  .container {
    padding: 10px;
  }
  
  th, td {
    font-size: 12px;
    padding: 8px 10px;
  }
  
  .detail-row {
    grid-template-columns: 1fr;
  }
  
  .detail-label {
    margin-bottom: 2px;
  }
  
  .modal-content {
    margin: 10px;
    max-width: none;
  }
}

/* ====================================
   PUNCH CLOCK STYLES
   ==================================== */

.punch-clock-container {
  max-width: 800px;
  margin: 0 auto;
}

.punch-card {
  background: var(--bg-white);
  border-radius: 12px;
  box-shadow: 0 4px 12px var(--shadow);
  margin-bottom: 20px;
  overflow: hidden;
}

.punch-card-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.punch-card-header h3 {
  margin: 0;
  font-size: 18px;
}

.malta-time {
  font-size: 14px;
  opacity: 0.9;
  font-family: monospace;
}

.punch-status {
  padding: 25px;
}

.punch-status-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.punch-status-item {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  text-align: center;
}

.punch-status-item.active {
  background: #d4edda;
  border: 2px solid var(--success);
}

.punch-status-item.on-break {
  background: #fff3cd;
  border: 2px solid var(--warning);
}

.punch-status-item .label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 5px;
}

.punch-status-item .value {
  font-size: 20px;
  font-weight: 600;
  font-family: monospace;
}

.punch-current-state {
  text-align: center;
  padding: 20px 0;
  margin-top: 15px;
  border-top: 1px solid var(--border);
}

.punch-current-state .state-badge {
  display: inline-block;
  padding: 10px 25px;
  border-radius: 25px;
  font-weight: 600;
  font-size: 16px;
}

.state-not-clocked {
  background: #e9ecef;
  color: var(--text-muted);
}

.state-working {
  background: #d4edda;
  color: #155724;
}

.state-on-break {
  background: #fff3cd;
  color: #856404;
}

.state-clocked-out {
  background: #d1ecf1;
  color: #0c5460;
}

.punch-buttons {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 20px;
}

.punch-btn {
  padding: 15px 30px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
  min-width: 150px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.punch-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.punch-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.punch-btn-in {
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  color: white;
}

.punch-btn-break {
  background: linear-gradient(135deg, #f39c12, #f1c40f);
  color: white;
}

.punch-btn-resume {
  background: linear-gradient(135deg, #3498db, #5dade2);
  color: white;
}

.punch-btn-out {
  background: linear-gradient(135deg, #e74c3c, #ec7063);
  color: white;
}

.location-status {
  background: #f8f9fa;
  padding: 12px 20px;
  border-radius: 8px;
  text-align: center;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.location-status.valid {
  background: #d4edda;
  color: #155724;
}

.location-status.invalid {
  background: #f8d7da;
  color: #721c24;
}

.location-status.checking {
  background: #fff3cd;
  color: #856404;
}

.punch-history {
  background: var(--bg-white);
  border-radius: 12px;
  box-shadow: 0 4px 12px var(--shadow);
  overflow: hidden;
}

.history-header {
  padding: 20px;
  background: #f8f9fa;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.history-header h3 {
  margin: 0;
}

.history-filters {
  display: flex;
  gap: 10px;
}

.history-filters select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  background: white;
}

.history-month {
  border-bottom: 1px solid var(--border);
}

.history-month:last-child {
  border-bottom: none;
}

.history-month-header {
  background: linear-gradient(135deg, var(--accent), #5dade2);
  color: white;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.history-month-header:hover {
  filter: brightness(1.05);
}

.history-month-header h4 {
  margin: 0;
  font-size: 16px;
}

.history-month-summary {
  display: flex;
  gap: 20px;
  font-size: 14px;
}

.history-entries {
  padding: 0;
}

.history-entry {
  display: grid;
  grid-template-columns: 120px 1fr 1fr 1fr 1fr 100px;
  gap: 10px;
  padding: 15px 20px;
  border-bottom: 1px solid #f0f0f0;
  align-items: center;
}

.history-entry:last-child {
  border-bottom: none;
}

.history-entry:hover {
  background: #f8f9fa;
}

.history-entry .date {
  font-weight: 500;
}

.history-entry .time {
  font-family: monospace;
  font-size: 14px;
}

.history-entry .duration {
  font-weight: 600;
  color: var(--success);
}

.history-entry-header {
  background: #f8f9fa;
  font-weight: 600;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
}

@media (max-width: 768px) {
  /* Show hamburger, hide desktop user info */
  .hamburger-btn {
    display: flex;
  }
  
  .desktop-only {
    display: none !important;
  }
  
  /* Mobile Tabs - slide-in menu */
  .tabs {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100vh;
    flex-direction: column;
    background: white;
    padding: 70px 0 20px 0;
    margin: 0;
    border-radius: 0;
    box-shadow: -2px 0 10px rgba(0,0,0,0.2);
    z-index: 100;
    transition: right 0.3s ease;
    overflow-y: auto;
  }
  
  .tabs.mobile-open {
    right: 0;
  }
  
  .tabs .tab {
    width: 100%;
    text-align: left;
    padding: 15px 20px;
    border-radius: 0;
    border-bottom: 1px solid var(--border);
    font-size: 15px;
  }
  
  .tabs .tab.active {
    border-left: 4px solid var(--accent);
  }
  
  .admin .tabs .tab.active {
    border-left-color: var(--admin-primary);
  }
  
  /* Mobile user info in menu */
  .tabs::before {
    content: attr(data-user);
    display: block;
    padding: 15px 20px;
    font-size: 12px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    margin-bottom: 10px;
  }
  
  /* Mobile logout button in menu */
  .mobile-logout {
    display: block !important;
    width: calc(100% - 40px);
    margin: 20px;
    padding: 12px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    text-align: center;
  }
  
  .punch-status-grid {
    grid-template-columns: 1fr;
  }
  
  .punch-buttons {
    flex-direction: column;
  }
  
  .punch-btn {
    width: 100%;
  }
  
  /* Mobile History Entries - Card Style with Labels */
  .history-entry {
    display: block;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 8px;
  }
  
  .history-entry-header {
    display: none;
  }
  
  .history-entry > div {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid var(--border);
  }
  
  .history-entry > div:last-child {
    border-bottom: none;
  }
  
  .history-entry > div::before {
    content: attr(data-label);
    font-weight: 500;
    color: var(--text-muted);
    font-size: 12px;
  }
  
  .history-entry .date {
    font-size: 14px;
    font-weight: bold;
    background: var(--accent);
    color: white;
    padding: 6px 10px;
    border-radius: 5px;
    margin-bottom: 8px;
  }
  
  .history-entry .date::before {
    display: none;
  }
  
  .history-filters {
    width: 100%;
    flex-wrap: wrap;
  }
  
  .history-filters select {
    flex: 1;
    min-width: 100px;
  }
  
  /* Mobile Tabs */
  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 5px;
    gap: 3px;
  }
  
  .tab {
    padding: 8px 12px;
    font-size: 12px;
    flex-shrink: 0;
  }
  
  /* Mobile Header */
  .header {
    padding: 10px 15px;
  }
  
  .header h1 {
    font-size: 16px;
  }
  
  .header .user-info {
    flex-wrap: wrap;
    gap: 8px;
    font-size: 11px;
  }
  
  /* Mobile Action Bar */
  .action-bar {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }
  
  .action-bar .btn {
    width: 100%;
    justify-content: center;
  }
  
  .action-bar .history-filters {
    order: -1;
  }
  
  /* Mobile Container */
  .container {
    padding: 10px;
  }
  
  /* Mobile Cards */
  .card {
    padding: 15px;
  }
  
  /* Mobile Modals */
  .modal.active {
    padding: 10px;
  }
  
  .modal-content {
    margin: 10px auto;
    max-height: 95vh;
  }
  
  .modal-header {
    padding: 15px;
  }
  
  .modal-body {
    padding: 15px;
  }
  
  /* Mobile Worker Section */
  .worker-time-header {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }
  
  .worker-time-summary {
    flex-wrap: wrap;
    gap: 10px;
  }
  
  /* Mobile Payroll Cards */
  .payroll-card {
    padding: 15px;
  }
  
  .payroll-stats {
    grid-template-columns: 1fr 1fr;
  }
  
  /* Mobile Tables */
  table {
    font-size: 12px;
  }
  
  th, td {
    padding: 6px 8px;
  }
  
  .data-list {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Pagination */
.pagination-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 12px;
  background: var(--bg-white);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 2px 4px var(--shadow);
  flex-wrap: wrap;
}

.pagination-bar:empty { display: none; }

.pagination-bar button {
  padding: 6px 12px;
  border: 1px solid var(--border);
  background: var(--bg-white);
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  min-width: 36px;
}

.pagination-bar button:hover { background: var(--bg-light); }
.pagination-bar button.active { background: var(--primary); color: white; border-color: var(--primary); }
.pagination-bar button:disabled { opacity: 0.4; cursor: default; }
.pagination-bar .page-info { font-size: 13px; color: var(--text-muted); padding: 0 8px; }

/* Financial bar chart */
.fin-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.fin-bar-label { flex: 0 0 160px; font-size: 13px; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fin-bar-track { flex: 1; height: 22px; background: var(--bg-light); border-radius: 4px; overflow: hidden; }
.fin-bar-fill { height: 100%; border-radius: 4px; min-width: 2px; transition: width 0.3s; }
.fin-bar-value { flex: 0 0 90px; font-size: 13px; font-weight: 600; }

@media (max-width: 480px) {
  .fin-bar-label { flex: 0 0 100px; font-size: 11px; }
  .fin-bar-value { flex: 0 0 70px; font-size: 11px; }
}

/* Extra small screens */
@media (max-width: 480px) {
  .tabs {
    gap: 2px;
  }
  
  .tab {
    padding: 6px 10px;
    font-size: 11px;
  }
  
  .header h1 {
    font-size: 14px;
  }
  
  .btn {
    padding: 8px 12px;
    font-size: 12px;
  }
  
  .btn-sm {
    padding: 4px 8px;
    font-size: 11px;
  }
}

/* Admin Punch Clock View */
.worker-time-section {
  margin-bottom: 30px;
}

.worker-time-header {
  background: var(--admin-primary);
  color: white;
  padding: 15px 20px;
  border-radius: 8px 8px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.worker-time-header h4 {
  margin: 0;
}

.worker-time-summary {
  display: flex;
  gap: 15px;
  font-size: 14px;
}

.worker-time-content {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 8px 8px;
}
