/* style.css - simple clean gradient theme */
:root{
  --bg:#f6f8fb;
  --card:#ffffff;
  --accent1: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
  --muted:#6b7280;
  --success:#16a34a;
}
*{box-sizing:border-box;font-family:Inter, system-ui, Arial, sans-serif}
body{margin:0;background:var(--bg);color:#111}
.container{max-width:1600px !important;margin:18px auto;padding:12px;width:100%}
.topbar{background:var(--accent1);color:#fff;padding:16px;border-radius:8px;box-shadow:0 6px 18px rgba(37,117,252,0.12)}
.topbar-container{display:flex;align-items:center;gap:2rem;max-width:1600px !important;margin:0 auto}
.topbar-content{flex:1;min-width:0}
.topbar h1{margin:0 0 8px 0;font-size:20px}
.controls{display:flex;justify-content:space-between;align-items:center;gap:1rem;margin-top:8px}
.controls-left{display:flex;align-items:center;gap:0.5rem;flex-wrap:wrap}
.user-info{position:relative;display:flex;align-items:center;gap:0.75rem;flex-shrink:0}
.user-name{
  white-space:nowrap;
  background: linear-gradient(135deg, rgba(255,255,255,0.25), rgba(255,255,255,0.15));
  padding: 8px 16px;
  border-radius: 20px;
  /* backdrop-filter: blur(10px); */
  border: 1px solid rgba(255,255,255,0.3);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
}
.user-name:hover {
  background: linear-gradient(135deg, rgba(255,255,255,0.35), rgba(255,255,255,0.25));
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

/* Logo */
.logo {
  flex-shrink: 0;
}
.logo-container {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.15);
  padding: 12px 20px;
  border-radius: 12px;
  /* backdrop-filter: blur(10px); */
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
}

.logo-container:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.logo-icon {
  font-size: 2rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  color: #ffffff;
}

.btn{display:inline-block;padding:6px 10px;border-radius:6px;background:linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);color:#fff;text-decoration:none;margin-right:8px;border:none;cursor:pointer;}
.btn-ghost{background:linear-gradient(135deg, #f3f6ff 0%, #e0eefd 100%);color:#333;border:1px solid #ddd;}
.muted{color:rgba(255,255,255,0.85);margin-left:12px}

/* calendar grid */
.calendar-grid{display:grid;grid-template-columns:200px repeat(7,1fr);gap:6px;margin-top:16px}
.col.header-col{background:linear-gradient(90deg, #fff, #f3f6ff);padding:10px;border-radius:8px;font-weight:600;text-align:center}
.col.header-col.weekend-header{background:linear-gradient(90deg, #dcfce7, #f0fdf4);border:2px solid #86efac}
.row.emp-name{background:transparent;padding:10px;font-weight:600;align-self:center}
.cell{background:#fff;border-radius:8px;padding:6px;min-height:64px;display:flex;align-items:center;justify-content:center;border:1px solid rgba(0,0,0,0.04)}
.weekend-cell{font-size:0.9rem}
.shift{width:100%;padding:6px;border-radius:6px;cursor:grab;box-shadow:0 2px 6px rgba(16,24,40,0.08);transition:all 0.2s ease}
.shift:hover{transform:translateY(-2px);box-shadow:0 4px 12px rgba(16,24,40,0.12)}
.shift-name{font-weight:600;font-size:14px}
.shift-meta{font-size:12px;margin-top:4px}
.empty{color:#c1c7d0}

/* modal */
.modal{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,0.5);z-index:9999;/* backdrop-filter:blur(2px) */}
.hidden{display:none}
.modal-content{background:#fff;border-radius:12px;min-width:320px;max-width:500px;box-shadow:0 20px 60px rgba(0,0,0,0.3)}

/* Modal Shift Styling */
.modal-shift{width:90%;max-width:480px}
.modal-header{display:flex;justify-content:space-between;align-items:center;padding:1.5rem 1.5rem 1rem;border-bottom:2px solid #e5e7eb;background:linear-gradient(135deg, #667eea 0%, #764ba2 100%);border-radius:12px 12px 0 0;color:white}
.modal-header h4{margin:0;font-size:1.4rem;font-weight:700;color:white}
.modal-close{background:rgba(255,255,255,0.2);border:none;color:white;font-size:1.8rem;cursor:pointer;width:32px;height:32px;display:flex;align-items:center;justify-content:center;border-radius:6px;transition:all 0.3s;padding:0;line-height:1}
.modal-close:hover{background:rgba(255,255,255,0.3);transform:rotate(90deg)}
.modal-employee-info{margin:0;padding:1rem 1.5rem;background:linear-gradient(135deg, #f0f4ff, #ffffff);border-bottom:1px solid #e5e7eb;color:#4f46e5;font-weight:600;font-size:1.05rem}
.shift-form{padding:1.5rem}
.form-group{margin-bottom:1.5rem}
.form-label{display:flex;align-items:center;gap:0.5rem;font-weight:600;color:#374151;margin-bottom:0.5rem;font-size:0.95rem}
.label-icon{font-size:1.2rem}
.required{color:#ef4444;font-weight:700}
.form-input{width:100%;padding:0.75rem 1rem;border:2px solid #e5e7eb;border-radius:8px;font-size:1rem;transition:all 0.3s;background:#f9fafb;box-sizing:border-box;font-family:inherit}
.form-input:focus{outline:none;border-color:#667eea;background:#ffffff;box-shadow:0 0 0 4px rgba(102,126,234,0.1)}
.form-input::placeholder{color:#9ca3af}
.form-hint{display:block;margin-top:0.4rem;font-size:0.85rem;color:#6b7280;font-style:italic}
.modal-actions{display:flex;gap:0.75rem;justify-content:flex-end;margin-top:2rem;padding-top:1.5rem;border-top:2px solid #e5e7eb}
.modal-actions button{display:flex;align-items:center;gap:0.5rem;padding:0.75rem 1.5rem;font-size:1rem;font-weight:600;border-radius:8px;cursor:pointer;transition:all 0.3s;border:none}
.btn-primary{background:linear-gradient(135deg, #667eea 0%, #764ba2 100%);color:white;box-shadow:0 4px 12px rgba(102,126,234,0.4)}
.btn-primary:hover{transform:translateY(-2px);box-shadow:0 6px 20px rgba(102,126,234,0.5)}
.btn-ghost{background:#f3f4f6;color:#6b7280}
.btn-ghost:hover{background:#e5e7eb;color:#374151}
.btn.btn-delete{background:linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;color:#fff !important;border:1px solid #dc2626 !important;}
.btn.btn-delete:hover{background:linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;transform:translateY(-1px);box-shadow:0 4px 12px rgba(239,68,68,0.4)}
.btn-success{background:linear-gradient(135deg, #10b981 0%, #059669 100%) !important;color:#fff !important;border:1px solid #059669 !important;}
.btn-success:hover{background:linear-gradient(135deg, #059669 0%, #047857 100%) !important;transform:translateY(-1px);box-shadow:0 4px 12px rgba(16,185,129,0.4)}
.btn-info{background:linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;color:#fff !important;border:1px solid #2563eb !important;}
.btn-info:hover{background:linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;transform:translateY(-1px);box-shadow:0 4px 12px rgba(59,130,246,0.4)}
.btn-edit{background:linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;color:#fff !important;border:1px solid #2563eb !important;}
.btn-edit:hover{background:linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;transform:translateY(-1px);box-shadow:0 4px 12px rgba(59,130,246,0.4)}
.btn-edit-holiday{background:linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;color:#fff !important;border:1px solid #2563eb !important;padding:0.5rem 1rem;border-radius:6px;cursor:pointer;font-size:0.9rem;}
.btn-edit-holiday:hover{background:linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;transform:translateY(-1px);box-shadow:0 4px 12px rgba(59,130,246,0.4)}
.btn.btn-sm.btn-delete{background:linear-gradient(135deg,#ef4444 0%,#dc2626 100%) !important;color:#fff !important;border:1px solid #dc2626 !important;padding:0.25rem 0.5rem;font-size:0.8rem;text-decoration:none;display:inline-flex;align-items:center;gap:0.25rem;}
.btn-delete-holiday{background:linear-gradient(135deg,#ef4444 0%,#dc2626 100%) !important;color:#fff !important;border:1px solid #dc2626 !important;padding:0.5rem 1rem;border-radius:6px;cursor:pointer;font-size:0.9rem;}
.btn-delete-holiday:hover{background:linear-gradient(135deg,#dc2626 0%,#b91c1c 100%) !important;transform:translateY(-1px);box-shadow:0 4px 12px rgba(239,68,68,0.4)}
.btn-remove{background:linear-gradient(135deg,#ef4444 0%,#dc2626 100%) !important;color:#fff !important;border:1px solid #dc2626 !important;padding:0.25rem 0.5rem;border-radius:50%;cursor:pointer;font-size:0.8rem;width:24px;height:24px;display:flex;align-items:center;justify-content:center;}
.btn-remove:hover{background:linear-gradient(135deg,#dc2626 0%,#b91c1c 100%) !important;transform:scale(1.1);box-shadow:0 2px 8px rgba(239,68,68,0.4)}


/* stats */
.stats{margin-top:18px;background:#fff;padding:20px;border-radius:12px;box-shadow:0 4px 12px rgba(0,0,0,0.08)}
.stats-header{margin-bottom:16px}
.stats h3{margin:0 0 8px 0;color:#1e293b;font-size:1.3rem}
.work-hours-display{display:flex;align-items:center;gap:8px;padding:8px 16px;background:linear-gradient(135deg,#fff7ed,#ffffff);border:2px solid #fed7aa;border-radius:8px;margin-top:8px;width:fit-content}
.work-hours-icon{font-size:1.2rem}
.work-hours-text{font-weight:600;color:#9a3412;font-size:0.95rem;font-family:monospace}
.today-shifts{margin-top:12px}
.no-shifts{text-align:center;padding:40px 20px;color:#6b7280}
.no-shifts p{margin:10px 0 0 0;font-size:1.1rem}
.today-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:16px}
.today-card{padding:20px;border-radius:12px;box-shadow:0 2px 8px rgba(0,0,0,0.06);transition:all 0.3s ease}
.today-card:hover{transform:translateY(-4px);box-shadow:0 6px 20px rgba(0,0,0,0.12)}
.today-name{display:flex;align-items:center;gap:10px;font-size:1.2rem;margin-bottom:12px}
.today-name strong{font-weight:700}
.today-info{display:flex;gap:16px;font-size:0.95rem;margin-bottom:8px}
.today-note{font-size:0.9rem;margin-top:8px;padding-top:8px;border-top:1px solid rgba(0,0,0,0.1)}
.today-checkin{margin-top:12px;padding-top:12px;border-top:2px solid rgba(0,0,0,0.08);font-size:0.9rem}
.checkin-row{display:flex;align-items:center;gap:8px;padding:6px 0}
.checkin-icon{font-size:1.1rem}
.checkin-label{flex:1;font-weight:600}
.checkin-time{font-family:monospace;font-weight:700;background:rgba(255,255,255,0.7);padding:2px 8px;border-radius:4px}
.checkin-row.total-hours{background:rgba(255,255,255,0.5);margin-top:4px;padding:8px;border-radius:6px;font-weight:700}
.checkin-row.pending{font-style:italic;opacity:0.7}
.checkin-row.address{font-size:0.85rem;opacity:0.8;flex-wrap:wrap}
.checkin-row.address small{flex:1;margin-left:28px}
#statsResult table{width:100%;border-collapse:collapse}
#statsResult td,#statsResult th{padding:6px;border-bottom:1px solid #eee}

.menu-btn { 
  background: linear-gradient(135deg,#6a11cb 0%,#2575fc 100%);
  border: none; 
  color: #fff; 
  font-size: 24px; 
  cursor: pointer; 
  margin-left: 10px;
  padding: 8px 14px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  transition: all 0.3s ease;
  font-weight: 600;
}
.menu-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}
.menu-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}
.menu { 
  position: absolute; 
  top: calc(100% + 8px); 
  right: 0; 
  background: #fff; 
  border: none;
  border-radius: 12px; 
  box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.08); 
  z-index: 1000; 
  min-width: 240px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 8px;
  animation: menuSlideIn 0.2s ease-out;
}
@keyframes menuSlideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.menu a { 
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px; 
  color: #1e293b; 
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.2s ease;
  border-radius: 8px;
  margin-bottom: 2px;
}
.menu a:hover { 
  background: linear-gradient(135deg, #667eea15, #764ba215); 
  color: #667eea;
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

/* Management tables */
#employeesTable, #usersTable { width: 100%; border-collapse: collapse; margin-top: 20px; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.08); border: 1px solid #e5e7eb; }
#employeesTable thead, #usersTable thead { background: linear-gradient(90deg, #6a11cb, #2575fc); color: #fff; }
#employeesTable th, #usersTable th { padding: 12px; text-align: center; font-weight: 600; border: 1px solid rgba(255,255,255,0.2); }
#employeesTable td, #usersTable td { padding: 12px; text-align: center; border: 1px solid #e5e7eb; }
#employeesTable tbody tr:hover, #usersTable tbody tr:hover { background: #f9fafb; }

/* Left align full name and email columns in users table */
#usersTable td:nth-child(1), /* Full name column */
#usersTable td:nth-child(3) { /* Email column */
  text-align: left;
  padding-left: 16px;
}

/* Report tables */
#weeklyTable, #monthlyTable { width: 100%; border-collapse: collapse; margin-top: 20px; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.08); border: 1px solid #e5e7eb; }
#weeklyTable thead, #monthlyTable thead { background: linear-gradient(90deg, #6a11cb, #2575fc); color: #fff; }
#weeklyTable th, #monthlyTable th { padding: 12px; text-align: center; font-weight: 600; border: 1px solid rgba(255,255,255,0.2); }
#weeklyTable td, #monthlyTable td { padding: 12px; text-align: center; border: 1px solid #e5e7eb; }
#weeklyTable tbody tr:hover, #monthlyTable tbody tr:hover { background: #f9fafb; }

/* Report sections */
.report-section { background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.stat-card { background: linear-gradient(135deg, #f3f6ff 0%, #e0eefd 100%); padding: 20px; border-radius: 8px; border-left: 4px solid #2575fc; }
.stat-label { font-size: 14px; color: #6b7280; margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 700; color: #2575fc; }
/* Holiday cells */
.holiday-cell {
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
  border: 2px solid #fca5a5;
  border-radius: 8px;
  padding: 8px;
  text-align: center;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
}

.holiday-icon {
  font-size: 1.5rem;
  margin-bottom: 4px;
}

.holiday-name {
  font-weight: 700;
  color: #dc2626;
  font-size: 0.9rem;
  line-height: 1.2;
}

.holiday-desc {
  font-size: 0.75rem;
  color: #991b1b;
  opacity: 0.8;
  font-style: italic;
  line-height: 1.2;
  margin-top: 2px;
}

/* ===========================
   RESPONSIVE DESIGN
   =========================== */

/* Tablet landscape and below (1024px) */
@media (max-width: 1024px) {
  .container {
    max-width: 1600px !important;
    width: 100%;
    padding: 10px;
    margin: 10px auto;
  }
  
  .topbar {
    padding: 12px;
  }
  
  .topbar h1 {
    font-size: 18px;
  }
  
  .logo-text {
    font-size: 1.3rem;
  }
  
  .calendar-grid {
    grid-template-columns: 150px repeat(7, 1fr);
    gap: 4px;
  }
  
  .col.header-col {
    padding: 8px 4px;
    font-size: 0.85rem;
  }
  
  .shift-name {
    font-size: 12px;
  }
  
  .shift-meta {
    font-size: 11px;
  }
  
  .today-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
  }
  
  .modal-content {
    min-width: 280px;
    max-width: 90%;
  }
}

/* Tablet portrait (768px) */
@media (max-width: 768px) {
  .topbar {
    border-radius: 0;
    padding: 12px;
  }
  
  .topbar-container {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }
  
  .logo {
    display: flex;
    justify-content: center;
  }
  
  .logo-container {
    padding: 10px 16px;
  }
  
  .logo-text {
    font-size: 1.2rem;
  }
  
  .topbar h1 {
    font-size: 16px;
    margin-bottom: 8px;
    text-align: center;
  }
  
  .controls {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }
  
  .controls-left {
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .user-info {
    justify-content: space-between;
  }
  
  .muted {
    margin-left: 0;
    font-size: 0.9rem;
  }
  
  .btn {
    padding: 8px 12px;
    font-size: 0.9rem;
    margin-bottom: 6px;
    display: inline-block;
  }
  
  /* Calendar - Switch to 2-column layout for mobile */
  .calendar-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  
  .calendar {
    display: none;
  }
  
  .mobile-calendar {
    display: block;
  }
  
  .calendar {
    display: none;
  }
  
  .mobile-calendar {
    display: block;
  }
  
  .col.header-col {
    display: none; /* Hide day headers in mobile */
  }
  
  .row.emp-name {
    background: linear-gradient(135deg, #6a11cb, #2575fc);
    color: white;
    padding: 12px;
    border-radius: 8px;
    margin: 16px 0 12px 0;
    font-size: 1.1rem;
    grid-column: 1 / -1;
  }
  
  .row.emp-name:first-of-type {
    margin-top: 0;
  }
  
  /* Days become vertical list */
  .cell {
    margin-bottom: 8px;
    position: relative;
    display: block;
    grid-column: auto;
  }
  
  .cell::before {
    content: attr(data-day);
    display: block;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 6px;
    font-size: 0.85rem;
  }
  
  .today-grid {
    grid-template-columns: 1fr;
  }
  
  .stats {
    padding: 16px;
  }
  
  .work-hours-display {
    width: 100%;
    justify-content: center;
  }
  
  /* Modal adjustments */
  .modal-shift {
    width: 95%;
    max-width: 100%;
  }
  
  .modal-header {
    padding: 1rem;
  }
  
  .modal-header h4 {
    font-size: 1.2rem;
  }
  
  .shift-form {
    padding: 1rem;
  }
  
  .form-group {
    margin-bottom: 1rem;
  }
  
  .modal-actions {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .modal-actions button {
    width: 100%;
    justify-content: center;
  }
  
  /* Tables */
  #employeesTable, #usersTable, #weeklyTable, #monthlyTable {
    font-size: 0.85rem;
  }
  
  #employeesTable th, #usersTable th, #weeklyTable th, #monthlyTable th,
  #employeesTable td, #usersTable td, #weeklyTable td, #monthlyTable td {
    padding: 8px 4px;
  }
  
  /* Hide less important columns on mobile */
  #weeklyTable td:nth-child(n+5),
  #weeklyTable th:nth-child(n+5),
  #monthlyTable td:nth-child(n+6),
  #monthlyTable th:nth-child(n+6) {
    display: none;
  }
  
  .menu {
    min-width: 200px;
    right: -10px;
  }
  
  .menu a {
    padding: 10px 16px;
    font-size: 0.9rem;
  }
}

/* Mobile (480px) */
@media (max-width: 480px) {
  .container {
    max-width: 1600px !important;
    width: 100%;
    padding: 8px;
    margin: 8px auto;
  }
  
  .logo-container {
    padding: 8px 12px;
    gap: 8px;
  }
  
  .logo-container {
    padding: 8px 12px;
    gap: 8px;
  }
  
  .logo-text {
    font-size: 1rem;
  }
  
  .topbar h1 {
    font-size: 14px;
  }
  
  .btn {
    padding: 6px 10px;
    font-size: 0.85rem;
    margin-right: 4px;
  }
  
  .row.emp-name {
    font-size: 1rem;
    padding: 10px;
  }
  
  .shift {
    padding: 8px;
  }
  
  .shift-name {
    font-size: 13px;
  }
  
  .shift-meta {
    font-size: 11px;
  }
  
  .today-card {
    padding: 14px;
  }
  
  .today-name {
    font-size: 1.05rem;
  }
  
  .today-info {
    flex-direction: column;
    gap: 8px;
  }
  
  .stats h3 {
    font-size: 1.1rem;
  }
  
  .work-hours-text {
    font-size: 0.85rem;
  }
  
  .modal-header h4 {
    font-size: 1.1rem;
  }
  
  .form-label {
    font-size: 0.9rem;
  }
  
  .form-input {
    padding: 0.65rem 0.85rem;
    font-size: 0.95rem;
  }
  
  /* Stack table cells on very small screens */
  #employeesTable, #usersTable {
    font-size: 0.8rem;
  }
  
  #employeesTable td, #usersTable td,
  #employeesTable th, #usersTable th {
    padding: 6px 3px;
  }
  
  /* Make action buttons smaller */
  #employeesTable button, #usersTable button {
    padding: 4px 8px;
    font-size: 0.75rem;
  }
  
  /* Role cell responsive adjustments */
  .role-cell {
    padding: 3px 6px !important;
    font-size: 0.75rem !important;
    gap: 4px !important;
    justify-content: center !important;
  }
  
  /* Adjust left-aligned columns padding on mobile */
  #usersTable td:nth-child(1),
  #usersTable td:nth-child(3) {
    padding-left: 8px !important;
  }
  
  .stat-value {
    font-size: 22px;
  }
  
  .report-section {
    padding: 14px;
  }
}

/* Extra small devices (360px) */
@media (max-width: 360px) {
  .logo-text {
    font-size: 0.9rem;
  }
  
  .topbar h1 {
    font-size: 13px;
  }
  
  .btn {
    padding: 5px 8px;
    font-size: 0.8rem;
  }
  
  .shift-name {
    font-size: 12px;
  }
  
  .shift-meta {
    font-size: 10px;
  }
  
  .menu a {
    padding: 8px 12px;
    font-size: 0.85rem;
  }
  
  .form-input {
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
  }
}

/* Landscape mode fixes */
@media (max-height: 600px) and (orientation: landscape) {
  .modal {
    align-items: flex-start;
    padding-top: 20px;
    overflow-y: auto;
  }
  
  .modal-shift {
    margin: 20px auto;
  }
  
  .menu {
    max-height: 60vh;
  }
}

/* Footer */
/* 1. Đảm bảo html và body không có margin mặc định */
html, body {
  margin: 0;
  padding: 0;
  /* height: 100%; <- Có thể bỏ nếu dùng vh bên dưới */
}

html, body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* 2. Sử dụng min-height: 100vh cho body hoặc container bao ngoài */
body.page-container {
  /*display: flex;*/
  /*flex-direction: column;*/
  min-height: 100vh; /* Sửa thành min-height: 100vh */
  /* overflow-y: scroll; <- Thường giúp thanh cuộn luôn hiện, tránh nhảy layout */
}

main.container {
  flex: 1;
}


.app-footer {
  /* Giữ nguyên các style thiết kế */
  background: var(--accent1);
  color: #fff;
  text-align: center;
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(37, 117, 252, 0.12);
  font-size: 0.9rem;
  /*max-width: 1100px;*/
  width: 100%;
  margin: 0 auto;
}

.app-footer p {
  margin: 0;
  opacity: 0.95;
}

/* Print styles */
@media print {
  .topbar .controls,
  .menu-btn,
  .menu,
  .btn,
  .modal,
  .app-footer {
    display: none !important;
  }
  
  .calendar-grid {
    grid-template-columns: 150px repeat(7, 1fr);
  }
  
  .shift {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

.mobile-calendar {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(240, 240, 255, 0.9));
  border-radius: 15px;
  padding: 2rem;
  margin-top: 2rem;
  margin-bottom: 2rem;
  border: 2px solid rgba(138, 43, 226, 0.2);
  box-shadow: 0 4px 20px rgba(106, 17, 203, 0.15);
}

.mobile-calendar h3 {
  margin: 0 0 1.5rem 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: #6a11cb;
  background: linear-gradient(135deg, #6a11cb, #2575fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.mobile-day {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #f8f9ff, #ffffff);
  border-radius: 10px;
  border: 2px solid #e0e7ff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s;
}

.mobile-day:hover {
  border-color: #a78bfa;
  box-shadow: 0 4px 12px rgba(167, 139, 250, 0.3);
  transform: translateY(-2px);
}

.mobile-day.weekend-day {
  background: linear-gradient(135deg, #fef3c7, #ffffff);
  border-color: #f59e0b;
}

.mobile-day-header {
  font-weight: 600;
  color: #4c1d95;
  font-size: 1rem;
}

.mobile-day-employees {
  font-weight: 500;
  color: #1e293b;
  text-align: right;
  flex: 1;
}

.employee-name {
  display: inline-block;
  padding: 4px 8px;
  margin: 2px 4px 2px 0;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-left: 4px solid transparent;
}

.employee-name:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

@media (min-width: 769px) {
  .mobile-calendar {
    display: none;
  }
  
  .calendar {
    display: block;
  }
}

/* Responsive calendar grid for mobile */
@media (max-width: 768px) {
  .calendar-grid {
    grid-template-columns: 100px repeat(7, 1fr) !important;
    gap: 3px !important;
    font-size: 0.8rem;
  }
  
  .col.header-col {
    padding: 4px 2px !important;
    font-size: 0.7rem !important;
    word-break: break-word;
    line-height: 1.1;
  }
  
  .row.emp-name {
    padding: 4px 2px !important;
    font-size: 0.7rem !important;
    word-break: break-word;
    line-height: 1.1;
    text-align: center;
    writing-mode: horizontal-tb;
    white-space: normal;
    max-height: none;
  }
  
  .cell {
    min-height: 45px !important;
    padding: 3px !important;
  }
  
  .shift {
    padding: 3px !important;
    font-size: 0.7rem !important;
    min-height: 35px;
  }
  
  .shift-name {
    font-size: 11px !important;
    line-height: 1.2;
  }
  
  .shift-meta {
    font-size: 9px !important;
    margin-top: 1px !important;
    line-height: 1.1;
  }
  
  .shift-location {
    font-size: 0.65rem !important;
    margin-top: 1px !important;
    line-height: 1.1;
  }
  
  .empty {
    font-size: 0.8rem;
  }
}

/* Role cell styling for users table */
.role-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 16px;
  font-size: 0.85rem;
  text-transform: capitalize;
  white-space: nowrap;
  text-align: center;
}

.role-cell[data-role="admin"] {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 179, 71, 0.2));
  color: #8b4513;
  border: 1px solid rgba(255, 179, 71, 0.3);
}

.role-cell[data-role="editor"] {
  background: linear-gradient(135deg, rgba(135, 206, 235, 0.2), rgba(70, 130, 180, 0.2));
  color: #2c5282;
  border: 1px solid rgba(70, 130, 180, 0.3);
}

.role-cell[data-role="customer"] {
  background: linear-gradient(135deg, rgba(152, 251, 152, 0.2), rgba(50, 205, 50, 0.2));
  color: #2f855a;
  border: 1px solid rgba(50, 205, 50, 0.3);
}

.role-cell[data-role="viewer"] {
  background: linear-gradient(135deg, rgba(221, 160, 221, 0.2), rgba(147, 112, 219, 0.2));
  color: #553c9a;
  border: 1px solid rgba(147, 112, 219, 0.3);
}

/* Responsive adjustments for role cell */
@media (max-width: 768px) {
  .role-cell {
    padding: 3px 6px !important;
    font-size: 0.75rem !important;
    gap: 4px !important;
    justify-content: center !important;
  }
  
  /* Adjust left-aligned columns padding on mobile */
  #usersTable td:nth-child(1),
  #usersTable td:nth-child(3) {
    padding-left: 8px !important;
  }
}
