/* Solar Basket — Modern Minimalist UI */
:root {
  --primary: #111111;
  --secondary: #333333;
  --bg: #f9f9fa;
  /* Clean off-white background */

  --glass-bg: rgba(255, 255, 255, 0.9);
  --glass-border: rgba(0, 0, 0, 0.04);

  --text: #111111;
  --muted: #666666;
  --success: #10b981;
  --danger: #ef4444;
  --info: #3b82f6;
  --warning: #f59e0b;
  --radius: 20px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
}

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

html,
body {
  height: 100%;
}

/* Import Inter for the modern minimalist look */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ---------- SCROLLBARS ---------- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.02);
  border-radius: 8px;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.2);
}

body {
  font-family: "Inter", sans-serif;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;

  /* Flat Minimalist Background */
  background-color: var(--bg);
  overflow-x: hidden;
}

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

a:hover {
  color: var(--secondary);
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* ---------- CARD BASE CLASS ---------- */
.card,
.sidebar,
.table-wrap,
.login-card,
.calendar-card {
  background: #ffffff;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

.card-purple {
  background: #f4ebff !important;
  border-color: rgba(168, 85, 247, 0.1) !important;
}

.card-mint {
  background: #e6fcf5 !important;
  border-color: rgba(16, 185, 129, 0.1) !important;
}

/* ---------- LOGIN ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 440px;
  padding: 36px 32px;
  border-radius: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.brand-logo {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-text h1 {
  font-size: 20px;
  letter-spacing: .2px;
}

.brand-text p {
  color: var(--muted);
  font-size: 12px;
}

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

.form-group label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .6px;
}

/* ---------- INPUTS & FORMS (Minimalist) ---------- */
.input,
select,
textarea {
  width: 100%;
  background-color: #f3f4f6;
  /* Flat very light gray */
  border: 1px solid transparent;
  color: var(--text);
  padding: 12px 18px;
  border-radius: 9999px;
  /* Pill shape for inputs */
  font-size: 14px;
  outline: none;
  transition: 0.2s border-color, 0.2s background-color, 0.2s box-shadow;
  box-shadow: none;
  /* No inset shadows */
}

.input:focus,
select:focus,
textarea:focus {
  border-color: rgba(17, 17, 17, 0.1);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.05);
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 6px 0 18px;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 9999px;
  /* Pill shape */
  font-weight: 500;
  font-size: 14px;
  transition: .15s transform, .15s background, .15s box-shadow;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  width: 100%;
  box-shadow: 0 0 15px rgba(0, 113, 227, 0.4);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 22px rgba(0, 113, 227, 0.6);
}

.btn-ghost {
  background: transparent;
  border: 1px solid #e5e7eb;
  color: var(--text);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
}

.btn-ghost:hover {
  background: #f3f4f6;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
}

.btn-success {
  background: var(--success);
  color: #ffffff;
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.4);
}

.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 22px rgba(34, 197, 94, 0.6);
}

.btn-danger {
  background: var(--danger);
  color: #ffffff;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 22px rgba(239, 68, 68, 0.6);
}

.btn-warning {
  background: var(--warning);
  color: #ffffff;
  box-shadow: 0 0 15px rgba(250, 204, 21, 0.5);
}

.btn-warning:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 22px rgba(250, 204, 21, 0.7);
}

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

.hint {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin-top: 18px;
}

/* ---------- AURORA EFFECT ---------- */
.aurora-bg {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100vw;
  max-width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.15) 0%, rgba(59, 130, 246, 0.15) 50%, rgba(255, 255, 255, 0) 70%);
  filter: blur(80px);
  transform: translate(-50%, -50%);
  z-index: -1;
  pointer-events: none;
}

/* ---------- APP LAYOUT ---------- */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  border-radius: 0;
  /* Override generic glass radius for sidebar */
  border-top: none !important;
  border-bottom: none !important;
  border-left: none !important;
}

.sidebar .brand {
  margin-bottom: 24px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav button,
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 500;
  font-size: 14px;
  width: 100%;
  text-align: left;
  transition: 0.2s background, 0.2s color;
}

