/* ══════════════════════════════════════════
   МОТОСТОП — Design System
   Palette: deep anthracite + red-orange accent
   ══════════════════════════════════════════ */

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

:root {
  --bg:        #0f0f12;
  --surface:   #17171d;
  --card:      #1e1e27;
  --border:    #2a2a36;
  --accent:    #e8440a;
  --accent2:   #ff6b35;
  --text:      #e8e8f0;
  --muted:     #7a7a95;
  --success:   #22c55e;
  --warn:      #f59e0b;
  --danger:    #ef4444;
  --info:      #3b82f6;
  --sidebar-w: 240px;
  --radius:    10px;
  --shadow:    0 4px 24px rgba(0,0,0,.45);
}

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

/* ── Utils ── */
.hidden { display: none !important; }

/* ══════════════════════════════════════════
   LOGIN
   ══════════════════════════════════════════ */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 60% 40%, #1a0a04 0%, #0f0f12 70%);
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow);
}

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

.logo-icon {
  font-size: 36px;
  color: var(--accent);
  line-height: 1;
  filter: drop-shadow(0 0 10px var(--accent));
}

.logo-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px;
  letter-spacing: 3px;
  color: var(--text);
  line-height: 1;
}

.logo-sub {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.login-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text);
}

.login-error {
  background: rgba(239,68,68,.15);
  border: 1px solid rgba(239,68,68,.4);
  color: #fca5a5;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 13px;
}

.login-hint {
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* ══════════════════════════════════════════
   FIELDS
   ══════════════════════════════════════════ */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }

input, select, textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s;
  width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--muted); }

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 42px; }
.pw-toggle {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--muted); cursor: pointer; font-size: 16px;
}

/* ══════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════ */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background .2s, transform .1s;
  white-space: nowrap;
}
.btn-primary:hover { background: var(--accent2); }
.btn-primary:active { transform: scale(.97); }
.btn-primary.full { width: 100%; padding: 12px; }

.btn-secondary {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 20px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background .2s;
  white-space: nowrap;
}
.btn-secondary:hover { background: var(--border); }

.btn-icon {
  background: none; border: none; cursor: pointer;
  font-size: 16px; padding: 4px 8px; border-radius: 6px;
  color: var(--muted); transition: color .2s, background .2s;
}
.btn-icon:hover { background: var(--border); color: var(--text); }

/* ══════════════════════════════════════════
   APP SHELL
   ══════════════════════════════════════════ */
.app {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  transition: transform .25s;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 18px;
  border-bottom: 1px solid var(--border);
}

.logo-icon-sm { font-size: 24px; color: var(--accent); filter: drop-shadow(0 0 6px var(--accent)); }

.sidebar-brand {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px;
  letter-spacing: 2px;
  line-height: 1;
}

.sidebar-user { font-size: 11px; color: var(--muted); margin-top: 2px; }

.nav { flex: 1; padding: 12px 0; overflow-y: auto; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: none;
  border: none;
  color: var(--muted);
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: color .2s, background .2s;
  border-radius: 0;
}
.nav-item:hover { color: var(--text); background: rgba(255,255,255,.04); }
.nav-item.active { color: var(--accent); background: rgba(232,68,10,.1); border-right: 3px solid var(--accent); }
.nav-icon { font-size: 16px; }

.logout-btn {
  width: 100%;
  background: none;
  border: none;
  border-top: 1px solid var(--border);
  color: var(--muted);
  padding: 16px 18px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: color .2s;
}
.logout-btn:hover { color: var(--danger); }

/* Topbar (mobile) */
.topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  z-index: 100;
}
.burger { background: none; border: none; color: var(--text); font-size: 22px; cursor: pointer; }
.topbar-title { flex: 1; font-weight: 600; font-size: 15px; }
.topbar-right { font-size: 12px; color: var(--muted); }

/* Main */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 32px;
  min-height: 100vh;
}

/* ══════════════════════════════════════════
   PAGES
   ══════════════════════════════════════════ */
.page { display: none; }
.page.active { display: block; }

.page-title { font-size: 24px; font-weight: 700; margin-bottom: 24px; }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header .page-title { margin-bottom: 0; }

.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.filter-bar input, .filter-bar select {
  width: auto;
  flex: 1;
  min-width: 160px;
}

/* ── KPI cards ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.kpi-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent-c, var(--accent));
}
.kpi-label { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin-bottom: 8px; }
.kpi-value { font-family: 'Bebas Neue', sans-serif; font-size: 36px; line-height: 1; color: var(--text); }
.kpi-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ── Dashboard grid ── */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card-head {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--muted);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.compact-list { display: flex; flex-direction: column; gap: 8px; }
.compact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: var(--surface);
  border-radius: 7px;
  font-size: 13px;
}
.compact-row-left { font-weight: 500; }
.compact-row-right { color: var(--muted); font-size: 12px; text-align: right; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  background: var(--surface);
  padding: 12px 14px;
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: rgba(255,255,255,.03); }

/* Status badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  white-space: nowrap;
}
.badge-new     { background: rgba(59,130,246,.2);  color: #93c5fd; }
.badge-working { background: rgba(245,158,11,.2);  color: #fcd34d; }
.badge-ready   { background: rgba(34,197,94,.2);   color: #86efac; }
.badge-done    { background: rgba(122,122,149,.15); color: var(--muted); }

/* ── Employee cards ── */
.emp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.emp-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
}
.emp-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px;
  color: #fff;
  margin-bottom: 12px;
}
.emp-name { font-weight: 700; font-size: 15px; margin-bottom: 2px; }
.emp-role { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.emp-info { font-size: 12px; color: var(--muted); line-height: 1.8; }
.emp-actions { display: flex; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.emp-stat { font-size: 11px; color: var(--muted); }
.emp-stat strong { color: var(--text); font-size: 13px; }

/* ── Salary table ── */
.salary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.salary-table th {
  background: var(--surface);
  padding: 12px 14px;
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.salary-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.salary-table tbody tr:last-child td { border-bottom: none; }
.salary-total { color: var(--accent); font-weight: 700; }

/* ── Reports ── */
.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.report-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.report-row:last-child { border-bottom: none; }
.report-bar-wrap { flex: 1; margin: 0 12px; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.report-bar { height: 100%; background: var(--accent); border-radius: 3px; transition: width .4s; }
.report-val { font-weight: 600; font-family: 'JetBrains Mono', monospace; font-size: 12px; min-width: 60px; text-align: right; }

/* ══════════════════════════════════════════
   MODALS
   ══════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 16px;
  backdrop-filter: blur(4px);
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 16px;
}

.modal-close {
  background: none; border: none; color: var(--muted);
  font-size: 18px; cursor: pointer; transition: color .2s;
}
.modal-close:hover { color: var(--text); }

.modal-body { padding: 24px; }

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

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
}
.field.full { grid-column: 1 / -1; }
.form-grid .field { margin-bottom: 14px; }

/* ══════════════════════════════════════════
   TOAST
   ══════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 28px; right: 28px;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--success);
  color: var(--text);
  padding: 14px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow);
  z-index: 1000;
  animation: toastIn .25s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 40px rgba(0,0,0,.6);
  }
  .topbar { display: flex; }
  .main { margin-left: 0; padding: 80px 16px 24px; }
  .dash-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .report-grid { grid-template-columns: 1fr; }
  .kpi-value { font-size: 28px; }
}
