/* ============================================================
   BBB Dining Group — Staff Dashboard
   Brand Design System (Cloudflare Rebuild)
   ============================================================ */

/* ===== 1. CSS Variables ===== */
:root {
  --bg: #f5f4f0;
  --accent: #c8410a;
  --accent-hover: #a83608;
  --text: #1a1a1a;
  --text-light: #666;
  --card-bg: #ffffff;
  --card-radius: 16px;
  --card-shadow: 0 1px 4px rgba(0,0,0,0.07);
  --input-radius: 10px;
  --success: #2e7d32;
  --success-bg: #e8f5e9;
  --warning: #e65100;
  --warning-bg: #fff3e0;
  --danger: #c62828;
  --danger-bg: #ffebee;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --header-bg: #1a1a1a;
  --sidebar-bg: #1a1a1a;
}

/* ===== 2. Reset & Base ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  height: 100%;
}

body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100%;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

/* ===== 3. Header ===== */
header {
  background: var(--header-bg);
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

header h1 {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  text-align: center;
  margin-bottom: 0;
  flex: 1;
}

.header-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.hamburger-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}

.hamburger-btn:active {
  background: rgba(255,255,255,0.15);
}

.venue-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.85);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

.venue-name {
  font-size: 0.75rem;
  opacity: 0.85;
}

.dept-badge {
  background: rgba(255,255,255,0.2);
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 0.68rem;
  font-weight: 600;
  color: #fff;
}

.staff-id-badge {
  background: var(--accent);
  color: #fff;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}

/* ===== 4. Sidebar ===== */
.sidebar {
  position: fixed;
  top: 0;
  left: -260px;
  width: 260px;
  height: 100%;
  background: var(--sidebar-bg);
  z-index: 200;
  display: flex;
  flex-direction: column;
  transition: left 0.3s ease;
  box-shadow: 4px 0 20px rgba(0,0,0,0.25);
}

.sidebar.open {
  left: 0;
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 199;
  display: none;
}

.sidebar-overlay.active {
  display: block;
}

.sidebar-header {
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h2 {
  color: #fff;
  font-size: 1.1rem;
}

.sidebar-close {
  color: #fff;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  padding: 8px;
  gap: 2px;
  flex: 1;
  overflow-y: auto;
}

.sidebar-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  color: rgba(255,255,255,0.7);
  border: none;
  background: transparent;
  font-size: 0.88rem;
  cursor: pointer;
  width: 100%;
  text-align: left;
  position: relative;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}

.sidebar-item:hover,
.sidebar-item.active {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

.sidebar-item.nav-hidden {
  display: none;
}

.sidebar-icon {
  font-size: 1.2rem;
  width: 24px;
  text-align: center;
}

.sidebar-label {
  font-weight: 500;
}

.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 8px;
}

.sidebar-divider {
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 4px 8px;
}

/* ===== 5. Notification Badge ===== */
.notification-badge {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* ===== 6. Language Toggle ===== */
.lang-toggle {
  display: flex;
  gap: 4px;
  padding: 8px 16px;
  margin-bottom: 4px;
}

.lang-btn {
  flex: 1;
  padding: 6px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.2);
  background: transparent;
  color: rgba(255,255,255,0.6);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}

.lang-btn.active {
  background: rgba(255,255,255,0.2);
  color: #fff;
  border-color: rgba(255,255,255,0.4);
}

/* ===== 7. Content Container (Main) ===== */
main {
  max-width: 800px;
  margin: 0 auto;
  padding: 12px;
}

/* ===== 8. Cards ===== */
.card {
  background: var(--card-bg);
  border-radius: var(--card-radius);
  padding: 20px;
  box-shadow: var(--card-shadow);
  margin-bottom: 12px;
}

.card-title {
  font-size: 1.05rem;
  color: var(--accent);
  margin-bottom: 12px;
  font-weight: 800;
}

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

/* ===== 9. Tab Content ===== */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== 10. Form Elements ===== */
label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 4px;
  margin-top: 10px;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="file"],
