/* =========================================================
   Alhamd Overseas — Admin Panel Design System
   ========================================================= */
:root {
  --brand-900: #0b2e4f;
  --brand-800: #0e3a63;
  --brand-700: #124a7d;
  --brand-600: #175d9c;
  --brand-500: #1c71bc;
  --brand-100: #e8f1fb;
  --ink-900: #16202b;
  --ink-700: #3c4a58;
  --ink-500: #64748b;
  --ink-300: #cbd5e1;
  --surface: #f4f7fb;
  --card-border: #e6ebf2;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 4px 14px rgba(16, 24, 40, 0.08);
  --sidebar-w: 268px;
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--surface);
  color: var(--ink-900);
  font-size: 0.925rem;
  -webkit-font-smoothing: antialiased;
}

.purple, .text-purple { color: #7c3aed; }
.bg-purple { background-color: #7c3aed; }
.bg-purple-subtle { background-color: #ede9fe; }
.text-purple-emphasis { color: #6d28d9; }
.text-orange { color: #ea580c; }
.bg-orange-subtle { background-color: #ffedd5; }

/* ===== Layout ===== */
.app-wrapper { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--brand-900) 0%, #0a2540 100%);
  color: #fff;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 1030;
  transition: transform 0.25s ease;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

.sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 22px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logo-badge {
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-shadow: var(--shadow-sm);
}
.sidebar-logo-img {
  max-width: 100%;
  height: 30px;
  width: auto;
  display: block;
}
.brand-name { font-weight: 700; font-size: 0.98rem; line-height: 1.2; }
.brand-sub { font-size: 0.72rem; color: rgba(255,255,255,0.55); letter-spacing: 0.03em; text-transform: uppercase; }

.sidebar-nav { padding: 12px 12px 30px; }
.nav-section-title {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.35);
  padding: 16px 12px 6px;
  font-weight: 600;
}
.sidebar-nav .nav-link {
  color: rgba(255,255,255,0.75);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.87rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 2px;
  transition: background 0.15s ease, color 0.15s ease;
}
.sidebar-nav .nav-link i { font-size: 1.05rem; width: 20px; text-align: center; opacity: 0.85; }
.sidebar-nav .nav-link:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar-nav .nav-link.active {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.sidebar-nav .nav-link.active i { opacity: 1; }

.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(10, 20, 35, 0.5);
  z-index: 1020;
}

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ===== Topbar ===== */
.topbar {
  height: 68px;
  background: #fff;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 1010;
}
.topbar-search {
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  width: 320px;
}
.topbar-search i { color: var(--ink-500); }
.topbar-search input {
  border: none; background: transparent; padding: 0 6px; margin: 0; font-size: 0.85rem;
  line-height: normal; height: auto;
  -webkit-appearance: none; appearance: none;
}
.topbar-search input:focus { box-shadow: none; }
.topbar-search input::-webkit-search-decoration,
.topbar-search input::-webkit-search-cancel-button,
.topbar-search input::-webkit-search-results-button,
.topbar-search input::-webkit-search-results-decoration {
  -webkit-appearance: none;
}

/* Compact search box used inside card-header table toolbars (distinct from the large global topbar search) */
.table-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  height: 36px;
  padding: 0 12px;
  width: 260px;
  max-width: 100%;
}
.table-search-box i {
  color: var(--ink-500);
  font-size: 0.85rem;
  flex-shrink: 0;
}
.table-search-box input {
  border: none;
  background: transparent;
  padding: 0 6px;
  font-size: 0.82rem;
  width: 100%;
  min-width: 0;
}
.table-search-box input:focus { box-shadow: none; outline: none; }

.btn-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-700);
}
.btn-icon:hover { background: var(--surface); }
.notif-dot {
  position: absolute; top: 9px; right: 10px;
  width: 8px; height: 8px; border-radius: 50%;
  background: #ef4444; border: 2px solid #fff;
}
.notif-badge {
  position: absolute; top: 2px; right: 2px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: #ef4444; color: #fff;
  font-size: 0.65rem; font-weight: 600; line-height: 16px; text-align: center;
  border: 2px solid #fff;
}
.notif-dropdown {
  width: 400px;
  max-width: 92vw;
  padding: 0;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px rgba(16, 24, 40, 0.14);
  overflow: hidden;
}
.notif-dropdown-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--card-border);
}
.notif-dropdown-title { font-weight: 700; font-size: 0.95rem; color: var(--ink-900); }
.notif-mark-all-btn {
  background: none; border: none; padding: 0; flex-shrink: 0;
  font-size: 0.78rem; font-weight: 600; color: var(--brand-500);
  cursor: pointer;
}
.notif-mark-all-btn:hover { color: var(--brand-700); text-decoration: underline; }
.notif-mark-all-btn:disabled { color: var(--ink-300); cursor: default; text-decoration: none; }

