/* Cidersoft HR Platform — Main CSS */
:root {
  --navy: #0f1a2e;
  --navy-light: #162340;
  --blue: #2563eb;
  --blue-hover: #1d4ed8;
  --orange: #f97316;
  --orange-hover: #ea6c0a;
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-400: #94a3b8;
  --gray-600: #475569;
  --gray-800: #1e293b;
  --red: #ef4444;
  --green: #22c55e;
  --sidebar-w: 240px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  color: var(--gray-800);
  background: var(--gray-50);
  line-height: 1.5;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── LOGIN PAGE ─────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #334155;
}

.login-card {
  background: var(--white);
  border-radius: 12px;
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo .brand-name {
  font-size: 24px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.5px;
}

.login-logo .brand-sub {
  font-size: 12px;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}

.login-card h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 24px;
}

/* ── FORMS ──────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-600);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  font-size: 14px;
  color: var(--gray-800);
  background: var(--white);
  transition: border-color 0.15s;
  outline: none;
}
.form-control:focus { border-color: var(--blue); }
.form-control.error { border-color: var(--red); }

select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 100px; }

.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }

/* ── BUTTONS ────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }

.btn-primary { background: var(--blue); color: var(--white); }
.btn-primary:hover { background: var(--blue-hover); }

.btn-orange { background: var(--orange); color: var(--white); }
.btn-orange:hover { background: var(--orange-hover); }

.btn-danger { background: var(--red); color: var(--white); }
.btn-danger:hover { background: #dc2626; }

.btn-ghost {
  background: transparent;
  color: var(--gray-600);
  border: 1.5px solid var(--gray-200);
}
.btn-ghost:hover { background: var(--gray-100); }

.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }

/* ── ALERTS ─────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 13px;
}
.alert-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* ── ADMIN LAYOUT ───────────────────────────── */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  color: #0f172a;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid #e2e8f0;
}

.sidebar-brand { display: flex; align-items: center;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.3px;
}

.sidebar-logo { height: 32px !important; max-height: 32px; width: auto !important; max-width: 120px; margin-right: 6px; object-fit: contain; }

.sidebar-role {
  font-size: 11px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}

.sidebar-nav { flex: 1; padding: 16px 0; }

.nav-section-label {
  padding: 12px 20px 6px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #94a3b8;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: #334155;
  font-size: 14px;
  transition: background 0.1s, color 0.1s;
  text-decoration: none;
}
.nav-link:hover { background: #e2e8f0; color: #0f172a; text-decoration: none; }
.nav-link.active { background: #dbeafe; color: #1d4ed8; }
.nav-link .icon { width: 18px; text-align: center; font-size: 15px; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid #e2e8f0;
}

.sidebar-user { font-size: 13px; color: rgba(255,255,255,0.6); margin-bottom: 8px; }
.sidebar-user strong { display: block; color: var(--white); }

/* ── MAIN CONTENT ───────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: #ffffff;
}

.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title { font-size: 18px; font-weight: 600; color: var(--gray-800); }
.topbar-actions { display: flex; gap: 10px; align-items: center; }

.page-content { padding: 28px; }

/* ── STATS CARDS ────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--white);
  border-radius: 10px;
  padding: 20px 24px;
  border: 1px solid var(--gray-200);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}

.stat-label {
  font-size: 13px;
  color: var(--gray-400);
  margin-top: 6px;
}

.stat-card.blue { border-top: 3px solid var(--blue); }
.stat-card.orange { border-top: 3px solid var(--orange); }
.stat-card.green { border-top: 3px solid var(--green); }
.stat-card.navy { border-top: 3px solid var(--navy); }

/* ── TABLES ─────────────────────────────────── */
.table-card {
  background: var(--white);
  border-radius: 10px;
  border: 1px solid var(--gray-200);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  overflow: hidden;
  margin-bottom: 24px;
}

.table-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.table-header h3 { font-size: 15px; font-weight: 600; color: var(--gray-800); }

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  background: var(--gray-50);
  padding: 10px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-400);
  border-bottom: 1px solid var(--gray-200);
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-800);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--gray-50); }

