/* ===================================
   СУЗ — Сервис учёта заявок на закупку
   Премиальный дизайн v1.0
   =================================== */

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

/* ---------- ПЕРЕМЕННЫЕ ---------- */
:root {
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --primary-light: #DBEAFE;
  --secondary: #0F172A;
  --accent: #7C3AED;
  --success: #059669;
  --success-light: #D1FAE5;
  --warning: #D97706;
  --warning-light: #FEF3C7;
  --danger: #DC2626;
  --danger-light: #FEE2E2;
  --info: #0891B2;
  --info-light: #CFFAFE;

  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-2: #F1F5F9;
  --border: #E2E8F0;
  --border-focus: #93C5FD;
  --text: #0F172A;
  --text-muted: #64748B;
  --text-light: #94A3B8;

  --sidebar-bg: #0F172A;
  --sidebar-hover: rgba(255,255,255,0.07);
  --sidebar-active: rgba(37,99,235,0.85);
  --sidebar-text: #CBD5E1;
  --sidebar-width: 260px;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 12px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.05);
  --shadow-primary: 0 4px 16px rgba(37,99,235,0.25);

  --transition: 0.18s ease;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ---------- RESET & BASE ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }

ul, ol { list-style: none; }

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

/* ---------- SIDEBAR ---------- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  transition: transform var(--transition);
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex; align-items: center; gap: 12px;
}

.sidebar-logo .logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #fff; font-size: 15px;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.sidebar-logo .logo-text {
  line-height: 1.2;
}

.sidebar-logo .logo-text span:first-child {
  display: block;
  font-size: 15px; font-weight: 700; color: #fff;
  letter-spacing: -0.3px;
}

.sidebar-logo .logo-text span:last-child {
  font-size: 11px; color: var(--sidebar-text); font-weight: 400;
}

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

.sidebar-section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #475569;
  padding: 12px 8px 6px;
  font-weight: 600;
}

.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--transition);
  margin-bottom: 2px;
}

.sidebar-nav a:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.sidebar-nav a.active {
  background: var(--sidebar-active);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37,99,235,0.3);
}

.sidebar-nav a .nav-icon {
  width: 18px; height: 18px;
  opacity: 0.85;
  flex-shrink: 0;
}

.sidebar-nav a .badge {
  margin-left: auto;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  min-width: 20px;
  text-align: center;
}

/* Кнопка "Панель администратора" (только для staff) */
.nav-admin-link {
  margin-top: 4px;
  border: 1px solid rgba(251, 191, 36, 0.25) !important;
  background: rgba(251, 191, 36, 0.08) !important;
  color: #FCD34D !important;
}

.nav-admin-link:hover {
  background: rgba(251, 191, 36, 0.2) !important;
  color: #FDE68A !important;
  border-color: rgba(251, 191, 36, 0.5) !important;
}

.nav-admin-link .nav-icon {
  color: #FCD34D;
  opacity: 1 !important;
}

.sidebar-user {
  margin: 12px; padding: 14px;
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.07);
  display: flex; align-items: center; gap: 10px;
}

.sidebar-user .user-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; font-size: 13px;
  flex-shrink: 0;
}

.sidebar-user .user-info {
  flex: 1; min-width: 0;
  line-height: 1.3;
}