.notif-scroll-area { max-height: 380px; overflow-y: auto; }

.notif-empty {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 40px 16px;
  color: var(--ink-500);
  font-size: 0.85rem;
  text-align: center;
}
.notif-empty i { font-size: 1.7rem; color: var(--ink-300); }

.notif-item {
  display: flex; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--card-border);
  transition: background 0.15s ease;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--surface); }
.notif-item.is-unread { background: var(--brand-100); }
.notif-item.is-unread:hover { background: #dceafb; }

.notif-item-icon {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}
.notif-item-body { min-width: 0; flex: 1; }
.notif-item-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.notif-item-title {
  font-size: 0.85rem; font-weight: 600; color: var(--ink-900);
  white-space: normal; word-break: break-word;
}
.notif-item.is-unread .notif-item-title { font-weight: 700; }
.notif-item-badge {
  flex-shrink: 0;
  font-size: 0.65rem; font-weight: 700;
  padding: 3px 8px; border-radius: 999px;
  white-space: nowrap;
}
.notif-item-meta {
  display: flex; align-items: center; gap: 5px;
  margin-top: 4px;
  font-size: 0.72rem; color: var(--ink-500);
}

.notif-dropdown-footer { padding: 10px 12px; border-top: 1px solid var(--card-border); }
.notif-dropdown-footer .btn { font-weight: 600; }
.topbar-user { padding: 6px 8px; border-radius: var(--radius-md); }
.topbar-user:hover { background: var(--surface); }
.user-name { font-size: 0.85rem; color: var(--ink-900); }
.user-role { font-size: 0.72rem; color: var(--ink-500); }

.avatar-circle {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-800));
  color: #fff; font-weight: 700;
  flex-shrink: 0;
}
.avatar-photo { object-fit: cover; }

/* ===== Page content ===== */
.page-content { padding: 26px 28px 10px; flex: 1; }
.app-footer {
  padding: 16px 28px;
  font-size: 0.8rem;
  color: var(--ink-500);
  border-top: 1px solid var(--card-border);
}
.breadcrumb-item a { color: var(--ink-500); text-decoration: none; }
.breadcrumb-item.active { color: var(--ink-900); font-weight: 500; }

