/* ════════════════════════════════════
   ATTENDANCE — Google Workspace Style
════════════════════════════════════ */

:root {
  --status-pending-bg:    rgba(251, 188, 4, 0.12);
  --status-pending-color: #b45309;
  --status-pending-border:rgba(251, 188, 4, 0.3);
  --status-approved-bg:   rgba(52, 168, 83, 0.1);
  --status-approved-color:#137333;
  --status-approved-border:rgba(52, 168, 83, 0.3);
  --status-rejected-bg:   rgba(234, 67, 53, 0.08);
  --status-rejected-color:#c5221f;
  --status-rejected-border:rgba(234, 67, 53, 0.25);

  --type-annual-bg:  rgba(26, 115, 232, 0.08);
  --type-annual-color: #1967d2;
  --type-half-bg:    rgba(103, 58, 183, 0.08);
  --type-half-color: #6200ea;
  --type-summer-bg:  rgba(0, 137, 123, 0.08);
  --type-summer-color: #00695c;
  --type-recog-bg:   rgba(95, 99, 104, 0.1);
  --type-recog-color:#5f6368;
}

.att-wrap { width: 100%; display: flex; flex-direction: column; }

/* Header */
.att-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 12px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.att-title { font-size: 20px; font-weight: 400; color: var(--text); margin-bottom: 4px; }
.att-desc  { font-size: 13px; color: var(--text-secondary); }

.att-apply-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 16px;
  background: var(--primary); color: #fff;
  border: none; border-radius: 4px;
  font-family: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
  transition: background 0.15s, box-shadow 0.15s;
  box-shadow: 0 1px 2px rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15);
  letter-spacing: 0.2px;
}
.att-apply-btn:hover { background: var(--primary-hover); box-shadow: 0 1px 3px rgba(60,64,67,.3), 0 4px 8px rgba(60,64,67,.15); }

/* Tabs — Google segmented control */
.att-tabs {
  display: flex; gap: 0;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  width: 100%;
}
.att-tab {
  padding: 10px 20px;
  border: none; border-bottom: 3px solid transparent;
  background: transparent; font-family: inherit;
  font-size: 13px; font-weight: 500;
  color: var(--text-secondary); cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap; margin-bottom: -1px;
}
.att-tab:hover  { color: var(--primary); background: var(--primary-light); border-radius: 4px 4px 0 0; }
.att-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }

/* Summary cards */
.att-summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; margin-bottom: 20px;
}
.att-sum-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  box-shadow: 0 1px 2px rgba(60,64,67,.15);
  display: flex; flex-direction: column; gap: 5px;
}
.att-sum-label {
  font-size: 11px; font-weight: 500; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.6px;
}
.att-sum-val { font-size: 26px; font-weight: 400; color: var(--text); line-height: 1; }
.att-sum-val span { font-size: 12px; font-weight: 400; color: var(--text-secondary); margin-left: 2px; }
.att-sum-sub { font-size: 12px; color: var(--text-secondary); }
.att-sum-bar { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; margin-top: 4px; }
.att-sum-bar-fill { height: 100%; border-radius: 2px; background: var(--primary); transition: width 0.4s var(--ease); }
.att-sum-card.summer .att-sum-bar-fill { background: var(--google-green); }
.att-sum-card.recog  .att-sum-bar-fill { background: var(--muted); }

/* Section */
.att-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden; margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(60,64,67,.15);
}
.att-section-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  background: var(--bg-secondary);
}
.att-section-title { font-size: 14px; font-weight: 500; color: var(--text); }
.att-section-count { font-size: 12px; color: var(--muted); }

/* Filters */
.att-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.att-filter-select {
  padding: 6px 10px; border: 1px solid var(--border);
  border-radius: 4px; font-family: inherit;
  font-size: 13px; color: var(--text);
  background: var(--bg-secondary); cursor: pointer; outline: none;
  transition: border-color 0.15s;
}
.att-filter-select:focus { border-color: var(--primary); border-width: 2px; }
.att-search-input {
  padding: 6px 11px; border: 1px solid var(--border);
  border-radius: 24px; font-family: inherit;
  font-size: 13px; color: var(--text);
  background: var(--bg-secondary); outline: none; transition: border-color 0.15s;
  min-width: 160px;
}
.att-search-input:focus { border-color: var(--primary); border-width: 2px; }