input[type="search"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #ddd;
  border-radius: var(--input-radius);
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
  -webkit-appearance: none;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200,65,10,0.12);
}

textarea {
  resize: vertical;
  min-height: 60px;
}

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

.form-group {
  margin-bottom: 14px;
}

.form-row {
  display: flex;
  gap: 10px;
}

.form-row .form-group {
  flex: 1;
}

.row {
  display: flex;
  gap: 8px;
}

.row input { flex: 2; }
.row select { flex: 1; }

/* ===== 11. Buttons ===== */
.btn-primary {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--input-radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 12px;
  transition: background 0.2s;
  font-family: inherit;
}

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

.btn-primary:active {
  opacity: 0.85;
}

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

.btn-secondary {
  padding: 10px 18px;
  background: #fff;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}

.btn-secondary:hover {
  background: #fef0ea;
}

.btn-secondary-full {
  width: 100%;
  padding: 10px;
  background: #fef0ea;
  color: var(--accent);
  border: 1px solid rgba(200,65,10,0.3);
  border-radius: var(--input-radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  font-family: inherit;
  transition: background 0.2s;
}

.btn-secondary-full:hover {
  background: #fde3d6;
}

.btn-approve {
  padding: 8px 16px;
  background: var(--success);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}

.btn-approve:hover {
  background: #256b28;
}

.btn-reject-sm {
  padding: 8px 16px;
  background: var(--danger);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}

.btn-reject-sm:hover {
  background: #a32121;
}

.btn-danger {
  padding: 10px 18px;
  background: var(--danger);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}

.btn-danger:hover {
  background: #a32121;
}

.btn-cancel-leave {
  background: #fff;
  color: var(--danger);
  border: 1.5px solid rgba(198,40,40,0.4);
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}

.btn-cancel-leave:hover {
  background: var(--danger-bg);
}

.btn-edit-balance {
  display: inline-block;
  background: #fef0ea;
  color: var(--accent);
  border: 1px solid rgba(200,65,10,0.3);
  border-radius: 4px;
  padding: 1px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  margin-left: 4px;
  font-family: inherit;
  transition: background 0.2s;
}

.btn-edit-balance:hover {
  background: #fde3d6;
}

.btn-remove-staff {
  background: #fff;
  color: var(--danger);
  border: 1px solid rgba(198,40,40,0.4);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}

.btn-remove-staff:hover {
  background: var(--danger-bg);
}

.btn-export {
  width: 100%;
  padding: 12px;
  background: #fff;
  color: var(--text-light);
  border: 1px solid #ddd;
  border-radius: var(--input-radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 16px;
  font-family: inherit;
  transition: background 0.2s;
}

.btn-export:hover {
  background: #f5f5f5;
}

.tiny-btn {
  background: #fff;
  border: 1px solid #ddd;
  color: var(--text-light);
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.tiny-btn:hover {
  background: #f5f5f5;
}

.tiny-btn.danger {
  color: var(--danger);
  border-color: rgba(198,40,40,0.4);
}

.tiny-btn.danger:hover {
  background: var(--danger-bg);
}

/* ===== 12. Login / Sign-in ===== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 20px;
}

.overlay.hidden { display: none; }

.overlay-content {
  text-align: center;
  width: 100%;
  max-width: 400px;
}

.overlay-content h2 {
  color: #fff;
  margin-bottom: 6px;
  font-size: 1.3rem;
}

.signin-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 20px;
}

.signin-overlay.hidden { display: none; }

.signin-box {
  background: var(--card-bg);
  border-radius: var(--card-radius);
  padding: 28px 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  text-align: left;
  width: 100%;
  max-width: 400px;
}

.signin-box h2 {
  color: var(--accent);
  text-align: center;
  font-size: 1.3rem;
}

.signin-subtitle {
  text-align: center;
  color: var(--text-light);
  font-size: 0.85rem;
  margin-bottom: 20px;
}

.signin-toggle {
  text-align: center;
  margin-top: 12px;
  font-size: 0.82rem;
}

.signin-toggle a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.signin-toggle a:hover {
  text-decoration: underline;
}

.signin-toggle a:active {
  opacity: 0.7;
}

/* ===== Login Page (index.html) ===== */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg);
}

.login-card {
  background: var(--card-bg);
  border-radius: var(--card-radius);
  padding: 28px 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  text-align: left;
  width: 100%;
  max-width: 400px;
}

.login-card h2 {
  color: var(--accent);
  text-align: center;
  font-size: 1.3rem;
  margin-bottom: 2px;
}

.login-subtitle {
  text-align: center;
  color: var(--text-light);
  font-size: 0.85rem;
  margin-bottom: 20px;
}

.login-message {
  text-align: center;
  font-size: 0.85rem;
  padding: 8px 12px;
  border-radius: 8px;
  margin-top: 8px;
  background: var(--danger-bg);
  color: var(--danger);
}

.login-message:empty {
  display: none;
}

.admin-link {
  text-align: center;
  margin-top: 14px;
  font-size: 0.82rem;
}

.admin-link a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}

.admin-link a:hover {
  text-decoration: underline;
}

.admin-link a:active {
  opacity: 0.7;
}

@media (min-width: 769px) {
  .login-card {
    padding: 36px 28px;
  }
}

/* ===== 13. Venue Buttons (Sign-in) ===== */
.venue-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.venue-btn {
  background: #fff;
  color: var(--accent);
  border: 1.5px solid rgba(200,65,10,0.3);
  padding: 14px;
  border-radius: var(--input-radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}

.venue-btn:hover {
  background: #fef0ea;
}

.venue-btn:active {
  background: #fde3d6;
}

/* ===== 14. Department Display (Sign-in) ===== */
.dept-display {
  background: #fef0ea;
  color: var(--accent);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
}

/* ===== 15. Toast ===== */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--header-bg);
  color: #fff;
  padding: 10px 22px;
  border-radius: 24px;
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 400;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  animation: toastIn 0.3s ease;
  max-width: 90%;
  text-align: center;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to { opacity: 0; transform: translateX(-50%) translateY(10px); }
}