/* ===== Cards ===== */
.card {
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-header {
  background: #fff;
  border-bottom: 1px solid var(--card-border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
  font-weight: 600;
  padding: 16px 20px;
}
.card-body { padding: 20px; }

.stat-card .card-body { padding: 12px 16px; gap: 0.65rem !important; }
.stat-icon {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}
.stat-value { font-size: 1.15rem; font-weight: 800; line-height: 1.2; color: var(--ink-900); }
.stat-label { font-size: 0.72rem; color: var(--ink-500); margin-top: 1px; }
.stat-trend { color: #16a34a; font-weight: 600; font-size: 0.72rem; }

/* ===== Tables ===== */
.table-card { overflow: visible !important; }
.table-card .card-body { padding: 0; }
.table-card .table-responsive {
  overflow-x: auto;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.table { margin-bottom: 0; }
.table thead th {
  background: #fafbfd;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-500);
  font-weight: 600;
  border-bottom: 1px solid var(--card-border);
  padding: 8px 14px;
  white-space: nowrap;
}
.table tbody td {
  padding: 7px 14px;
  vertical-align: middle;
  border-bottom: 1px solid #f0f2f6;
  font-size: 0.83rem;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #fafbfd; }
.table thead th.sortable-col { cursor: pointer; user-select: none; }
.table thead th.sortable-col:hover { color: var(--ink-900); }
.table thead th .sort-icon { font-size: 0.72rem; margin-left: 4px; opacity: 0.35; vertical-align: 0; }
.table thead th.sort-asc .sort-icon, .table thead th.sort-desc .sort-icon { opacity: 1; color: var(--primary, #4f46e5); }
.table-name-cell { display: flex; align-items: center; gap: 10px; }
.table-name-sub { font-size: 0.76rem; color: var(--ink-500); }

.badge-status {
  font-weight: 600;
  font-size: 0.72rem;
  padding: 5px 10px;
  border-radius: 20px;
}

.badge-status-lg {
  font-weight: 700;
  font-size: 0.82rem;
  padding: 7px 14px;
  border-radius: 20px;
  letter-spacing: 0.02em;
}

.monthly-hours-trigger {
  background: #fafbfd;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  transition: background-color .15s ease, border-color .15s ease;
}
.monthly-hours-trigger:hover {
  background: #f0f2f6;
  border-color: var(--ink-500);
}

/* ===== Forms ===== */
.form-label { font-weight: 600; font-size: 0.83rem; color: var(--ink-700); }
.form-control, .form-select {
  border-radius: var(--radius-sm);
  border-color: var(--card-border);
  font-size: 0.87rem;
}
.form-control {
  padding: 9px 12px;
}
.form-select {
  padding-top: 9px;
  padding-bottom: 9px;
  padding-left: 12px;
  /* padding-right is intentionally left to Bootstrap's default — it reserves room for the native chevron icon */
}
.form-select.form-select-sm {
  height: 36px;
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px var(--brand-100);
}
.form-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink-900);
  margin-bottom: 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--card-border);
}
.required-mark { color: #ef4444; }

/* ===== Buttons ===== */
.btn { border-radius: var(--radius-sm); font-weight: 600; font-size: 0.85rem; padding: 9px 16px; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-primary {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  border: none;
}
.btn-primary:hover { background: linear-gradient(135deg, var(--brand-600), var(--brand-800)); }
.btn-outline-secondary { border-color: var(--card-border); color: var(--ink-700); }
.btn-light-icon {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
  background: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-700);
}
.btn-light-icon:hover { background: var(--surface); box-shadow: var(--shadow-sm); }
.btn-light-icon.text-primary:hover { background: var(--brand-100); }
.btn-light-icon.text-warning:hover { background: #fef3c7; }
.btn-light-icon.text-success:hover { background: #dcfce7; }
.btn-light-icon.text-danger:hover { background: #fee2e2; }

/* ===== Segmented status-filter tabs (e.g. Assets Inventory) ===== */
.status-tabs {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 2px;
}
.status-tabs .btn {
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-700);
  font-weight: 600;
  padding: 6px 16px;
  font-size: 0.8rem;
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.status-tabs .btn:hover:not(.active) { background: #fff; color: var(--ink-900); }
.status-tabs .btn.active {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: #fff;
  box-shadow: var(--shadow-sm);
}

/* ===== Month filter (Notifications & OT Management "Filter by month") ===== */
.month-pill-custom { border-radius: var(--radius-md); }
.month-pill-custom:hover { border-color: var(--brand-500); cursor: pointer; }

/* ===== Roomier table rows for cells with richer content (avatars, dropdowns, 2-line text) ===== */
.table-roomy tbody td { padding: 12px 16px; }
.table-roomy .form-select-sm { border-radius: var(--radius-sm); }
.table-roomy select.form-select-sm:hover { border-color: var(--brand-500); cursor: pointer; }

/* ===== Table pagination ===== */
.table-pagination {
  margin-top: 4px;
  padding: 16px 20px;
  border-top: 1px solid var(--card-border);
}
.table-pagination-summary {
  font-size: 0.8rem;
  color: var(--ink-500);
}
.table-pagination-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.table-pagination-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
  background: #fff;
  color: var(--ink-700);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.table-pagination-btn:hover:not(:disabled) {
  background: var(--surface);
  border-color: var(--ink-300);
}
.table-pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.table-pagination-pages {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0 4px;
}
.table-pagination-page-btn {
  min-width: 30px;
  height: 30px;
  padding: 0 6px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-700);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.table-pagination-page-btn:hover:not(.active) {
  background: var(--surface);
  border-color: var(--card-border);
}
.table-pagination-page-btn.active {
  background: var(--brand-500);
  border-color: var(--brand-500);
  color: #fff;
  cursor: default;
}
.table-pagination-ellipsis {
  color: var(--ink-300);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0 4px;
  user-select: none;
}

/* ===== Progress ===== */
.progress { height: 8px; border-radius: 10px; background: #eef1f6; }
.progress-bar { border-radius: 10px; }

/* ===== Steps / checklist ===== */
.checklist-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
}
.checklist-item.done { background: #f0fdf4; border-color: #bbf7d0; }
.checklist-icon { font-size: 1.2rem; }

/* ===== Login credential card ===== */
.credential-pill {
  background: var(--surface);
  border: 1px dashed var(--ink-300);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
}

/* ===== Payslip ===== */
.payslip-box { border: 1px solid var(--card-border); border-radius: var(--radius-lg); overflow: hidden; }
.payslip-head { background: var(--brand-900); color: #fff; padding: 24px; }
.payslip-table td { padding: 8px 4px; font-size: 0.87rem; }

/* ===== Utilities ===== */
.section-divider { border-top: 1px solid var(--card-border); margin: 24px 0; }
.fw-700 { font-weight: 700; }
.text-brand { color: var(--brand-600); }
.cursor-pointer { cursor: pointer; }

/* ===== Auth pages (Login) ===== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top left, #124a7d 0%, var(--brand-900) 45%, #081b2e 100%);
  padding: 24px;
}
.auth-wrapper { width: 100%; max-width: 440px; }
.auth-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(4, 20, 40, 0.35);
  padding: 36px 32px;
}
.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 28px;
}
.auth-logo-img { height: 34px; width: auto; }
.auth-brand .brand-sub { font-size: 0.78rem; color: var(--ink-500); letter-spacing: 0.03em; text-transform: uppercase; }
.auth-hint {
  font-size: 0.78rem;
  color: var(--ink-500);
  background: var(--surface);
  border: 1px dashed var(--ink-300);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

/* ===== Dashboard widgets: hover + entrance animation ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.dash-animate {
  animation: fadeInUp 0.45s ease both;
}
.stat-card, .widget-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-card:hover, .widget-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.stat-card .stat-icon {
  transition: transform 0.25s ease;
}
.stat-card:hover .stat-icon {
  transform: scale(1.08) rotate(-4deg);
}

/* ===== Clickable stat cards (drive a filter on the list below) ===== */
.stat-card-clickable {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.stat-card-clickable:focus-visible {
  outline: 2px solid var(--bs-primary);
  outline-offset: 2px;
}
.stat-card-clickable.active {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.16), var(--shadow-md);
}
.stat-card-clickable.active .stat-value {
  color: var(--bs-primary);
}

/* ===== Attendance: Sync Now button spinner ===== */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.spin {
  display: inline-block;
  animation: spin 0.8s linear infinite;
}

.activity-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f0f2f6;
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
}
.birthday-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  transition: background 0.15s ease;
}
.birthday-item:hover { background: var(--surface); }
.announcement-item {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  margin-bottom: 10px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.announcement-item:hover { border-color: var(--brand-500); background: var(--brand-100); }
.quick-action-btn {
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.quick-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* ===== Responsive ===== */
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .sidebar-backdrop.show { display: block; }
  .main-content { margin-left: 0; }
  .page-content { padding: 18px 16px 6px; }
  .topbar { padding: 0 16px; }
}

@media (max-width: 575.98px) {
  .stat-value { font-size: 1.25rem; }
  .card-body { padding: 16px; }
}

/* Date inputs: pointer cursor for full box click */
input[type="date"],
input[type="datetime-local"] {
  cursor: pointer;
}

