/* ============================================
   ADMIN PANEL — PROFESSIONAL EDITION
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Montserrat:wght@500;600;700&display=swap');

:root {
  --navy:       #1B2A6B;
  --navy-dark:  #111d4a;
  --navy-mid:   #1e3270;
  --gold:       #B8952A;
  --gold-light: #f5edda;
  --white:      #FFFFFF;
  --surface:    #F7F8FC;
  --surface2:   #F0F2F8;
  --border:     #E4E6EF;
  --border2:    #D0D3E3;
  --dark-text:  #111827;
  --mid-text:   #374151;
  --gray:       #6B7280;
  --gray-light: #9CA3AF;
  --accent-blue:#3B5BDB;
  --accent-teal:#0D9488;
  --accent-rose:#DC2626;
  --accent-amber:#B45309;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', sans-serif; background: var(--surface); color: var(--dark-text); min-height: 100vh; font-size: 14px; line-height: 1.5; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ── SIDEBAR ──────────────────────────────── */
.admin-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 256px; flex-shrink: 0;
  background: var(--navy-dark);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  overflow-y: auto; z-index: 100;
  transition: transform 0.3s ease;
  border-right: 1px solid rgba(255,255,255,0.04);
}
.sidebar-logo {
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex; align-items: center; gap: 12px;
}
.sidebar-logo img { height: 42px; width: auto; border-radius: 6px; }
.sidebar-logo-text { display: flex; flex-direction: column; }
.sidebar-logo-text span:first-child { font-size: 13px; font-weight: 700; color: white; letter-spacing: .3px; }
.sidebar-logo-text span:last-child { font-size: 10px; color: rgba(255,255,255,0.35); text-transform: uppercase; letter-spacing: 1.5px; }
.sidebar-nav { padding: 16px 0 8px; flex: 1; }
.nav-section { padding: 0 12px; margin-bottom: 4px; }
.nav-section-title {
  font-size: 9.5px; letter-spacing: 1.8px; text-transform: uppercase;
  color: rgba(255,255,255,0.3); padding: 10px 10px 5px;
  font-weight: 600;
}
.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: 7px;
  color: rgba(255,255,255,0.58);
  font-size: 13.5px; font-weight: 500;
  transition: all 0.18s;
  margin-bottom: 1px;
  position: relative;
}
.sidebar-link:hover { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.9); }
.sidebar-link.active {
  background: rgba(184,149,42,0.18);
  color: #e8c76a;
  font-weight: 600;
}
.sidebar-link.active svg { opacity: 1; }
.sidebar-link svg { flex-shrink: 0; opacity: .75; }
.sidebar-badge {
  margin-left: auto; background: #dc2626; color: white;
  font-size: 10px; font-weight: 700; border-radius: 10px;
  padding: 1px 7px; letter-spacing: .3px;
}
.sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex; flex-direction: column; gap: 2px;
}
.sidebar-footer a {
  display: flex; align-items: center; gap: 10px;
  color: rgba(255,255,255,0.42); font-size: 13px;
  padding: 8px 12px; border-radius: 7px; transition: all 0.2s;
}
.sidebar-footer a:first-child:hover { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.85); }
.sidebar-footer a:last-child:hover { background: rgba(220,38,38,0.12); color: #f87171; }

/* ── MAIN ─────────────────────────────────── */
.admin-main { margin-left: 256px; flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.admin-topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 1px 0 var(--border);
}
.admin-topbar h1 { font-size: 16px; font-weight: 700; color: var(--navy); letter-spacing: -.2px; }
.admin-user { display: flex; align-items: center; gap: 10px; }
.admin-user-name { font-size: 13px; color: var(--gray); font-weight: 500; }
.admin-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--navy); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; letter-spacing: .5px;
}
.admin-content { padding: 28px 32px; flex: 1; max-width: 1400px; }