.toast.fade-out {
  animation: toastOut 0.3s ease forwards;
}

/* ===== 16. Home Dashboard ===== */
.home-welcome {
  text-align: center;
  padding: 20px 16px;
}

.home-welcome h2 {
  color: var(--accent);
  font-size: 1.2rem;
  margin-bottom: 4px;
}

.home-venue-text {
  color: var(--text-light);
  font-size: 0.85rem;
}

.home-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.home-stat {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  box-shadow: var(--card-shadow);
}

.home-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}

.home-stat-label {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 2px;
}

.home-stat.accent .home-stat-value {
  color: var(--danger);
}

.home-stat.warning .home-stat-value {
  color: var(--warning);
}

.home-section-title {
  font-size: 0.92rem;
  color: var(--accent);
  font-weight: 800;
  margin-bottom: 0;
}

.home-activity-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

/* ===== 17. Home Action Buttons ===== */
.home-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.home-action-btn {
  flex: 1;
  padding: 14px 12px;
  border-radius: 12px;
  border: 2px solid var(--accent);
  background: #fff;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
  box-shadow: var(--card-shadow);
  transition: background 0.2s;
  font-family: inherit;
}

.home-action-btn:hover {
  background: #fef0ea;
}

.home-action-btn:active {
  background: #fde3d6;
}

.home-action-btn .action-icon {
  display: block;
  font-size: 1.3rem;
  margin-bottom: 4px;
}

/* ===== 18. Leave Balance Cards ===== */
.balance-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}

