/* RadKod Panel CSS — report.hbs design language */
:root {
  --primary: #1a1a1a;
  --bg: #f0f0f0;
  --white: #ffffff;
  --text: #1a1a1a;
  --text-muted: #999;
  --text-mid: #666;
  --border: #e8e8e8;
  --success: #27ae60;
  --danger: #c0392b;
  --warning: #e67e22;
  --info: #1a1a1a;
  --sidebar-w: 240px;
  --header-h: 56px;
  --radius: 0px;
  --radius-sm: 6px;
  --shadow: none;
}

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

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--text); text-decoration: none; }
a:hover { opacity: 0.7; }

/* ── Login ── */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}

.login-container { width: 100%; max-width: 400px; padding: 1rem; }

.login-card {
  background: var(--white);
  padding: 2.5rem 2rem;
}

.login-brand {
  text-align: center;
  margin-bottom: 2rem;
}

.login-brand svg, .login-brand img { margin-bottom: 0.75rem; filter: brightness(0); }
.login-brand h1 { font-size: 17px; font-weight: 700; letter-spacing: -0.3px; }
.login-brand p { color: var(--text-muted); font-size: 13px; margin-top: 0.25rem; }

.login-form .form-group { margin-bottom: 1.25rem; }
.login-form label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 0.375rem;
}

.login-form input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.2s;
  outline: none;
}

.login-form input:focus { border-color: var(--primary); }

/* ── Alert ── */
.alert {
  padding: 12px 14px;
  font-size: 13px;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.alert-danger {
  background: #fafafa;
  color: var(--danger);
  border-left: 3px solid var(--danger);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: opacity 0.15s;
  text-decoration: none;
}

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

.btn-outline {
  background: var(--white);
  color: var(--text);
  border: 1.5px solid #ddd;
}
.btn-outline:hover { border-color: var(--primary); color: var(--text); }

.btn-danger {
  background: var(--danger);
  color: var(--white);
}
.btn-danger:hover { opacity: 0.8; color: var(--white); }

.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-block { width: 100%; }

/* ── Panel Layout ── */
.panel-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--primary);
  color: var(--white);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand img { filter: brightness(0) invert(1); }
.sidebar-brand-text { font-weight: 700; font-size: 15px; letter-spacing: -0.3px; }

.sidebar-nav {
  flex: 1;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.5);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.sidebar-link:hover { color: rgba(255,255,255,0.8); background: rgba(255,255,255,0.06); }

.sidebar-link.active {
  color: var(--white);
  background: rgba(255,255,255,0.1);
  font-weight: 700;
}

.sidebar-divider {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 0.5rem 0.75rem;
}

.sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.logout-btn { color: rgba(255,255,255,0.35) !important; }
.logout-btn:hover { color: var(--danger) !important; background: rgba(255,255,255,0.04); }

/* ── Main Area ── */
.panel-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
}

.panel-header {
  position: sticky;
  top: 0;
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  z-index: 50;
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  padding: 0.25rem;
}

.page-title { font-size: 14px; font-weight: 700; flex: 1; letter-spacing: -0.3px; }

.header-right { display: flex; align-items: center; gap: 1rem; }
.header-user { font-size: 12px; color: var(--text-muted); font-weight: 500; }

.panel-content { padding: 24px; }

/* ── Stats Grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--white);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--border);
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon-total { background: #f7f7f7; color: var(--text); }
.stat-icon-success { background: #f8faf8; color: var(--success); }
.stat-icon-danger { background: #fdf5f5; color: var(--danger); }
.stat-icon-warning { background: #fdf8f4; color: var(--warning); }

.stat-info { display: flex; flex-direction: column; }
.stat-value { font-size: 22px; font-weight: 700; line-height: 1.2; letter-spacing: -0.5px; }
.stat-label { font-size: 12px; color: var(--text-muted); }

/* ── Card ── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  overflow: hidden;
}

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

.card-header h2 {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.card-actions { display: flex; gap: 0.5rem; }

/* ── Table ── */
.table-wrapper { overflow-x: auto; }

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

.table th, .table td {
  padding: 9px 20px;
  text-align: left;
  font-size: 13px;
  border-bottom: 1px solid #f0f0f0;
}

.table th {
  font-weight: 700;
  color: var(--text-muted);
  font-size: 12px;
}

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #fafafa; }

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
}

.badge-success { background: #f8faf8; color: var(--success); }
.badge-danger { background: #fdf5f5; color: var(--danger); }
.badge-warning { background: #fdf8f4; color: var(--warning); }
.badge-info { background: #f7f7f7; color: var(--text); }
.badge-secondary { background: #f7f7f7; color: var(--text-muted); }

/* ── Progress ── */
.progress-bar, .progress-bar-mini {
  width: 100%;
  height: 6px;
  background: #f0f0f0;
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar { height: 6px; margin-top: 1rem; }
.progress-bar-mini { width: 80px; display: inline-block; vertical-align: middle; }

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.5s ease;
}

.progress-section { padding: 16px 20px; }
.progress-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.progress-text {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 0.5rem;
  vertical-align: middle;
}

/* ── Filters ── */
.filters { padding: 12px 20px; border-bottom: 1px solid var(--border); }

.filter-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.form-input, .filter-input, .filter-select {
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus, .filter-input:focus, .filter-select:focus { border-color: var(--primary); }

.filter-input { min-width: 200px; }
.filter-select { min-width: 140px; }

/* ── Pagination ── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
}

.pagination-info { font-size: 12px; color: var(--text-muted); }

/* ── Forms ── */
.job-form { padding: 20px; }

.form-group { margin-bottom: 1.25rem; }

.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 0.375rem;
}

.job-form .form-input { width: 100%; }

textarea.form-input {
  resize: vertical;
  min-height: 60px;
  font-family: inherit;
}

select.form-input {
  cursor: pointer;
  background: var(--white);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; display: block; }

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 13px;
}

.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

/* ── Detail Page ── */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0;
  padding: 0;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 20px;
  border-bottom: 1px solid #f0f0f0;
}

.detail-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; font-weight: 700; }
.detail-value { font-size: 13px; }
.detail-value a { color: var(--text); border-bottom: 1px solid #ccc; word-break: break-all; }
.detail-value a:hover { border-color: var(--text); }

/* ── Result Scores ── */
.result-scores {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 0;
  padding: 0;
}

.score-item {
  text-align: center;
  padding: 20px 16px;
  border-right: 1px solid #f0f0f0;
}

.score-item:last-child { border-right: none; }

.score-value { display: block; font-size: 22px; font-weight: 700; letter-spacing: -0.5px; }
.score-label { font-size: 12px; color: var(--text-muted); }

.summary-info {
  padding: 14px 20px;
  font-size: 13px;
  border-top: 1px solid #f0f0f0;
}

.summary-info p { margin-bottom: 4px; color: var(--text-mid); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: block; }
  .panel-main { margin-left: 0; }
  .panel-content { padding: 16px; }
  .panel-header { padding: 0 16px; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 99;
  }
  .sidebar-overlay.show { display: block; }
}