/* ── STAT CARDS ───────────────────────────── */
.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px; margin-bottom: 28px;
}
.stat-card-admin {
  background: var(--white);
  border-radius: 10px;
  padding: 20px 20px 18px;
  border: 1px solid var(--border);
  border-top: 3px solid var(--navy);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  transition: box-shadow 0.2s, transform 0.15s;
  cursor: default;
}
.stat-card-admin:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); transform: translateY(-1px); }
.stat-card-admin.clickable { cursor: pointer; }
.stat-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.stat-card-icon { width: 36px; height: 36px; border-radius: 8px; background: var(--surface2); display: flex; align-items: center; justify-content: center; color: var(--navy); }
.stat-card-icon.pending { background: #fef9ec; color: #b45309; }
.stat-card-icon.success { background: #f0fdf4; color: #15803d; }
.stat-card-icon.info    { background: #eff6ff; color: #1d4ed8; }
.stat-card-icon.warn    { background: #fff7ed; color: #c2410c; }
.stat-num { font-size: 30px; font-weight: 700; color: var(--dark-text); letter-spacing: -1px; line-height: 1; margin-bottom: 4px; font-family: 'Montserrat', sans-serif; }
.stat-lbl { font-size: 12px; color: var(--gray); font-weight: 500; text-transform: uppercase; letter-spacing: .6px; }
.stat-trend { font-size: 11px; color: var(--gray-light); margin-top: 6px; }

/* ── TABLE ────────────────────────────────── */
.admin-table-wrap { background: var(--white); border-radius: 10px; border: 1px solid var(--border); overflow: hidden; }
.table-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
  background: white;
}
.table-header h3 { font-size: 14px; font-weight: 700; color: var(--dark-text); letter-spacing: -.1px; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
  background: var(--surface);
  padding: 10px 16px; text-align: left;
  font-size: 11px; font-weight: 700; color: var(--gray);
  text-transform: uppercase; letter-spacing: .7px; white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.admin-table td { padding: 13px 16px; border-bottom: 1px solid var(--border); font-size: 13.5px; color: var(--mid-text); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover td { background: #fafbff; }
.overflow-x { overflow-x: auto; }

/* ── BADGES ───────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 5px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .2px;
}
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; display: inline-block; }
.badge-green  { background: #f0fdf4; color: #15803d; }
.badge-red    { background: #fff1f2; color: #be123c; }
.badge-yellow { background: #fffbeb; color: #92400e; }
.badge-blue   { background: #eff6ff; color: #1e40af; }
.badge-gray   { background: var(--surface2); color: var(--gray); }
.badge-gold   { background: var(--gold-light); color: var(--accent-amber); }
.badge-navy   { background: rgba(27,42,107,0.08); color: var(--navy); }
.badge-orange { background: #fff7ed; color: #c2410c; }
.badge-purple { background: #f5f3ff; color: #6d28d9; }
.badge-teal   { background: #f0fdfa; color: #0f766e; }

/* ── BUTTONS ──────────────────────────────── */
.btn-admin {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 7px;
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; transition: all 0.15s;
  font-family: 'Inter', sans-serif; line-height: 1;
  letter-spacing: .1px; min-height: 32px; white-space: nowrap;
}
.btn-admin:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-admin:active { transform: translateY(0); }
.btn-admin.btn-primary { background: var(--navy); color: white; border-color: var(--navy); }
.btn-admin.btn-gold    { background: var(--gold); color: white; border-color: var(--gold); }
.btn-admin.btn-light   { background: var(--white); color: var(--mid-text); border-color: var(--border2); }
.btn-admin.btn-light:hover { background: var(--surface2); }
.btn-admin.btn-green   { background: #15803d; color: white; border-color: #15803d; }
.btn-admin.btn-danger  { background: #be123c; color: white; border-color: #be123c; }
.btn-admin.btn-outline { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-admin.btn-sm { padding: 5px 10px; font-size: 11.5px; min-height: 26px; border-radius: 5px; }
.btn-admin.btn-xs { padding: 3px 8px; font-size: 11px; min-height: 22px; border-radius: 4px; }

/* ── FORMS ────────────────────────────────── */
.admin-form { background: var(--white); border-radius: 10px; padding: 28px; border: 1px solid var(--border); }
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 12px; font-weight: 700; margin-bottom: 6px; color: var(--mid-text); text-transform: uppercase; letter-spacing: .5px; }
.form-control-admin,
.form-control {
  width: 100%; padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: 7px; font-size: 13.5px;
  font-family: 'Inter', sans-serif; color: var(--dark-text);
  background: white; transition: border-color 0.15s, box-shadow 0.15s;
  height: 36px;
}
.form-control-admin:focus,
.form-control:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(27,42,107,0.08); }
textarea.form-control-admin,
textarea.form-control { height: auto; min-height: 90px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-hint { font-size: 11.5px; color: var(--gray-light); margin-top: 4px; }

/* ── ALERTS ───────────────────────────────── */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 13.5px; display: flex; align-items: flex-start; gap: 10px; border: 1px solid; }
.alert svg { flex-shrink: 0; margin-top: 1px; }
.alert-success { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.alert-error   { background: #fff1f2; color: #9f1239; border-color: #fecdd3; }
.alert-info    { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.alert-warning { background: #fffbeb; color: #78350f; border-color: #fde68a; }

/* ── SECTION HEADER ───────────────────────── */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.section-header h2 { font-size: 19px; font-weight: 700; color: var(--dark-text); letter-spacing: -.3px; }
.breadcrumb-admin { font-size: 12px; color: var(--gray-light); margin-top: 2px; }

/* ── COMPANY CARDS (Pending Approval) ─────── */
.company-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.company-card {
  background: white; border-radius: 10px; border: 1px solid var(--border);
  border-top: 3px solid var(--gold);
  padding: 20px; transition: box-shadow 0.2s;
}
.company-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.08); }
.company-card-header { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 14px; }
.company-initial {
  width: 46px; height: 46px; border-radius: 10px;
  background: var(--navy); color: white;
  font-size: 18px; font-weight: 700; display: flex;
  align-items: center; justify-content: center;
  flex-shrink: 0; letter-spacing: 0;
  font-family: 'Montserrat', sans-serif;
}
.company-card-info h4 { font-size: 15px; font-weight: 700; color: var(--dark-text); margin-bottom: 2px; }
.company-card-info p { font-size: 12px; color: var(--gray); }
.company-card-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; font-size: 12.5px; }
.meta-item { display: flex; flex-direction: column; gap: 1px; }
.meta-label { font-size: 10.5px; font-weight: 700; color: var(--gray-light); text-transform: uppercase; letter-spacing: .5px; }
.meta-value { color: var(--mid-text); font-weight: 500; }
.company-card-needs { font-size: 12.5px; color: var(--gray); background: var(--surface); border-radius: 6px; padding: 10px 12px; margin-bottom: 14px; line-height: 1.5; border-left: 3px solid var(--gold-light); }
.company-card-actions { display: flex; gap: 8px; }
.company-card-date { font-size: 11px; color: var(--gray-light); margin-top: 10px; }

/* ── APPROVED LIST ────────────────────────── */
.company-id-tag {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 5px; padding: 2px 8px;
  font-family: 'SFMono-Regular', 'Fira Code', monospace;
  font-size: 11.5px; color: var(--navy); font-weight: 600;
}

/* ── RESET PASSWORD MODAL ─────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(15,23,42,0.5); z-index: 9999;
  align-items: center; justify-content: center;
  backdrop-filter: blur(2px);
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: white; border-radius: 14px;
  width: 100%; max-width: 440px; margin: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  overflow: hidden;
}
.modal-head {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-head h3 { font-size: 16px; font-weight: 700; color: var(--dark-text); }
.modal-close { background: none; border: none; cursor: pointer; color: var(--gray); padding: 4px; border-radius: 5px; transition: all .2s; }
.modal-close:hover { background: var(--surface2); color: var(--dark-text); }
.modal-body { padding: 20px 24px; }
.modal-foot { padding: 14px 24px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

/* ── TOGGLE SWITCH ────────────────────────── */
.toggle-wrap { display: flex; align-items: center; gap: 8px; }
.toggle { position: relative; display: inline-block; width: 40px; height: 22px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; inset: 0; background: var(--border2); border-radius: 22px; transition: 0.25s; }
.toggle-slider::before { content: ''; position: absolute; height: 16px; width: 16px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: 0.25s; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.toggle input:checked + .toggle-slider { background: #15803d; }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ── PAGINATION ───────────────────────────── */
.admin-pagination { display: flex; gap: 4px; justify-content: center; padding: 20px; }
.page-link { width: 34px; height: 34px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; border: 1px solid var(--border); color: var(--gray); cursor: pointer; transition: all 0.15s; background: white; }
.page-link:hover, .page-link.active { background: var(--navy); border-color: var(--navy); color: white; }

/* ── SIDEBAR MOBILE ───────────────────────── */
.sidebar-toggle { display: none; background: none; border: none; cursor: pointer; color: var(--navy); padding: 6px; border-radius: 6px; align-items: center; }
.sidebar-toggle:hover { background: var(--surface2); }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 89; }
.sidebar-overlay.active { display: block; }

/* ── JOB REQUEST STYLES ───────────────────── */
.jr-company { font-weight: 700; color: var(--dark-text); }
.jr-meta { font-size: 11.5px; color: var(--gray-light); }

/* ── RESPONSIVE ───────────────────────────── */
@media (max-width: 1024px) {
  .stats-cards { grid-template-columns: repeat(3, 1fr); }
  .admin-topbar { padding: 0 20px; }
  .admin-content { padding: 20px; }
}
@media (max-width: 768px) {
  .sidebar { position: fixed; transform: translateX(-100%); transition: transform 0.28s ease; }
  .sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .stats-cards { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .admin-content { padding: 16px; }
  .admin-topbar { padding: 0 16px; }
  .sidebar-toggle { display: flex; }
  .table-header { flex-direction: column; align-items: flex-start; }
  .section-header { flex-direction: column; align-items: flex-start; }
  .company-cards { grid-template-columns: 1fr; }
  .job-requests-table thead { display: none; }
  .job-requests-table tbody tr { display: block; background: white; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 12px; padding: 14px; }
  .job-requests-table tbody tr:hover td { background: transparent; }
  .job-requests-table td { display: flex; align-items: flex-start; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
  .job-requests-table td:last-child { border-bottom: none; }
  .job-requests-table td::before { content: attr(data-label); font-size: 10.5px; font-weight: 700; color: var(--gray-light); text-transform: uppercase; letter-spacing: .5px; min-width: 90px; flex-shrink: 0; padding-top: 2px; }
  .job-requests-table td[data-label=""] { border-bottom: none; }
}
@media (max-width: 480px) {
  .stats-cards { grid-template-columns: 1fr 1fr; }
  .admin-content { padding: 12px; }
  .stat-num { font-size: 24px; }
}