.nav button:hover,
.nav a:hover {
  background: rgba(255, 255, 255, 0.6);
  color: var(--text);
}

.nav button.active,
.nav a.active {
  background: var(--primary);
  color: #ffffff;
  border: 1px solid var(--primary);
}

.sidebar-foot {
  position: absolute;
  bottom: 14px;
  left: 14px;
  right: 14px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-x: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.hide-on-mobile {}

.show-on-mobile {
  display: none !important;
}

.transition-transform {
  transition: transform 0.3s ease;
}

.apply-leave-modal-wrapper {}

.history-content {}

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

.topbar .sub {
  color: var(--muted);
  font-size: 12px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 1), 0 2px 8px rgba(0, 0, 0, 0.05);
  padding: 6px 12px;
  border-radius: 999px;
}

.content {
  display: flex;
  flex-direction: column;
  padding: 32px 40px;
  min-height: 100vh;
}

/* ---------- CARDS ---------- */
.grid {
  display: grid;
  gap: 16px;
}

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

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

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

@media (max-width: 1100px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

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

/* Global Mobile Bottom Nav Default (Hidden on Desktop) */
.mobile-bottom-nav {
  display: none;
}

#login-logo {
  width: 220px;
  height: 200px;
  margin: 0 auto;
}

/* ---------- MOBILE RESPONSIVENESS ---------- */
@media (max-width: 768px) {
  #login-logo {
    width: 140px !important;
    height: 120px !important;
  }

  .login-card {
    padding: 24px 20px !important;
  }

  th,
  td {
    white-space: normal !important;
  }

  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr !important;
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px;
  }

  .show-on-mobile {
    display: block !important;
  }

  i.show-on-mobile {
    display: inline-block !important;
  }

  /* Leaves Mobile Modal */
  .apply-leave-modal-wrapper {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 16px;
  }

  .apply-leave-modal-wrapper.open {
    display: flex;
    animation: fadeIn 0.3s ease;
  }

  .apply-leave-card {
    max-height: 90vh;
    overflow-y: auto;
    width: 100%;
    margin: 0;
  }

  /* Leaves History Accordion */
  .history-content {
    display: none;
  }

  .history-content.open {
    display: block;
  }

  .history-toggle {
    background: var(--surface);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
  }

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

  .stat {
    padding: 14px;
  }

  .hide-on-mobile {
    display: none !important;
  }

  .stat .value {
    font-size: 22px;
  }

  .stat-icon {
    width: 32px;
    height: 32px;
    font-size: 16px;
    margin-bottom: 4px;
  }

  .chart-wrap {
    height: 220px !important;
  }

  /* Calendar Mobile Fixes */
  .fc .fc-toolbar.fc-header-toolbar {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 12px 8px 6px 8px !important;
    gap: 8px;
  }

  .fc .fc-toolbar-title {
    font-size: 1.1rem !important;
    white-space: nowrap;
  }

  .fc-col-header-cell-cushion {
    font-size: 0.65rem !important;
    padding: 8px 0 !important;
  }

  .fc .fc-daygrid-day-frame {
    min-height: 45px !important;
  }

  .selected-day .fc-daygrid-day-number,
  .fc-day-today .fc-daygrid-day-number {
    width: 24px !important;
    height: 24px !important;
    margin: 2px !important;
    font-size: 0.75rem !important;
  }

  /* Convert events to colored dots on mobile for DayGrid only */
  .fc-daygrid-event {
    width: 8px !important;
    height: 8px !important;
    padding: 0 !important;
    margin: 2px auto !important;
    border-radius: 50% !important;
    min-width: unset !important;
    overflow: hidden;
    display: inline-block;
    box-shadow: none !important;
    border: none !important;
  }

  .fc-daygrid-event .fc-event-main,
  .fc-daygrid-event .fc-event-title {
    display: none !important;
  }

  .fc-daygrid-event-harness {
    display: inline-block;
    margin-right: 3px;
  }

  .fc-daygrid-day-bottom {
    text-align: center;
  }

  #attendance-calendar {
    min-height: 380px !important;
  }

  /* Responsive utility classes for internal grids */
  .grid-responsive-3,
  .grid-responsive-2 {
    grid-template-columns: 1fr !important;
  }

  .app {
    display: block;
    padding-bottom: 110px;
  }

  /* Space for bottom nav */
  .sidebar {
    display: none !important;
  }

  /* completely hide sidebar on mobile */
  .sidebar-backdrop {
    display: none !important;
  }

  /* Mobile Bottom Navigation */
  .mobile-bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: calc(16px + env(safe-area-inset-bottom));
    left: 16px;
    right: 16px;
    width: auto;
    height: 64px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 32px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    justify-content: space-around;
    align-items: center;
    padding: 0 8px;
  }

  .mobile-bottom-nav .bottom-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 100%;
    gap: 4px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 500;
    background: transparent;
    border: none;
    padding: 0;
  }

  .mobile-bottom-nav .bottom-nav-link i {
    font-size: 22px;
    transition: transform 0.2s ease, color 0.2s ease;
  }

  .mobile-bottom-nav .bottom-nav-link.active {
    color: var(--primary);
    background: rgba(59, 130, 246, 0.12);
    border-radius: 12px;
  }

  .mobile-bottom-nav .bottom-nav-link.active i {
    transform: translateY(-2px);
  }

  /* Compact Topbar */
  .topbar {
    padding: 54px 24px 16px 24px !important;
  }

  .topbar>div {
    width: 100%;
  }

  .topbar h1 {
    font-size: 28px !important;
  }

  .mobile-menu-btn {
    display: none !important;
  }

  .content {
    padding: 16px;
  }

  .user-chip span {
    display: none;
  }

  /* Hide name on mobile topbar to save space */

  .mobile-menu-btn {
    display: block;
    background: none;
    border: none;
    color: var(--text);
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    margin-left: -8px;
  }

  .modal {
    width: 95%;
    max-width: 100% !important;
    margin: 16px;
    padding: 20px;
  }

  /* Form inside Modals/Leaves - allow grid items to stack */
  form>.grid,
  form>div[style*="display: grid"] {
    grid-template-columns: 1fr !important;
  }

  /* Toolbar responsiveness */
  .toolbar {
    flex-wrap: wrap;
    justify-content: stretch;
  }

  #salary-year-filter {
    width: 68px !important;
    padding: 2px 4px !important;
    font-size: 12px !important;
    min-height: 28px !important;
    height: auto !important;
    flex: 0 0 auto !important;
  }

  .toolbar .input {
    max-width: 100% !important;
    flex: 1 1 100%;
  }

  /* Add hint to table scroll */
  .table-wrap {
    box-shadow: inset -10px 0 10px -10px rgba(0, 0, 0, 0.1);
  }
}

