/* ==========================================================================
   ADMIN PORTAL STYLES - ADMIN.CSS
   Desktop-first layout for employee management, shift config, logs & salary
   ========================================================================== */

.admin-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Admin Header --- */
.admin-navbar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--bg-card-border);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo-badge {
  background: #FFFFFF;
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  padding: 6px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast);
}

.brand-logo-badge:hover {
  transform: scale(1.02);
}

.brand-main-logo {
  height: 44px;
  width: auto;
  max-width: 175px;
  object-fit: contain;
  mix-blend-mode: multiply;
  display: block;
}

.brand-icon {
  width: 36px;
  height: 36px;
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--sage-900);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.brand-tagline {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 1px;
}

.admin-nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* --- Admin Main Content Container --- */
.admin-main {
  flex: 1;
  max-width: 1360px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 32px 60px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* --- Stats / KPI Overview Grid --- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-icon-box {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.kpi-sage { background: var(--sage-100); color: var(--sage-700); }
.kpi-rose { background: var(--rose-100); color: var(--rose-700); }
.kpi-amber { background: var(--amber-100); color: var(--amber-700); }
.kpi-neutral { background: var(--bg-subtle); color: var(--text-secondary); }

.kpi-info {
  display: flex;
  flex-direction: column;
}

.kpi-label {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

.kpi-value {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--sage-900);
  line-height: 1.2;
}

.kpi-subtext {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* --- Admin Navigation Tabs --- */
.tab-navigation {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid var(--bg-card-border);
  padding-bottom: 2px;
  overflow-x: auto;
}

.tab-btn {
  background: transparent;
  border: none;
  padding: 10px 20px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
  position: relative;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--sage-800);
  background: rgba(225, 235, 229, 0.4);
}

.tab-btn.active {
  color: var(--sage-800);
  background: var(--bg-surface);
  box-shadow: 0 -2px 6px rgba(36, 54, 45, 0.04);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--sage-600);
  border-radius: 3px 3px 0 0;
}

/* --- Tab Panels --- */
.tab-panel {
  display: none;
  animation: fadeIn 0.25s ease-in-out;
}
.tab-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Toolbar & Action Bar --- */
.toolbar-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.search-filter-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  flex: 1;
}

.search-input-wrapper {
  position: relative;
  min-width: 220px;
}
.search-input-wrapper input {
  padding-left: 36px;
}
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* --- Botanical Table Styles --- */
.table-container {
  background: var(--bg-surface);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table-floral {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.table-floral th {
  background: var(--bg-subtle);
  padding: 14px 18px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--bg-card-border);
}

.table-floral td {
  padding: 16px 18px;
  font-size: 0.92rem;
  color: var(--text-main);
  border-bottom: 1px solid var(--bg-card-border);
  vertical-align: middle;
}

.table-floral tr:last-child td {
  border-bottom: none;
}

.table-floral tr:hover td {
  background-color: var(--sage-50);
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: var(--sage-100);
  color: var(--sage-700);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  border: 1.5px solid var(--sage-300);
}

.user-details {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-weight: 600;
  color: var(--sage-900);
}

.user-id-slug {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: monospace;
}

.actions-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --- Personal Link Pill with Copy Button --- */
.link-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-subtle);
  border: 1px dashed var(--sage-400);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 0.8rem;
  font-family: monospace;
  color: var(--sage-800);
}

.copy-link-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--sage-600);
  display: inline-flex;
  padding: 2px;
  border-radius: 4px;
  transition: all var(--transition-fast);
}
.copy-link-btn:hover {
  color: var(--sage-900);
  background: var(--sage-100);
}

/* --- Shift Card Grid --- */
.shift-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.shift-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  transition: all var(--transition-fast);
}
.shift-card:hover {
  border-color: var(--sage-300);
  box-shadow: var(--shadow-md);
}

.shift-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.shift-name {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--sage-900);
}

.shift-time-badge {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--sage-700);
  background: var(--sage-50);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--sage-200);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* --- Salary Section Styles --- */
.salary-overview {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
}

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

.salary-results-card {
  background: var(--bg-surface);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.salary-summary-pill {
  background: var(--sage-50);
  border: 1px solid var(--sage-200);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.salary-amount {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--sage-800);
}

/* QR Code Modal Container */
.qr-modal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  padding: 10px 0;
}