.sidebar-user .user-info .user-name {
  font-size: 13px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.sidebar-user .user-info .user-role {
  font-size: 11px; color: var(--sidebar-text);
}

.sidebar-user .logout-btn {
  color: #475569;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: color var(--transition);
}

.sidebar-user .logout-btn:hover { color: var(--danger); }

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

.topbar {
  background: var(--surface);
  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: var(--shadow-sm);
}

.topbar-title {
  font-size: 17px; font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.topbar-actions { display: flex; align-items: center; gap: 12px; }

.content-area {
  padding: 28px 32px;
  flex: 1;
}

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

.page-header h1 {
  font-size: 22px; font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--text);
}

.page-header p {
  color: var(--text-muted); font-size: 14px; margin-top: 3px;
}

/* ---------- CARDS ---------- */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

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

.card-header h2 {
  font-size: 15px; font-weight: 700;
  letter-spacing: -0.2px;
}

.card-body { padding: 22px; }

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

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex; align-items: flex-start; gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

.stat-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

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

.stat-icon svg { width: 22px; height: 22px; }

/* Цветовые модификаторы иконок статистики */
.stat-icon--total    { background: #F1F5F9; color: var(--text-muted); }
.stat-icon--new      { background: var(--info-light); color: var(--info); }
.stat-icon--approved { background: #EDE9FE; color: var(--accent); }
.stat-icon--in-work  { background: var(--warning-light); color: var(--warning); }
.stat-icon--delivery { background: #FEF9C3; color: #CA8A04; }
.stat-icon--executed { background: var(--success-light); color: var(--success); }

.stat-card .stat-value {
  font-size: 26px; font-weight: 800;
  line-height: 1; letter-spacing: -0.8px;
}

.stat-card .stat-label {
  font-size: 12px; color: var(--text-muted); margin-top: 4px;
  font-weight: 500;
}

/* ---------- STATUS BADGES ---------- */
.badge-status {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: var(--radius-full);
  font-size: 12px; font-weight: 600; white-space: nowrap;
}

.badge-status::before {
  content: ''; width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-new { background: #FCE7F3; color: #DB2777; }
.status-new::before { background: #DB2777; }

.status-re_approval { background: #FCE7F3; color: #DB2777; }
.status-re_approval::before { background: #DB2777; }

.status-approved { background: #EDE9FE; color: var(--accent); }
.status-approved::before { background: var(--accent); }

.status-in_work { background: var(--warning-light); color: var(--warning); }
.status-in_work::before { background: var(--warning); }

.status-delivery { background: #FEF9C3; color: #CA8A04; }
.status-delivery::before { background: #CA8A04; }

.status-executed { background: var(--success-light); color: var(--success); }
.status-executed::before { background: var(--success); }

.status-revision { background: #FEF3C7; color: #D97706; }
.status-revision::before { background: #D97706; }

.status-rejected { background: #FEE2E2; color: #DC2626; }
.status-rejected::before { background: #DC2626; }

/* ---------- TABLE ---------- */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 13.5px;
}

table thead {
  background: var(--surface-2);
  position: sticky; top: 0;
}

table th {
  padding: 12px 16px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

table tbody tr:last-child td { border-bottom: none; }

table tbody tr {
  transition: background var(--transition);
  cursor: pointer;
}

table tbody tr:hover { background: var(--surface-2); }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 13.5px; font-weight: 600;
  cursor: pointer; border: none;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  font-family: var(--font);
  line-height: 1;
}

.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
  color: #fff;
  box-shadow: 0 6px 20px rgba(37,99,235,0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: #CBD5E1;
}

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-success:hover {
  background: #047857;
  color: #fff;
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: #B91C1C;
  color: #fff;
}

.btn-warning {
  background: var(--warning);
  color: #fff;
}

.btn-warning:hover {
  background: #B45309;
  color: #fff;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12.5px;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 15px;
}

/* ---------- ICON BUTTONS (в таблице заявок) ---------- */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
  text-decoration: none;
  cursor: pointer;
  flex-shrink: 0;
}

.icon-btn + .icon-btn {
  margin-left: 4px;
}

.icon-btn:hover { box-shadow: var(--shadow-sm); }

.icon-btn--view:hover {
  background: var(--info-light);
  color: var(--info);
  border-color: var(--info);
}

.icon-btn--edit:hover {
  background: var(--warning-light);
  color: var(--warning);
  border-color: var(--warning);
}

.icon-btn--danger:hover {
  background: #FEE2E2;
  color: #DC2626;
  border-color: #DC2626;
}

/* ---------- FORM LAYOUT HELPERS ---------- */
/* Двухколоночный ряд полей */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 24px;
}

@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
}

/* Read-only поле (инициатор закупки) */
.form-static-value {
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  min-height: 42px;
  display: flex;
  align-items: center;
}

/* ---------- ADDR QTY GRID (в модальном окне) ---------- */
.addr-qty-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.addr-qty-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
}

.addr-qty-label {
  flex: 1;
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
}

/* ---------- Умеренно увеличенные нативные стрелки количества справа ---------- */
.addr-qty-input::-webkit-inner-spin-button,
.addr-qty-input::-webkit-outer-spin-button {
  opacity: 1 !important;
  height: 24px !important;
  width: 14px !important;
  cursor: pointer !important;
  transform: scale(1.35) !important;
  transform-origin: right center !important;
  margin-right: 4px !important;
  display: block !important;
}

.addr-qty-input {
  width: 95px !important;
  flex-shrink: 0;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  padding-left: 8px !important;
  padding-right: 28px !important; /* Утвержденный отступ: стрелочки справа и НЕ накладываются на текст */
}

/* ---------- Ошибки валидации (Красная подсветка ДАЖЕ при фокусе) ---------- */
.is-invalid,
.form-control.is-invalid,
.form-control.is-invalid:focus,
input.is-invalid,
input.is-invalid:focus,
#iprice.is-invalid,
#iprice.is-invalid:focus,
#iname.is-invalid,
#iname.is-invalid:focus,
select.is-invalid,
select.is-invalid:focus,
textarea.is-invalid,
textarea.is-invalid:focus {
  border: 2px solid #EF4444 !important;
  border-color: #EF4444 !important;
  background-color: #FEF2F2 !important;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.3) !important;
  outline: none !important;
}


/* ---------- FORMS ---------- */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px; font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-label .required {
  color: var(--danger); margin-left: 2px;
}

.form-control {
  width: 100%;
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px; font-family: var(--font);
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  appearance: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.form-control::placeholder { color: var(--text-light); }

textarea.form-control { resize: vertical; min-height: 80px; }

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 18px;
  padding-right: 36px;
}

.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 5px; font-weight: 500; }

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

/* ---------- REQUEST FORM ITEMS TABLE ---------- */
.items-table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
}

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

.items-table th {
  background: var(--surface-2);
  padding: 10px 12px;
  font-size: 11.5px; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.items-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.items-table tbody tr:last-child td { border-bottom: none; }

.items-table .form-control {
  padding: 7px 10px; font-size: 13px;
}

.items-table td.qty-col {
  min-width: 70px;
}

.item-row-remove {
  background: none; border: none; cursor: pointer;
  padding: 4px;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  display: flex; align-items: center;
}

.item-row-remove:hover {
  color: var(--danger);
  background: var(--danger-light);
}

.address-qty-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
}

.address-qty-row {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px;
}

.address-qty-row label {
  flex: 1;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
  cursor: default;
}

.address-qty-row input {
  width: 64px;
  padding: 5px 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-family: var(--font);
  text-align: right;
  outline: none;
  transition: border-color var(--transition);
}

.address-qty-row input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37,99,235,0.1);
}

.item-total {
  font-size: 12.5px; font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

/* ---------- DETAIL SECTIONS ---------- */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
  align-items: flex-start;
}

.detail-field { margin-bottom: 16px; }

.detail-field label {
  display: block;
  font-size: 11.5px; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.detail-field .value {
  font-size: 14.5px; color: var(--text); font-weight: 500;
}

/* Ссылка на товар в спецификации */
.item-url-link {
  color: var(--text-muted);
  text-decoration: none;
  opacity: 0.7;
  transition: color var(--transition), opacity var(--transition);
}
.item-url-link:hover {
  color: var(--accent);
  opacity: 1;
}

/* Шаг прогресса заявки */
.progress-steps {
  display: flex; align-items: center;
  margin-bottom: 28px; gap: 0;
}

.step {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  flex: 1; position: relative;
}

.step::after {
  content: '';
  position: absolute;
  top: 17px; left: 50%;
  width: 100%; height: 2px;
  background: var(--border);
  z-index: 0;
}

.step:last-child::after { display: none; }

.step-circle {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  z-index: 1; position: relative;
  transition: all var(--transition);
}

.step.active .step-circle {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-primary);
}

.step.done .step-circle {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.step.done::after, .step.active::after { background: var(--primary); }

.step-label {
  font-size: 11.5px; font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.step.active .step-label { color: var(--primary); }
.step.done .step-label { color: var(--success); }

/* ---------- ACCEPTANCE TABLE ---------- */
.acceptance-table td, .acceptance-table th { vertical-align: middle; }

.acceptance-check {
  width: 20px; height: 20px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
}

.acceptance-check.done {
  background: var(--success-light);
  color: var(--success);
}

.acceptance-check.pending {
  background: var(--warning-light);
  color: var(--warning);
}

/* ---------- ALERTS ---------- */
.alert {
  padding: 13px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 20px;
  border-left: 4px solid transparent;
}

.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }

.alert-info { background: var(--info-light); color: var(--info); border-color: var(--info); }
.alert-success { background: var(--success-light); color: var(--success); border-color: var(--success); }
.alert-warning { background: var(--warning-light); color: var(--warning); border-color: var(--warning); }
.alert-danger { background: var(--danger-light); color: var(--danger); border-color: var(--danger); }

/* ---------- MESSAGES ---------- */
.messages-list { margin-bottom: 20px; }

/* ---------- FILTER BAR ---------- */
.filter-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end;
  box-shadow: var(--shadow-sm);
}

.filter-bar .form-group { margin: 0; min-width: 160px; }

.filter-bar .form-label { font-size: 11.5px; }

/* ---------- LOGIN PAGE ---------- */
.login-layout {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0F172A 0%, #1E3A5F 100%);
}

.login-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 44px 40px;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  margin-bottom: 32px;
}

.login-logo .logo-icon-lg {
  width: 60px; height: 60px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #fff; font-size: 22px;
  letter-spacing: -0.5px;
  box-shadow: var(--shadow-primary);
}

.login-logo h1 {
  font-size: 22px; font-weight: 800;
  letter-spacing: -0.5px;
  text-align: center;
}

.login-logo p {
  font-size: 13px; color: var(--text-muted);
  text-align: center; line-height: 1.4;
}

/* ---------- EMPTY STATE ---------- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state svg { width: 56px; height: 56px; opacity: 0.3; margin: 0 auto 16px; display: block; }

.empty-state h3 { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 8px; }

.empty-state p { font-size: 14px; max-width: 360px; margin: 0 auto 24px; }

/* ---------- FILE LIST ---------- */
.file-list { display: flex; flex-direction: column; gap: 8px; }

.file-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 13px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13.5px;
  transition: background var(--transition);
}

.file-item:hover { background: var(--primary-light); border-color: var(--border-focus); }
.file-item svg { width: 18px; height: 18px; color: var(--primary); flex-shrink: 0; }
.file-item span { flex: 1; font-weight: 500; }
.file-item small { color: var(--text-muted); font-size: 12px; }

/* ---------- UTILITIES ---------- */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12.5px; }
.font-bold { font-weight: 700; }
.w-full { width: 100%; }
.text-right { text-align: right; }
.text-center { text-align: center; }

/* ---------- PRINT STYLES ---------- */
@media print {
  .sidebar,
  .topbar,
  .filter-bar,
  .btn,
  .btn-primary,
  .btn-secondary,
  .btn-success,
  .btn-danger,
  .page-header .btn,
  .no-print {
    display: none !important;
  }

  .main-content {
    margin-left: 0 !important;
  }

  .content-area {
    padding: 0 !important;
  }

  body {
    background: white;
    font-size: 12pt;
    color: black;
  }

  .card {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    border-radius: 4pt !important;
    break-inside: avoid;
  }

  .card-header {
    background: #f5f5f5 !important;
  }

  table { font-size: 10pt; }

  thead { display: table-header-group; }

  table tbody tr { break-inside: avoid; }

  .badge-status {
    border: 1px solid currentColor;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .print-header {
    display: block !important;
    text-align: center;
    margin-bottom: 20pt;
    border-bottom: 2pt solid #333;
    padding-bottom: 12pt;
  }

  .print-header h1 {
    font-size: 16pt; font-weight: 800;
  }

  .print-header p {
    font-size: 10pt; color: #555;
  }

  a { text-decoration: none; color: black; }
}

.print-header { display: none; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1024px) {
  .detail-grid { grid-template-columns: 1fr; }
  .form-row-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  :root { --sidebar-width: 0px; }

  .sidebar { transform: translateX(-260px); width: 260px; }
  .sidebar.open { transform: translateX(0); }

  .main-content { margin-left: 0; }

  .content-area { padding: 16px; }

  .topbar { padding: 0 16px; }

  .form-row, .form-row-3 { grid-template-columns: 1fr; }

  .stats-grid { grid-template-columns: 1fr 1fr; }

  .progress-steps { flex-wrap: wrap; gap: 12px; }
  .step::after { display: none; }
}

.clickable-row {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.clickable-row:hover {
  background-color: var(--bg-hover) !important;
}