.bal-card {
  border-radius: 8px;
  padding: 10px 4px;
  text-align: center;
}

.bal-num {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.2;
}

.bal-text {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-top: 2px;
}

.bal-total {
  background: #fef0ea;
}
.bal-total .bal-num,
.bal-total .bal-text {
  color: var(--accent);
}

.bal-used {
  background: var(--danger-bg);
}
.bal-used .bal-num,
.bal-used .bal-text {
  color: var(--danger);
}

.bal-left {
  background: var(--success-bg);
}
.bal-left .bal-num,
.bal-left .bal-text {
  color: var(--success);
}

.bal-pending {
  background: var(--warning-bg);
}
.bal-pending .bal-num,
.bal-pending .bal-text {
  color: var(--warning);
}

/* ===== 19. Balance Preview ===== */
.balance-preview {
  background: #fef0ea;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.82rem;
}

.balance-label { color: var(--text-light); }
.balance-count { font-weight: 700; color: var(--accent); font-size: 1.05rem; }
.balance-unit { color: var(--text-light); }

/* ===== 20. Date Info ===== */
.date-info {
  background: var(--warning-bg);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 10px;
  font-size: 0.8rem;
  color: #5d4200;
}

.date-info .days-count {
  font-weight: 700;
  color: var(--accent);
}

.date-info .holiday-note {
  display: block;
  margin-top: 4px;
  color: var(--danger);
  font-size: 0.78rem;
}

.date-info .conflict-warn {
  display: block;
  margin-top: 4px;
  color: var(--danger);
  font-weight: 600;
}

/* ===== 21. Request Cards (Leave) ===== */
.request-card {
  background: var(--card-bg);
  border-radius: var(--input-radius);
  padding: 12px;
  margin-bottom: 8px;
  box-shadow: var(--card-shadow);
  border-left: 3px solid #ccc;
}

.request-card.pending {
  border-left-color: var(--warning);
}

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

.request-card.rejected {
  border-left-color: var(--danger);
}

.request-card.cancelled {
  border-left-color: #999;
}

.request-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.request-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text);
}

.request-dates {
  font-size: 0.82rem;
  color: var(--text-light);
}

.request-status {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.status-pending {
  background: var(--warning-bg);
  color: var(--warning);
}

.status-approved {
  background: var(--success-bg);
  color: var(--success);
}

.status-rejected {
  background: var(--danger-bg);
  color: var(--danger);
}

.status-cancelled {
  background: #f5f5f5;
  color: #999;
}

.request-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.request-meta-tag {
  background: #f5f5f5;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  color: #777;
}

.request-reason {
  font-size: 0.8rem;
  color: var(--text-light);
  font-style: italic;
  padding: 6px 10px;
  background: #fafafa;
  border-radius: 6px;
  margin-bottom: 6px;
}

.request-rejection {
  font-size: 0.8rem;
  color: var(--danger);
  padding: 6px 10px;
  background: var(--danger-bg);
  border-radius: 6px;
  margin-bottom: 6px;
}

.request-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.request-actions button {
  flex: 1;
}

.my-leaves-section {
  margin-top: 12px;
}

.my-leaves-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

/* ===== 22. Manager Insights ===== */
.manager-insights {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
  font-size: 0.78rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.insight-row {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.insight-label {
  font-weight: 600;
  color: var(--text-light);
  font-size: 0.72rem;
}

.insight-value {
  color: var(--text);
}

.insight-holiday {
  background: var(--warning-bg);
  border-radius: 6px;
  padding: 4px 8px;
}

.insight-holiday .insight-label {
  color: var(--warning);
}

.insight-holiday .insight-value {
  color: var(--warning);
}

.insight-warning {
  background: var(--danger-bg);
  border-radius: 6px;
  padding: 4px 8px;
}

.insight-warning .insight-label {
  color: var(--danger);
}

.insight-warning .insight-value {
  color: var(--danger);
}

.insight-ok .insight-value {
  color: var(--success);
}

/* ===== 23. Calendar ===== */
.calendar-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.calendar-month-label {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--accent);
}

.calendar-filter {
  margin-bottom: 10px;
}

.calendar-grid {
  background: var(--card-bg);
  border-radius: var(--input-radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  margin-bottom: 10px;
}

.calendar-header-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--header-bg);
}

.cal-day-name {
  text-align: center;
  padding: 8px 2px;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
}

.calendar-body {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.cal-day {
  min-height: 44px;
  padding: 4px;
  border: 0.5px solid #eee;
  cursor: pointer;
  transition: background 0.15s;
}

.cal-day:active {
  background: var(--bg);
}

.cal-day.empty {
  background: #fafafa;
  cursor: default;
}

.cal-day.today {
  background: #fef0ea;
}

.cal-day.holiday {
  background: var(--warning-bg);
}

.cal-day-number {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text);
}

.cal-day.holiday .cal-day-number {
  color: var(--danger);
}

.cal-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: 2px;
}