.qr-frame {
  background: #FFFFFF;
  padding: 16px;
  border: 2px solid var(--sage-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.empty-state-icon {
  font-size: 2.5rem;
  color: var(--sage-300);
}

@media (max-width: 960px) {
  .admin-navbar {
    padding: 14px 18px;
  }
  .admin-main {
    padding: 20px 16px 40px;
  }
  .salary-overview {
    grid-template-columns: 1fr;
  }
  .toolbar-card {
    flex-direction: column;
    align-items: stretch;
  }
  .search-filter-group {
    flex-direction: column;
    align-items: stretch;
  }
  .table-container {
    overflow-x: auto;
  }
}

/* ==========================================================================
   12-HOUR AM/PM TIME PICKER COMPONENT
   ========================================================================== */
.time-picker-card {
  background: var(--bg-surface-elevated);
  border: 1.5px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  transition: border-color var(--transition-fast);
}
.time-picker-card:focus-within {
  border-color: var(--sage-400);
  box-shadow: 0 0 0 3px var(--sage-100);
}

.time-picker-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.time-select-wrap {
  flex: 1;
  position: relative;
}

.time-picker-select {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--sage-900);
  background: var(--bg-surface);
  border: 1.5px solid var(--sage-200);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  text-align: center;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23557E6B' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 24px;
}
.time-picker-select:focus {
  outline: none;
  border-color: var(--sage-500);
}

.time-colon {
  font-family: var(--font-sans);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--sage-600);
  line-height: 1;
  user-select: none;
}

/* Segmented AM / PM Toggle */
.ampm-segmented-toggle {
  display: inline-flex;
  background: var(--sage-100);
  border: 1.5px solid var(--sage-200);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
  user-select: none;
}

.ampm-btn {
  border: none;
  background: transparent;
  color: var(--sage-700);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.ampm-btn:hover:not(.active) {
  background: rgba(85, 126, 107, 0.12);
  color: var(--sage-900);
}

.ampm-btn.active {
  background: var(--sage-700);
  color: #FFFFFF;
  box-shadow: 0 2px 4px rgba(37, 60, 50, 0.25);
}

.time-preview-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--sage-700);
  background: var(--sage-50);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--sage-200);
}

/* ==========================================================================
   ATTENDANCE EXTENDED STATUS BADGES
   ========================================================================== */
.badge-half-day {
  background: #FFF8E6;
  color: #B45309;
  border: 1px solid #FDE68A;
}

.badge-paid-leave {
  background: #ECFDF5;
  color: #047857;
  border: 1px solid #A7F3D0;
}

.badge-unpaid-leave {
  background: var(--rose-50);
  color: var(--rose-700);
  border: 1px solid var(--rose-200);
}

.badge-on-duty {
  background: #EEF2FF;
  color: #4338CA;
  border: 1px solid #C7D2FE;
}

.badge-method-manual {
  background: #F4EFEA;
  color: #6B5D52;
  border: 1px solid #D5C9BA;
  font-size: 0.72rem;
}

.badge-method-qr {
  background: var(--sage-50);
  border: 1px solid var(--sage-200);
  color: var(--sage-800);
  font-size: 0.72rem;
}

/* Table Multi-Select & Checkboxes */
.checkbox-floral {
  width: 17px;
  height: 17px;
  accent-color: var(--sage-600);
  cursor: pointer;
  border-radius: 4px;
}

tr.row-selected {
  background: rgba(85, 126, 107, 0.08) !important;
}

/* ==========================================================================
   FLOATING BULK ACTION TOOLBAR
   ========================================================================== */
.bulk-actions-toolbar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--sage-900);
  color: #FFFFFF;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  box-shadow: 0 14px 38px rgba(27, 44, 36, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.15);
  animation: bulkSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 95vw;
  flex-wrap: wrap;
  justify-content: center;
}

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

.bulk-count-badge {
  background: var(--sage-700);
  color: #FFFFFF;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.bulk-btn {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #FFFFFF;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.bulk-btn:hover {
  background: rgba(255, 255, 255, 0.26);
  transform: translateY(-1px);
}

.bulk-btn-danger {
  background: rgba(210, 75, 98, 0.35);
  border-color: rgba(210, 75, 98, 0.6);
  color: #FCE6E9;
}

.bulk-btn-danger:hover {
  background: rgba(210, 75, 98, 0.55);
}

.bulk-btn-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  border-radius: 50%;
  transition: color var(--transition-fast);
}
.bulk-btn-close:hover {
  color: #FFFFFF;
}

/* Print Stylesheet */
@media print {
  body {
    background: #FFFFFF !important;
    color: #000000 !important;
  }
  .admin-navbar,
  .nav-tabs-wrapper,
  .toolbar-card,
  .bulk-actions-toolbar,
  .btn-ghost,
  .btn-3d,
  .actions-cell,
  #admin-modal-root {
    display: none !important;
  }
  .admin-main {
    padding: 0 !important;
    max-width: 100% !important;
  }
  .table-container {
    box-shadow: none !important;
    border: none !important;
  }
  .table-floral th,
  .table-floral td {
    padding: 8px 10px !important;
    border-bottom: 1px solid #E5E7EB !important;
    font-size: 0.85rem !important;
  }
}