@media (min-width: 769px) {
  .mobile-menu-btn {
    display: none;
  }

  .sidebar-backdrop {
    display: none !important;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.card {
  padding: 18px;
}

.stat .label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .6px;
}

.stat .value {
  font-size: 26px;
  font-weight: 700;
  margin-top: 4px;
}

.stat .delta {
  font-size: 12px;
  color: var(--success);
  margin-top: 4px;
}

.stat .delta.down {
  color: var(--danger);
}

.stat-icon {
  float: right;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  color: var(--primary);
  font-size: 18px;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 1), 0 4px 12px rgba(0, 0, 0, 0.05);
}

.chart-wrap {
  position: relative;
  height: 280px;
  width: 100%;
}

.section-title {
  font-size: 14px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin: 24px 0 12px;
}

/* ---------- TABLES ---------- */
.table-wrap {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 20px;
  padding: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 12px 14px;
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .6px;
  text-transform: uppercase;
  background: transparent;
  position: sticky;
  top: 0;
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

td {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.5);
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.badge.green {
  background: #dcfce7;
  color: #166534;
}

.badge.red {
  background: #fee2e2;
  color: #991b1b;
}

.badge.yellow {
  background: #fef9c3;
  color: #854d0e;
}

.badge.blue {
  background: #dbeafe;
  color: #1e40af;
}

.badge.gray {
  background: #f1f5f9;
  color: #475569;
}

.badge.orange {
  background: #ffedd5;
  color: #9a3412;
}

/* ---------- TOOLBAR ---------- */
.toolbar {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.toolbar .input {
  max-width: 280px;
}

.toolbar .spacer {
  flex: 1;
}

/* ---------- FORMS ---------- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

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

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
}

textarea {
  min-height: 90px;
  resize: vertical;
  font-family: inherit;
}

.dropzone {
  background: rgba(255, 255, 255, 0.2);
  border: 2px dashed rgba(0, 0, 0, 0.1);
  border-radius: 20px;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
  cursor: pointer;
  transition: 0.2s border-color, 0.2s background;
}

.dropzone:hover,
.dropzone.drag {
  border-color: var(--primary);
  color: var(--text);
  background: rgba(255, 255, 255, 0.6);
}

/* ---------- MODALS ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
  backdrop-filter: blur(8px);
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow: auto;
  background: #ffffff;
  color: var(--text);
  border-radius: var(--radius);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.modal h1,
.modal h2,
.modal h3,
.modal h4 {
  color: var(--text);
}

.modal p.muted {
  color: var(--muted);
}

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

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.modal-body {
  padding: 20px;
}

.modal-foot {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 14px 20px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.x-btn {
  font-size: 24px;
  color: var(--muted);
  line-height: 1;
  transition: 0.2s color;
}

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

.modal input,
.modal select,
.modal textarea {
  background: var(--surface);
  color: var(--text);
  border-color: rgba(0, 0, 0, 0.1);
}

.modal input:focus,
.modal select:focus,
.modal textarea:focus {
  border-color: var(--primary);
}

.modal table th {
  background: #f9fafb;
  color: var(--muted);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.modal table td {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.modal tbody tr:hover {
  background: #f9fafb;
}

.modal .card {
  background: #ffffff !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
}

/* ---------- PAYSLIP ---------- */
.payslip h3 {
  margin-bottom: 6px;
}

.payslip .meta {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 14px;
}

.payslip table {
  margin-top: 8px;
}

.payslip .totals td {
  font-weight: 700;
}

/* ---------- TOAST ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--glass-bg);
  backdrop-filter: blur(30px);
  border: 1px solid var(--glass-border);
  border-left: 4px solid var(--success);
  padding: 12px 16px;
  border-radius: 20px;
  box-shadow: var(--shadow);
  z-index: 100;
  transform: translateY(20px);
  opacity: 0;
  transition: .2s;
}

.toast.show {
  transform: none;
  opacity: 1;
}

.toast.err {
  border-left-color: var(--danger);
}

/* ---------- MISC ---------- */
.flex {
  display: flex;
  gap: 10px;
  align-items: center;
}

.flex-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.right {
  text-align: right;
}

.mt-12 {
  margin-top: 12px;
}

.mt-16 {
  margin-top: 16px;
}

.mt-24 {
  margin-top: 24px;
}

.mb-12 {
  margin-bottom: 12px;
}

.mb-24 {
  margin-bottom: 24px;
}

.chart-wrap {
  position: relative;
  height: 260px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

/* ---------- LEGEND ---------- */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  padding: 12px 0;
}

.legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

/* ---------- FULLCALENDAR OVERRIDES ---------- */
#attendance-calendar {
  width: 100%;
  margin: auto;
  min-height: 500px;
}

.fc .fc-daygrid-day-frame {
  min-height: 55px !important;
}

.fc .fc-toolbar-title {
  font-size: 1.2rem !important;
  color: var(--text);
}

.selected-day {
  background: rgba(0, 113, 227, 0.08) !important;
  border: 1px solid rgba(0, 113, 227, 0.3) !important;
}

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

.fc-theme-standard td,
.fc-theme-standard th {
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

.fc .fc-daygrid-day {
  transition: background 0.2s ease, transform 0.2s ease;
}

.fc .fc-daygrid-day:hover:not(.fc-day-other) {
  background: rgba(0, 113, 227, 0.04) !important;
  cursor: pointer;
}

.fc-button {
  background: rgba(0, 0, 0, 0.05) !important;
  color: var(--text) !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  transition: 0.2s;
}

.fc-button:hover {
  background: rgba(0, 0, 0, 0.1) !important;
}

.fc-day-today {
  background: transparent !important;
}

.fc .fc-toolbar.fc-header-toolbar {
  padding: 20px 24px 10px 24px;
  margin-bottom: 0 !important;
}

.fc-col-header-cell-cushion {
  color: var(--muted);
  font-weight: 600;
  padding: 12px 0 !important;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.selected-day .fc-daygrid-day-number {
  background: var(--primary) !important;
  /* Apple Blue highlight */
  color: #fff !important;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 4px 6px;
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.4);
  font-weight: 700;
}

.fc-event {
  border-radius: 4px;
  border: none;
  padding: 3px 6px;
  margin: 2px 6px !important;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.fc-event-main {
  color: #fff !important;
}

.fc .fc-button-primary {
  border-radius: 6px;
  text-transform: capitalize;
}

.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
  background: var(--primary) !important;
  color: #ffffff !important;
  border-color: var(--primary) !important;
  font-weight: 600;
}

.fc .fc-scrollgrid {
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

.calendar-card {
  padding: 0;
  overflow: hidden;
  border: none !important;
}

.fc,
.fc-view-harness,
.fc-scrollgrid {
  width: 100% !important;
}

.fc-daygrid-body,
.fc-daygrid-body table {
  width: 100% !important;
}

.fc-day-today .fc-daygrid-day-number {
  background: rgba(0, 0, 0, 0.05) !important;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 4px 6px;
}

.fc-daygrid-day-top {
  display: flex;
  flex-direction: row-reverse;
}

.fc tbody tr:hover {
  background: transparent !important;
}

.fc .fc-day-other:hover {
  background: transparent !important;
  cursor: default;
}

/* ---------- SPECIFIC MODULES ---------- */
/* Salary Table */
#salary-table {
  table-layout: fixed;
  width: 100%;
}

#salary-table th,
#salary-table td {
  vertical-align: middle;
}

#salary-table th:nth-child(1),
#salary-table td:nth-child(1) {
  width: 20%;
  text-align: left;
}