.cal-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.dot-approved {
  background: var(--success);
}

.dot-pending {
  background: var(--warning);
}

.calendar-legend {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 10px;
  font-size: 0.75rem;
  color: #777;
}

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

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-holiday {
  background: var(--danger);
}

.calendar-day-detail {
  background: var(--card-bg);
  border-radius: var(--input-radius);
  padding: 12px;
  box-shadow: var(--card-shadow);
}

.calendar-day-detail h4 {
  font-size: 0.88rem;
  color: var(--accent);
  margin-bottom: 8px;
}

.detail-item {
  font-size: 0.82rem;
  padding: 6px 0;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text);
}

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

/* ===== 24. Staff List ===== */
.staff-controls {
  display: flex;
  gap: 8px;
}

.staff-count {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 8px;
}

.staff-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card-bg);
  border-radius: var(--input-radius);
  padding: 12px;
  margin-bottom: 6px;
  box-shadow: var(--card-shadow);
  border-left: 3px solid rgba(200,65,10,0.3);
}

.staff-item-info {
  flex: 1;
}

.staff-item-code {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  font-family: 'SF Mono', 'Fira Code', monospace;
  letter-spacing: 0.5px;
}

.staff-item-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text);
}

.staff-item-meta {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.staff-item-tag {
  background: #f5f5f5;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  color: #777;
}

.staff-item-tag.dept-tag {
  background: #fef0ea;
  color: var(--accent);
}

.staff-item-actions {
  display: flex;
  gap: 6px;
}

/* ===== 25. Staff Search / Filter Bar ===== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.filter-bar select,
.filter-bar input {
  flex: 1;
  min-width: 120px;
}

.filters-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.filters-row select,
.filters-row input {
  flex: 1;
  min-width: 100px;
}

.inline-filter {
  width: auto;
  min-width: 100px;
  padding: 4px 28px 4px 8px;
  font-size: 0.78rem;
  border-radius: 6px;
}

/* ===== 26. Stat Row ===== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}

.stat-card {
  border-radius: 8px;
  padding: 10px 4px;
  text-align: center;
}

.stat-number {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-top: 2px;
}

.stat-pending-card {
  background: var(--warning-bg);
}
.stat-pending-card .stat-number,
.stat-pending-card .stat-label {
  color: var(--warning);
}

.stat-approved-card {
  background: var(--success-bg);
}
.stat-approved-card .stat-number,
.stat-approved-card .stat-label {
  color: var(--success);
}

.stat-rejected-card {
  background: var(--danger-bg);
}
.stat-rejected-card .stat-number,
.stat-rejected-card .stat-label {
  color: var(--danger);
}

.stat-total-card {
  background: #fef0ea;
}
.stat-total-card .stat-number,
.stat-total-card .stat-label {
  color: var(--accent);
}

/* ===== 27. View Toggle ===== */
.view-toggle {
  display: flex;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--accent);
  margin-bottom: 14px;
}

