@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --sidebar: #0f172a;
  --sidebar-hover: #1e293b;
  --accent: #3b82f6;
  --accent-dark: #2563eb;
  --bg: #f1f5f9;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --sidebar-text: #94a3b8;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.1);
}

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

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 14px;
}

/* ── SIDEBAR ────────────────────────────────── */
.sidebar {
  width: 220px;
  height: 100vh;
  background: var(--sidebar);
  position: fixed;
  left: 0; top: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.sidebar-logo {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.sidebar-logo h1 { color:#fff; font-size:20px; font-weight:800; letter-spacing:-.5px; }
.sidebar-logo h1 span { color: var(--accent); }
.sidebar-logo small { color: var(--sidebar-text); font-size:11px; }

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

.nav-item {
  display:flex; align-items:center; gap:10px;
  padding: 11px 20px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all .15s;
  border-left: 3px solid transparent;
}
.nav-item:hover { background: var(--sidebar-hover); color:#fff; }
.nav-item.active { background: rgba(59,130,246,.12); color: var(--accent); border-left-color: var(--accent); }
.nav-icon { font-size:16px; width:18px; text-align:center; }

.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.logout-btn {
  display:flex; align-items:center; gap:10px;
  color:#f87171; background:none; border:none;
  cursor:pointer; font-size:13.5px; font-weight:500;
  padding:8px 0; width:100%;
  transition: color .15s;
}
.logout-btn:hover { color:#ef4444; }

/* ── MAIN ───────────────────────────────────── */
.main { margin-left:220px; min-height:100vh; }

.topbar {
  background:#fff;
  border-bottom:1px solid var(--border);
  padding:14px 28px;
  display:flex; align-items:center; justify-content:space-between;
  position:sticky; top:0; z-index:50;
  box-shadow: var(--shadow);
}
.topbar h2 { font-size:17px; font-weight:600; }
.topbar-user {
  display:flex; align-items:center; gap:8px;
  font-size:13px; color: var(--muted);
}
.avatar {
  width:32px; height:32px;
  background: var(--accent);
  border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  color:#fff; font-size:13px; font-weight:600;
}

.content { padding:28px; }

/* ── STAT CARDS ─────────────────────────────── */
.stats-grid {
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap:16px;
  margin-bottom:28px;
}
.stat-card {
  background:var(--card);
  border-radius:12px;
  padding:18px 20px;
  border:1px solid var(--border);
  box-shadow: var(--shadow);
  display:flex; align-items:center; gap:14px;
}
.stat-icon {
  width:46px; height:46px;
  border-radius:10px;
  display:flex; align-items:center; justify-content:center;
  font-size:22px;
  flex-shrink:0;
}
.stat-val { font-size:26px; font-weight:700; line-height:1; }
.stat-label { font-size:12px; color: var(--muted); margin-top:3px; }

/* ── TABLE CARD ─────────────────────────────── */
.card {
  background:var(--card);
  border-radius:12px;
  border:1px solid var(--border);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.card-head {
  padding:16px 22px;
  border-bottom:1px solid var(--border);
  display:flex; align-items:center; justify-content:space-between;
  flex-wrap:wrap; gap:10px;
}
.card-title { font-size:15px; font-weight:600; }

/* Filter tabs */
.tabs {
  display:flex; gap:4px;
  background:var(--bg); padding:4px; border-radius:8px;
}
.tab {
  padding:5px 12px; border-radius:6px;
  font-size:12.5px; font-weight:500;
  cursor:pointer; border:none; background:none;
  color: var(--muted); transition: all .15s;
}
.tab.active { background:#fff; color: var(--text); box-shadow: var(--shadow); }

/* Table */
.table-wrap { overflow-x:auto; }
table { width:100%; border-collapse:collapse; }
thead { background:#f8fafc; }
th {
  text-align:left; padding:10px 16px;
  font-size:11.5px; font-weight:600;
  color: var(--muted); text-transform:uppercase;
  letter-spacing:.05em;
  border-bottom:1px solid var(--border);
  white-space:nowrap;
}
td {
  padding:13px 16px;
  border-bottom:1px solid var(--border);
  vertical-align:middle;
}
tbody tr:last-child td { border-bottom:none; }
tbody tr { transition:background .1s; }
tbody tr:hover { background:#f8fafc; }

.job-name { font-weight:500; }
.job-co { font-size:12px; color: var(--muted); }

/* Badges */
.badge {
  display:inline-flex; align-items:center; gap:4px;
  padding:3px 9px; border-radius:20px;
  font-size:11.5px; font-weight:600;
  white-space:nowrap;
}
.badge-in_progress { background:#fef3c7; color:#92400e; }
.badge-active       { background:#d1fae5; color:#065f46; }
.badge-done         { background:#ede9fe; color:#4c1d95; }
.badge-deleted      { background:#fee2e2; color:#991b1b; }

/* Action buttons */
.acts { display:flex; gap:5px; flex-wrap:wrap; }
.btn {
  padding:5px 11px; border-radius:6px;
  font-size:12px; font-weight:500;
  cursor:pointer; border:none; transition:all .15s;
  white-space:nowrap;
}
.btn-green  { background:#d1fae5; color:#065f46; }
.btn-green:hover  { background:#a7f3d0; }
.btn-yellow { background:#fef3c7; color:#92400e; }
.btn-yellow:hover { background:#fde68a; }
.btn-purple { background:#ede9fe; color:#4c1d95; }
.btn-purple:hover { background:#ddd6fe; }
.btn-red    { background:#fee2e2; color:#991b1b; }
.btn-red:hover    { background:#fecaca; }
.btn-blue   { background:#dbeafe; color:#1e40af; }
.btn-blue:hover   { background:#bfdbfe; }

/* Pagination */
.pagination {
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 22px;
  border-top:1px solid var(--border);
  font-size:13px;
}
.pag-info { color: var(--muted); }
.pag-btns { display:flex; gap:6px; }
.pag-btn {
  padding:5px 12px;
  border:1px solid var(--border);
  border-radius:6px; background:#fff;
  font-size:13px; cursor:pointer; transition:all .15s;
}
.pag-btn:hover:not(:disabled) { background: var(--accent); color:#fff; border-color: var(--accent); }
.pag-btn:disabled { opacity:.4; cursor:not-allowed; }

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

.modal {
  background:#fff;
  border-radius:14px;
  width:100%; max-width:640px;
  max-height:88vh; overflow-y:auto;
  box-shadow:0 20px 60px rgba(0,0,0,.25);
  animation: slideUp .2s ease;
}
@keyframes slideUp {
  from { transform:translateY(20px); opacity:0; }
  to   { transform:translateY(0);    opacity:1; }
}

.modal-head {
  padding:18px 22px;
  border-bottom:1px solid var(--border);
  display:flex; align-items:center; justify-content:space-between;
  position:sticky; top:0; background:#fff; z-index:1;
}
.modal-head h3 { font-size:15px; font-weight:600; }
.modal-close {
  background:none; border:none;
  font-size:20px; cursor:pointer;
  color: var(--muted); padding:2px 6px;
  border-radius:6px; line-height:1;
}
.modal-close:hover { background: var(--bg); }

.modal-body { padding:22px; }

.detail-section { margin-bottom:20px; }
.detail-section-title {
  font-size:11px; font-weight:700;
  text-transform:uppercase; letter-spacing:.06em;
  color: var(--muted); margin-bottom:12px;
  padding-bottom:6px;
  border-bottom:1px solid var(--border);
}
.detail-grid {
  display:grid; grid-template-columns:1fr 1fr; gap:12px;
}
.detail-item label {
  font-size:11px; font-weight:600;
  text-transform:uppercase; letter-spacing:.04em;
  color: var(--muted); display:block; margin-bottom:3px;
}
.detail-item span {
  font-size:13.5px; color: var(--text);
  display:block;
}
.detail-item.full { grid-column:1/-1; }

.modal-actions {
  padding:16px 22px;
  border-top:1px solid var(--border);
  display:flex; gap:8px; flex-wrap:wrap;
}

/* ── LOGIN ──────────────────────────────────── */
.login-page {
  min-height:100vh;
  background:linear-gradient(135deg, #0f172a 0%, #1a365d 100%);
  display:flex; align-items:center; justify-content:center;
}
.login-wrap {
  width:100%; max-width:380px; padding:16px;
}
.login-card {
  background:#fff;
  border-radius:16px; padding:40px;
  box-shadow:0 25px 60px rgba(0,0,0,.35);
}
.login-brand {
  text-align:center; margin-bottom:28px;
}
.login-brand h1 { font-size:28px; font-weight:800; color: var(--text); }
.login-brand h1 span { color: var(--accent); }
.login-brand p { color: var(--muted); font-size:13px; margin-top:4px; }

.field { margin-bottom:14px; }
.field label { display:block; font-size:13px; font-weight:500; margin-bottom:5px; }
.field input {
  width:100%; padding:10px 14px;
  border:1px solid var(--border); border-radius:8px;
  font-size:14px; outline:none; font-family:inherit;
  transition:border-color .15s, box-shadow .15s;
}
.field input:focus {
  border-color: var(--accent);
  box-shadow:0 0 0 3px rgba(59,130,246,.15);
}

.login-btn {
  width:100%; padding:11px;
  background: var(--accent); color:#fff;
  border:none; border-radius:8px;
  font-size:15px; font-weight:600;
  cursor:pointer; font-family:inherit;
  transition:background .15s;
  margin-top:6px;
}
.login-btn:hover { background: var(--accent-dark); }
.login-btn:disabled { opacity:.6; cursor:not-allowed; }

.alert {
  padding:10px 14px; border-radius:8px;
  font-size:13px; margin-bottom:14px;
  display:none;
}
.alert-err { background:#fee2e2; color:#991b1b; }

/* ── MISC ───────────────────────────────────── */
.empty {
  text-align:center; padding:50px 20px;
  color: var(--muted);
}
.empty-icon { font-size:44px; margin-bottom:12px; }
.empty p { font-size:14px; }

.loading { text-align:center; padding:36px; color: var(--muted); }
.spinner {
  display:inline-block;
  width:20px; height:20px;
  border:2px solid var(--border);
  border-top-color: var(--accent);
  border-radius:50%;
  animation:spin .6s linear infinite;
  margin-right:8px; vertical-align:middle;
}
@keyframes spin { to { transform:rotate(360deg); } }

.link { color: var(--accent); text-decoration:none; font-size:13px; }
.link:hover { text-decoration:underline; }

/* ── FORM INPUTS (edit modal) ───────────────── */
.finput {
  width:100%; padding:8px 11px;
  border:1px solid var(--border); border-radius:7px;
  font-size:13.5px; font-family:inherit;
  outline:none; background:#fff; color: var(--text);
  transition:border-color .15s, box-shadow .15s;
}
.finput:focus {
  border-color: var(--accent);
  box-shadow:0 0 0 3px rgba(59,130,246,.12);
}
textarea.finput { resize:vertical; min-height:60px; }
select.finput { cursor:pointer; }

.tag {
  display:inline-block;
  background:var(--bg); color: var(--muted);
  padding:2px 8px; border-radius:4px;
  font-size:12px;
}