#salary-table th:nth-child(2),
#salary-table td:nth-child(2) {
  width: 20%;
  text-align: left;
}

#salary-table th:nth-child(3),
#salary-table td:nth-child(3) {
  width: 20%;
  text-align: left;
}

#salary-table td:nth-child(3) {
  color: var(--success);
  font-weight: 700;
  font-size: 15px;
}

#salary-table th:nth-child(4),
#salary-table td:nth-child(4) {
  width: 20%;
  text-align: left;
}

#salary-table th:nth-child(5),
#salary-table td:nth-child(5) {
  width: 20%;
  text-align: left;
}

#salary-table td {
  padding: 24px 14px;
}

#salary-table td:last-child,
#salary-table th:last-child {
  padding-right: 30px;
}

#salary-table td:first-child,
#salary-table th:first-child {
  padding-left: 30px;
}

/* Attendance Layout */
.attendance-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 1000px) {
  .attendance-layout {
    grid-template-columns: 1fr;
  }
}

.attendance-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.attendance-sidebar .btn,
.attendance-sidebar select {
  width: 100%;
}

.attendance-toolbar {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
}

.attendance-toolbar select {
  flex: 1;
  max-width: 500px;
}

.attendance-toolbar button {
  min-width: 180px;
}

/* PIN Box UI */
.pin-box-container {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
}