/* ── BADGES ─────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-green { background: #dcfce7; color: #166534; }
.badge-orange { background: #ffedd5; color: #c2410c; }
.badge-red { background: #fee2e2; color: #b91c1c; }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }
.badge-navy { background: #dbeafe; color: var(--navy); }

/* ── MODAL ──────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.show { display: flex; }

.modal {
  background: var(--white);
  border-radius: 12px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0,0,0,0.3);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 { font-size: 16px; font-weight: 600; }

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--gray-400);
  line-height: 1;
  padding: 2px 6px;
}
.modal-close:hover { color: var(--gray-800); }

.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ── AVATAR ─────────────────────────────────── */
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--blue);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.client-logo {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: contain;
  border: 1px solid var(--gray-200);
}

/* ── EMPTY STATE ────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--gray-400);
}
.empty-state .empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; margin-bottom: 16px; }

/* ── PAGE HEADER ────────────────────────────── */
.page-header {
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header h1 { font-size: 22px; font-weight: 700; color: var(--gray-800); }
.page-header p { font-size: 14px; color: var(--gray-400); margin-top: 2px; }

/* ── FORM PAGE ──────────────────────────────── */
.form-card {
  background: var(--white);
  border-radius: 10px;
  border: 1px solid var(--gray-200);
  padding: 28px;
  max-width: 640px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* ── HAMBURGER (mobile) ─────────────────────── */
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--gray-800);
}

/* Mobile styles moved to end of file */

/* ── UTILS ──────────────────────────────────── */
.text-muted { color: var(--gray-400); }
.text-sm { font-size: 12px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 20px; }
.mb-0 { margin-bottom: 0; }