/* Table */
.att-table-wrap { overflow-x: auto; }
.att-table { width: 100%; border-collapse: collapse; min-width: 560px; }
.att-table th {
  padding: 10px 16px;
  font-size: 11px; font-weight: 500; color: var(--text-secondary);
  text-align: left; text-transform: uppercase; letter-spacing: 0.6px;
  background: var(--bg); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.att-table td {
  padding: 12px 16px; font-size: 13px; color: var(--text);
  border-bottom: 1px solid var(--border-light); vertical-align: middle;
}
.att-table tr:last-child td { border-bottom: none; }
.att-table tbody tr { transition: background 0.1s; }
.att-table tbody tr:hover { background: var(--bg); }

/* Badges */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 8px; border-radius: 99px;
  font-size: 11px; font-weight: 500; white-space: nowrap;
}
.badge-pending  { background: var(--status-pending-bg);  color: var(--status-pending-color);  border: 1px solid var(--status-pending-border); }
.badge-approved { background: var(--status-approved-bg); color: var(--status-approved-color); border: 1px solid var(--status-approved-border); }
.badge-rejected { background: var(--status-rejected-bg); color: var(--status-rejected-color); border: 1px solid var(--status-rejected-border); }
.badge-annual   { background: var(--type-annual-bg);  color: var(--type-annual-color); }
.badge-half     { background: var(--type-half-bg);    color: var(--type-half-color); }
.badge-summer   { background: var(--type-summer-bg);  color: var(--type-summer-color); }
.badge-recog    { background: var(--type-recog-bg);   color: var(--type-recog-color); }

/* Action buttons */
.att-action-btns { display: flex; gap: 4px; }

.btn-approve, .btn-reject, .btn-delete, .btn-edit {
  padding: 4px 10px; border-radius: 4px;
  font-family: inherit; font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all 0.12s; border: 1px solid;
}
.btn-approve { background: var(--status-approved-bg); color: var(--status-approved-color); border-color: var(--status-approved-border); }
.btn-approve:hover { background: #137333; color: #fff; border-color: #137333; }
.btn-reject  { background: var(--status-rejected-bg); color: var(--status-rejected-color); border-color: var(--status-rejected-border); }
.btn-reject:hover  { background: #c5221f; color: #fff; border-color: #c5221f; }
.btn-delete  { background: transparent; color: var(--text-secondary); border-color: var(--border); }
.btn-delete:hover  { background: var(--status-rejected-bg); color: #c5221f; border-color: var(--status-rejected-border); }
.btn-edit    { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-border); }
.btn-edit:hover    { background: var(--primary); color: #fff; }

/* Empty state */
.att-empty { text-align: center; padding: 48px 20px; color: var(--muted); font-size: 13px; }
.att-empty svg { display: block; margin: 0 auto 12px; opacity: 0.3; }

/* Modal */
.att-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(32,33,36,0.4);
  z-index: 500;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: overlayFade 0.2s var(--ease);
}
@keyframes overlayFade { from { opacity: 0; } to { opacity: 1; } }

.att-modal {
  background: var(--bg-secondary); border-radius: 8px;
  padding: 24px; width: 100%; max-width: 460px;
  box-shadow: 0 24px 38px 3px rgba(0,0,0,.14), 0 9px 46px 8px rgba(0,0,0,.12);
  display: flex; flex-direction: column; gap: 18px;
  animation: modalSlide 0.2s var(--ease);
}
@keyframes modalSlide { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }

.att-modal-header { display: flex; align-items: center; justify-content: space-between; }
.att-modal-title { font-size: 16px; font-weight: 400; color: var(--text); }
.att-modal-close {
  width: 36px; height: 36px; border-radius: 50%;
  border: none; background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); transition: background 0.15s;
}
.att-modal-close:hover { background: var(--bg); color: var(--text); }

/* Modal form */
.att-form-grid { display: flex; flex-direction: column; gap: 14px; }
.att-form-row { display: flex; flex-direction: column; gap: 5px; }
.att-form-row label { font-size: 12px; font-weight: 500; color: var(--text-secondary); }

.att-form-row select,
.att-form-row input,
.att-form-row textarea {
  padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 4px; font-family: inherit;
  font-size: 14px; color: var(--text); background: var(--bg-secondary);
  outline: none; transition: border-color 0.15s; width: 100%;
}
.att-form-row select:focus,
.att-form-row input:focus,
.att-form-row textarea:focus { border-color: var(--primary); border-width: 2px; }
.att-form-row textarea { resize: vertical; min-height: 72px; }

.att-date-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: end; }
.att-date-row .att-date-sep { padding-bottom: 10px; text-align: center; color: var(--muted); font-size: 13px; }

.att-form-info {
  background: var(--primary-soft); border: 1px solid var(--primary-border);
  border-radius: 4px; padding: 10px 13px;
  font-size: 12px; color: var(--primary); line-height: 1.6;
}

.att-modal-footer { display: flex; gap: 8px; justify-content: flex-end; }

.btn-modal-cancel {
  padding: 8px 18px; border-radius: 4px;
  border: 1px solid transparent; background: transparent;
  font-family: inherit; font-size: 14px; font-weight: 500;
  color: var(--primary); cursor: pointer; transition: background 0.15s;
}
.btn-modal-cancel:hover { background: var(--primary-light); }