.pin-box {
  width: 50px;
  height: 55px;
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  color: var(--primary);
  border-radius: 16px;
  transition: all 0.25s ease;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow:
    inset 0 3px 6px rgba(0, 0, 0, 0.08),
    inset 0 1px 2px rgba(0, 0, 0, 0.05),
    0 1px 1px rgba(255, 255, 255, 0.8);
}

.pin-box:focus {
  outline: none;
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 1);
}

.pin-box::-webkit-inner-spin-button,
.pin-box::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* --- CUSTOM NATIVE DROPDOWN STYLING --- */

/* 1. Style the main Select box and add a custom chevron arrow */
select.input,
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;

  /* Custom SVG Chevron pointing down (darker color to match theme) */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='rgba(0, 0, 0, 0.6)'%3E%3Cpath d='M12 15.0006L7.75732 10.758L9.17154 9.34375L12 12.1722L14.8284 9.34375L16.2426 10.758L12 15.0006Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 20px;
  padding-right: 44px;
  /* Make room for the arrow */
}

/* 2. Refine the dropdown menu options */
select.input option,
select option {
  background-color: #ffffff;
  color: var(--text);
  padding: 12px;
  font-size: 14px;
  font-weight: 500;
}

/* Ensure Admin sidebar buttons match the modern active state */
.tab-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 500;
  font-size: 14px;
  width: 100%;
  text-align: left;
  transition: 0.2s background;
}