/* ===== Card Components ===== */
.card { background: var(--white); border: 1px solid var(--gray-border, #e5e7eb); border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); margin-bottom: 20px; overflow: hidden; }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--gray-border, #e5e7eb); }
.card-title { font-size: 15px; font-weight: 700; color: var(--navy); }
.card-body { padding: 20px; }

/* ===== Content wrapper ===== */
.content { padding: 24px 28px; flex: 1; overflow-y: auto; padding-bottom: 60px; }

/* ===== Utility ===== */
.text-muted { color: var(--gray-400, #9ca3af); font-size: 13.5px; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }


/* ═══════════════════════════════════════════════════════
   MOBILE RESPONSIVE OVERHAUL — 2026-04-03
   Targets: 320px–768px (phones), 768px–1024px (tablets)
═══════════════════════════════════════════════════════ */

/* ── Tables: horizontal scroll on mobile ── */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 0 0 12px 12px;
}

/* ── Topbar ── */
@media (max-width: 768px) {

  /* Layout & sidebar */
  .sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100%;
    z-index: 300;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 299;
  }
  .sidebar-overlay.show { display: block; }
  .main-content { margin-left: 0 !important; }
  .app-layout .main-content { margin-left: 0 !important; }
  .sidebar-toggle, .btn-menu { display: block !important; }

  /* Topbar */
  .topbar { padding: 0 12px; height: 52px; }
  .topbar-title { font-size: 15px; }
  .topbar-actions { gap: 6px; }
  .topbar-actions .btn { padding: 6px 10px; font-size: 12px; }

  /* Page content */
  .page-content { padding: 12px; }
  .content { padding: 12px; padding-bottom: 60px; }

  /* Stats grid: 2 columns */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .stat-card { padding: 14px 12px; }
  .stat-value { font-size: 26px; }
  .stat-label { font-size: 11px; }

  /* Cards */
  .card-header { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  .card-body { padding: 14px 16px; }
  .card-title { font-size: 14px; }

  /* Tables: wrap in scrollable container */
  .data-table { min-width: 540px; }
  .table-card > div[style*="overflow"] { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-card > div > .data-table { min-width: 540px; }

  /* Force table wrappers to scroll */
  .table-card { overflow: hidden; }
  .table-card > div { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Forms */
  .form-row { flex-direction: column; gap: 0; }
  .form-group { margin-bottom: 14px; }
  .form-control { font-size: 16px; } /* prevents iOS zoom */

  /* Buttons */
  .btn { padding: 9px 14px; font-size: 13px; min-height: 40px; }
  .btn-sm { padding: 6px 10px; font-size: 12px; min-height: 32px; }

  /* Modals: full screen on mobile */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal {
    max-width: 100%;
    width: 100%;
    max-height: 92vh;
    border-radius: 16px 16px 0 0;
    overflow-y: auto;
  }
  .modal-body { padding: 16px; }
  .modal-footer { padding: 12px 16px; flex-wrap: wrap; }
  .modal-header { padding: 16px; }

  /* Kanban: horizontal scroll */
  .kanban-board, [class*="kanban"] > div {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .kanban-col-styled {
    min-width: 260px;
    flex-shrink: 0;
  }

  /* Table headers: hide less important columns */
  .data-table th:nth-child(n+5),
  .data-table td:nth-child(n+5) {
    display: none;
  }

  /* Action buttons in tables: stack vertically */
  .data-table td .flex,
  .data-table td div[style*="flex"] {
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
  }

  /* Filter bars */
  .filter-bar { flex-direction: column; gap: 8px; width: 100%; }
  .filter-bar .search-input { width: 100%; }
  .table-header { flex-direction: column; align-items: flex-start; gap: 10px; padding: 12px 16px; }

  /* Quick actions */
  .quick-actions, div[style*="flex-wrap:wrap"][style*="gap:12px"] {
    flex-direction: column;
  }
  div[style*="flex-wrap:wrap"][style*="gap:12px"] > a,
  div[style*="flex-wrap:wrap"][style*="gap:12px"] > button {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  /* Dashboard client overview table */
  .client-table-wrap { overflow-x: auto; }

  /* Profile/detail grids */
  div[style*="grid-template-columns:1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
  div[style*="grid-template-columns:1fr 1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Topbar date text: hide on very small screens */
  .topbar span.text-muted { display: none; }

  /* Breadcrumbs: shorten */
  .topbar a { font-size: 12px; }

  /* Badges: ensure readable */
  .badge { font-size: 10px; padding: 2px 7px; white-space: nowrap; }

  /* Client view stat cards */
  .stats-grid.stats-4 { grid-template-columns: repeat(2, 1fr); }

  /* Notification bell */
  .notif-dropdown {
    right: 0;
    left: auto;
    width: calc(100vw - 24px);
    max-width: 360px;
  }

  /* Logo in header */
  .sidebar-brand img, .sidebar-logo { max-width: 90px; }

  /* Scrollable job sections in client view */
  .job-candidates-table { overflow-x: auto; }
  .job-candidates-table table { min-width: 480px; }
}

/* ── Tablet (768px–1024px) ── */
@media (min-width: 769px) and (max-width: 1024px) {
  :root { --sidebar-w: 200px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .page-content { padding: 20px; }
  .modal { max-width: 90%; }
  .data-table th, .data-table td { padding: 10px 12px; font-size: 12px; }
}

/* ── Touch targets: minimum 44px ── */
@media (hover: none) and (pointer: coarse) {
  .btn { min-height: 44px; }
  .btn-sm { min-height: 36px; }
  .nav-link { min-height: 44px; }
  .form-control { min-height: 44px; font-size: 16px; }
  select.form-control { min-height: 44px; }
  .kanban-card { min-height: 60px; }
}

/* ── Logout button ── */
.logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 9px 12px;
  margin-top: 10px;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: 8px;
  color: #fca5a5;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
  cursor: pointer;
}
.logout-btn:hover {
  background: rgba(239,68,68,0.2);
  border-color: rgba(239,68,68,0.5);
  color: #fff;
}