.btn-modal-submit {
  padding: 8px 18px; border-radius: 4px;
  border: none; background: var(--primary);
  font-family: inherit; font-size: 14px; font-weight: 500;
  color: #fff; cursor: pointer; transition: background 0.15s;
  box-shadow: 0 1px 2px rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15);
}
.btn-modal-submit:hover { background: var(--primary-hover); }
.btn-modal-submit.danger { background: #c5221f; }
.btn-modal-submit.danger:hover { background: #a50e0e; }

/* User cell */
.att-user-cell { display: flex; align-items: center; gap: 9px; }
.att-user-av {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.att-user-name { font-weight: 500; font-size: 13px; }
.att-user-dept { font-size: 11px; color: var(--muted); }

/* Pagination */
.att-pagination {
  display: flex; justify-content: center; align-items: center;
  gap: 4px; padding: 14px;
  border-top: 1px solid var(--border);
}
.att-page-btn {
  min-width: 32px; height: 32px; border-radius: 4px;
  border: none; background: transparent;
  font-family: inherit; font-size: 13px; font-weight: 500;
  color: var(--text-secondary); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.12s; padding: 0 6px;
}
.att-page-btn:hover  { background: var(--bg); color: var(--text); }
.att-page-btn.active { background: var(--primary-light); color: var(--primary); font-weight: 500; }
.att-page-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* Reject reason */
.att-reason {
  font-size: 12px; color: var(--status-rejected-color);
  background: var(--status-rejected-bg);
  border: 1px solid var(--status-rejected-border);
  border-radius: 4px; padding: 2px 7px;
  display: inline-block; max-width: 160px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: help;
}

/* Toast */
.att-toast {
  position: fixed; bottom: 24px; right: 24px;
  background: #202124; color: #fff;
  padding: 10px 16px; border-radius: 4px;
  font-size: 13px; font-weight: 500;
  box-shadow: 0 3px 5px -1px rgba(0,0,0,.2), 0 6px 10px rgba(0,0,0,.14), 0 1px 18px rgba(0,0,0,.12);
  z-index: 9999; opacity: 0; transform: translateY(10px);
  transition: all 0.2s var(--ease); pointer-events: none;
}
.att-toast.show  { opacity: 1; transform: translateY(0); }
.att-toast.success { background: #137333; }
.att-toast.error   { background: #c5221f; }

/* Staff overview cards */
.staff-filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }

.staff-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.staff-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 14px; display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 1px 2px rgba(60,64,67,.15);
  transition: box-shadow 0.15s, border-color 0.15s;
}
.staff-card:hover { box-shadow: 0 1px 3px rgba(60,64,67,.3), 0 4px 8px rgba(60,64,67,.15); border-color: #c0c4c9; }

.staff-card-top { display: flex; align-items: center; gap: 10px; }
.staff-av {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 500; color: #fff; flex-shrink: 0;
}
.staff-info { flex: 1; min-width: 0; }
.staff-name { font-size: 13px; font-weight: 500; color: var(--text); }
.staff-meta { font-size: 11px; color: var(--muted); margin-top: 2px; display: flex; align-items: center; gap: 5px; }
.staff-pending-badge {
  padding: 2px 8px; border-radius: 99px;
  background: var(--status-pending-bg); color: var(--status-pending-color);
  border: 1px solid var(--status-pending-border);
  font-size: 10px; font-weight: 500; white-space: nowrap; flex-shrink: 0;
}

.staff-card-stats { display: flex; flex-direction: column; gap: 8px; }
.staff-stat-row {
  display: grid; grid-template-columns: 28px 1fr 68px 36px;
  align-items: center; gap: 8px;
}
.staff-stat-label { font-size: 11px; font-weight: 500; color: var(--muted); text-align: center; white-space: nowrap; }
.staff-stat-bar   { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.staff-stat-fill  { height: 100%; border-radius: 3px; transition: width 0.4s var(--ease); }
.annual-fill { background: var(--primary); }
.summer-fill { background: var(--google-green); }
.staff-stat-nums { font-size: 12px; color: var(--text-secondary); text-align: right; white-space: nowrap; }
.staff-stat-nums b { color: var(--text); font-weight: 500; }
.staff-stat-pct  { font-size: 11px; font-weight: 500; color: var(--muted); text-align: right; white-space: nowrap; }

/* Responsive */
@media (max-width: 640px) {
  .att-summary-cards { grid-template-columns: 1fr 1fr; }
  .att-header { flex-direction: column; align-items: flex-start; }
  .att-tabs { overflow-x: auto; }
  .att-modal { padding: 18px; }
  .att-date-row { grid-template-columns: 1fr; }
  .att-date-row .att-date-sep { display: none; }
  .staff-cards-grid { grid-template-columns: 1fr; }
}