.tab-link:hover {
  background: rgba(255, 255, 255, 0.6);
  color: var(--text);
}

.tab-link.active {
  background: var(--primary);
  color: #ffffff;
  border: 1px solid var(--primary);
}

/* ACCORDION STYLES */
details.accordion-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-top-color: rgba(255, 255, 255, 0.8);
  border-radius: var(--radius);
  padding: 0;
  margin-bottom: 24px;
  overflow: hidden;
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  box-shadow: var(--shadow);
}

details.accordion-card>summary {
  padding: 20px 24px;
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
}

details.accordion-card[open]>summary {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

details.accordion-card>summary::-webkit-details-marker {
  display: none;
}

details.accordion-card>summary::after {
  content: '\ea6e';
  font-family: 'remixicon';
  margin-left: auto;
  font-weight: 400;
  font-size: 20px;
  transition: transform 0.2s ease;
  color: rgba(255, 255, 255, 0.7);
}

details.accordion-card[open]>summary::after {
  transform: rotate(180deg);
}

details.accordion-card .accordion-content {
  padding: 0;
}

@media print {
  @page {
    margin: 0;
  }

  body {
    margin: 1.6cm;
  }

  .modal-head {
    display: none !important;
  }
}

/* --- CUSTOM GLASS DROPDOWN UI --- */
.custom-dropdown {
  position: relative;
  width: 100%;
}

.dropdown-selected {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.dropdown-selected i {
  font-size: 18px;
  color: rgba(0, 0, 0, 0.6);
  transition: transform 0.2s;
}

.custom-dropdown.open .dropdown-selected i {
  transform: rotate(-180deg);
}

.dropdown-options {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.04);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
  border-radius: 16px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100;
}

.custom-dropdown.open .dropdown-options {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.dropdown-option {
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s;
}

.dropdown-option:hover {
  background: rgba(255, 255, 255, 0.5);
}

.dropdown-option.active {
  background: var(--primary);
  color: #ffffff;
}

/* =========================================
   NATIVE APP FEEL OPTIMIZATIONS
   ========================================= */
html,
body {
  -webkit-tap-highlight-color: transparent;
  /* Remove blue tap highlight on mobile */
  overscroll-behavior-y: none;
  /* Prevent pull-to-refresh bounce on the whole app */
  touch-action: pan-y;
  /* Optimize touch actions */
  -webkit-touch-callout: none;
  /* Prevent long-press menu on images/links */
}

/* Prevent text selection on interactive UI elements */
.btn,
.nav button,
.nav a,
.bottom-nav-link,
.topbar,
.sidebar,
.mobile-bottom-nav,
.user-chip,
.check {
  -webkit-user-select: none;
  user-select: none;
}

/* Fluid active touch states for interactive elements */
.btn:active,
.bottom-nav-link:active,
.nav button:active,
.nav a:active {
  transform: scale(0.96) !important;
  transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1) !important;
  opacity: 0.9;
}

/* Smooth scrolling for internal scrollable areas */
.main,
.content,
.history-content,
.apply-leave-card {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  /* Momentum scrolling on iOS */
}

/* Hide scrollbars completely on mobile for a cleaner native look */
@media (max-width: 768px) {
  ::-webkit-scrollbar {
    display: none;
  }

  * {
    scrollbar-width: none;
  }
}