.toggle-btn {
  flex: 1;
  padding: 8px;
  border: none;
  background: #fff;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}

.toggle-btn.active {
  background: var(--header-bg);
  color: #fff;
}

/* ===== 28. Tab Bar (Sub-tabs / Manager Tabs) ===== */
.sub-tabs {
  display: flex;
  border-radius: var(--input-radius);
  overflow: hidden;
  border: 2px solid var(--accent);
  margin-bottom: 14px;
}

.sub-tab,
.mgr-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: #fff;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  font-family: inherit;
}

.sub-tab.active,
.mgr-tab.active {
  background: var(--header-bg);
  color: #fff;
}

.sub-tab.sub-hidden,
.mgr-tab.mgr-hidden {
  display: none;
}

.sub-content,
.mgr-content {
  display: none;
}

.sub-content.active,
.mgr-content.active {
  display: block;
}

/* ===== 29. Modal ===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 20px;
}

.modal.hidden { display: none; }

.modal-card {
  background: var(--card-bg);
  border-radius: var(--card-radius);
  padding: 20px 16px;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.modal-header h3 {
  color: var(--accent);
  font-size: 1.05rem;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 20px;
}

.modal-overlay.hidden { display: none; }

.modal-dialog {
  background: var(--card-bg);
  border-radius: var(--card-radius);
  padding: 20px 16px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

.modal-dialog h3 {
  color: var(--accent);
  margin-bottom: 8px;
}

.modal-text {
  font-size: 0.85rem;
  color: #777;
  margin-bottom: 14px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.modal-actions button {
  flex: 1;
}

.lightbox-content {
  text-align: center;
  position: relative;
}

.lightbox-content img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 8px;
}

.lightbox-content .close-btn {
  position: absolute;
  top: -30px;
  right: 0;
  color: #fff;
}

/* ===== 30. Notifications ===== */
.notifications-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.notif-card {
  background: var(--card-bg);
  border-radius: var(--input-radius);
  padding: 12px;
  margin-bottom: 8px;
  box-shadow: var(--card-shadow);
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border-left: 3px solid #ddd;
  cursor: pointer;
  transition: background 0.2s;
}

.notif-card.unread {
  background: #fef8f4;
  border-left-color: var(--accent);
}

.notif-card.unread .notif-text {
  font-weight: 600;
}

.notif-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.notif-icon.announcement {
  background: #e3f2fd;
  color: #1565c0;
}

.notif-icon.approved {
  background: var(--success-bg);
  color: var(--success);
}

.notif-icon.rejected {
  background: var(--danger-bg);
  color: var(--danger);
}

.notif-icon.request {
  background: var(--warning-bg);
  color: var(--warning);
}

.notif-body {
  flex: 1;
  min-width: 0;
}

.notif-text {
  font-size: 0.82rem;
  color: var(--text);
}

.notif-time {
  font-size: 0.7rem;
  color: #aaa;
  margin-top: 2px;
}

.announcement-section {
  margin-bottom: 12px;
}

/* ===== 31. Empty & Loading States ===== */
.empty-state {
  text-align: center;
  color: #999;
  padding: 32px 16px;
  font-size: 0.88rem;
}

.loading-text {
  text-align: center;
  color: var(--text-light);
  padding: 20px;
}

/* ===== 32. Message Bar ===== */
.message-bar {
  text-align: center;
  font-size: 0.85rem;
  padding: 8px 12px;
  border-radius: 8px;
  margin-top: 8px;
}

.message-bar.success {
  background: var(--success-bg);
  color: var(--success);
}

.message-bar.error {
  background: var(--danger-bg);
  color: var(--danger);
}

/* ===== 33. Pagination ===== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 14px 0;
}

.pagination-info {
  font-size: 0.82rem;
  color: var(--text-light);
}

/* ===== 34. Offline Banner ===== */
.offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--warning);
  color: #fff;
  text-align: center;
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  z-index: 600;
  transform: translateY(-100%);
  transition: transform 0.3s;
}

.offline-banner.show {
  transform: translateY(0);
}

/* ===== 35. Logout Warning ===== */
.logout-warning {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--warning);
  color: #fff;
  padding: 10px 22px;
  border-radius: 24px;
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 400;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  white-space: nowrap;
}

/* ===== 36. Collapsible Sections ===== */
.section-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  font-size: 1.05rem;
  color: var(--accent);
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
}

.toggle-arrow {
  font-size: 0.75rem;
  color: var(--text-light);
  transition: transform 0.2s;
}

.toggle-arrow.open {
  transform: rotate(180deg);
}

.collapsible-section {
  margin-top: 12px;
}

.collapsible-section.collapsed {
  display: none;
}

.optional-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 8px 0;
  font-family: inherit;
}

.optional-toggle:active {
  color: var(--text);
}

.optional-fields {
  padding-top: 4px;
}

/* ===== 37. Status Badges ===== */
.status-active {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.68rem;
  font-weight: 700;
  background: var(--success-bg);
  color: var(--success);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.status-inactive {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.68rem;
  font-weight: 700;
  background: #f5f5f5;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* ===== 38. Badge (generic) ===== */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
}

/* ===== 39. Manager Top Bar ===== */
.manager-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

/* ===== 40. Total Bar ===== */
.total-bar {
  background: #fef0ea;
  border: 1px solid rgba(200,65,10,0.3);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 10px;
  text-align: center;
}

/* ===== 41. Refresh Button ===== */
.refresh-btn {
  background: #fef0ea;
  border: 1px solid rgba(200,65,10,0.3);
  color: var(--accent);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}

.refresh-btn:hover {
  background: #fde3d6;
}

/* ===== 42. Lock Icon (Manager PIN) ===== */
.lock-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

/* ===== 43. Help Text ===== */
.help-text {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 12px;
}

/* ===== 44. Photo Preview ===== */
#photoPreview {
  margin-top: 8px;
  text-align: center;
}

#photoPreview img {
  max-width: 120px;
  max-height: 120px;
  border-radius: 8px;
  border: 1px solid #ddd;
}

/* ===== 45. Activity Feed ===== */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.activity-item {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 10px 12px;
  box-shadow: var(--card-shadow);
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.activity-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.activity-icon.leave {
  background: var(--success-bg);
  color: var(--success);
}

.activity-icon.approve {
  background: #fef0ea;
  color: var(--accent);
}

.activity-icon.reject {
  background: var(--danger-bg);
  color: var(--danger);
}

.activity-body {
  flex: 1;
  min-width: 0;
}

.activity-text {
  font-size: 0.82rem;
  color: var(--text);
}

.activity-time {
  font-size: 0.7rem;
  color: #aaa;
  margin-top: 2px;
}

/* ===== 46. Utility ===== */
.hidden {
  display: none !important;
}

/* ===== 47. Responsive ===== */

/* Mobile small */
@media (max-width: 480px) {
  main {
    padding: 8px;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .filters-row {
    flex-direction: column;
    gap: 8px;
  }

  .stat-number {
    font-size: 1.2rem;
  }

  .bal-num {
    font-size: 1.1rem;
  }

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

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

/* Tablet+ */
@media (min-width: 769px) {
  main {
    padding: 20px;
  }

  .sidebar {
    width: 280px;
    left: -280px;
  }

  .sidebar.open {
    left: 0;
  }

  .signin-box {
    padding: 36px 28px;
  }

  .card {
    padding: 24px;
  }

  .home-stats {
    grid-template-columns: repeat(4, 1fr);
  }

  .home-actions {
    gap: 14px;
  }
}
