/* ════════════════════════════════════════
   DonRobot — main.css
   Палитра: тёмно-синий фон, оранжевый акцент
   ════════════════════════════════════════ */

:root {
  --bg:           #0d1b2a;
  --bg-2:         #142236;
  --bg-3:         #1a2d45;
  --surface:      #1e3550;
  --surface-2:    #243f61;
  --border:       #2a4a70;

  --accent:       #cc00ff;
  --accent-hover: #d930ff;
  --accent-soft:  rgba(204, 0, 255, 0.12);

  --yellow:       #ffc233;
  --yellow-soft:  rgba(255, 194, 51, 0.12);

  --green:        #2ecc71;
  --green-soft:   rgba(46, 204, 113, 0.12);

  --red:          #e74c3c;
  --red-soft:     rgba(231, 76, 60, 0.12);

  --text:         #e8edf2;
  --text-2:       #9ab0c8;
  --text-3:       #5e7d9a;

  --radius:       12px;
  --radius-sm:    8px;
  --sidebar-w:    240px;
  --topbar-h:     60px;

  --font-main:    'Nunito', sans-serif;
  --font-display: 'Raleway', sans-serif;
}

/* ── Reset ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }

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

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--text);
  letter-spacing: -0.5px;
}
.sidebar-logo b { color: var(--accent); }
.logo-icon {
  width: 36px; height: 36px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
}
.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 14px 8px 6px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-weight: 500;
  font-size: 14px;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 2px;
}
.nav-link i { font-size: 18px; flex-shrink: 0; }
.nav-link:hover,
.nav-link.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.sidebar-footer {
  padding: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.user-card {
  display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0;
}
.user-avatar {
  width: 34px; height: 34px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: #fff; flex-shrink: 0;
}
.user-info { min-width: 0; }
.user-name {
  font-size: 13px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-role { font-size: 11px; color: var(--text-3); }
.btn-logout {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-3);
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.btn-logout:hover { background: var(--red-soft); color: var(--red); }

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

/* ── Topbar ─────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 90;
}
.sidebar-toggle {
  display: none;
  background: none; border: none;
  color: var(--text-2); font-size: 22px;
  cursor: pointer; padding: 4px;
}
.topbar-title {
  font-family: var(--font-display);
  font-size: 17px; font-weight: 700;
  color: var(--text); flex: 1;
}
.topbar-right { display: flex; align-items: center; gap: 10px; }
.notif-btn {
  position: relative;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 20px;
  transition: background 0.15s, color 0.15s;
}
.notif-btn:hover { background: var(--surface); color: var(--accent); }
.notif-badge {
  position: absolute; top: 5px; right: 5px;
  width: 16px; height: 16px;
  background: var(--accent);
  border-radius: 50%;
  font-size: 10px; font-weight: 700; color: #fff;
  display: flex; align-items: center; justify-content: center;
}

/* ── Content ────────────────────────────── */
.content {
  flex: 1;
  padding: 28px 28px;
  max-width: 1200px;
  width: 100%;
}

/* ── Cards ──────────────────────────────── */
.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.card-title {
  font-family: var(--font-display);
  font-size: 15px; font-weight: 700;
  margin-bottom: 16px;
  display: flex; align-items: center; justify-content: space-between;
}

/* ── Stat cards ─────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.stat-card.orange::before { background: var(--accent); }
.stat-card.yellow::before { background: var(--yellow); }
.stat-card.green::before  { background: var(--green); }
.stat-card.red::before    { background: var(--red); }

.stat-label { font-size: 12px; color: var(--text-3); margin-bottom: 6px; }
.stat-value {
  font-family: var(--font-display);
  font-size: 30px; font-weight: 800;
  line-height: 1;
}
.stat-card.orange .stat-value { color: var(--accent); }
.stat-card.yellow .stat-value { color: var(--yellow); }
.stat-card.green .stat-value  { color: var(--green); }
.stat-card.red .stat-value    { color: var(--red); }
.stat-sub { font-size: 12px; color: var(--text-3); margin-top: 4px; }

/* ── Grid layouts ───────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* ── Buttons ────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 13px; font-weight: 600;
  cursor: pointer; border: none;
  transition: background 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary {
  background: var(--surface);
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { padding: 5px 12px; font-size: 12px; }

/* ── Badges ─────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 20px;
}
.badge-orange { background: var(--accent-soft); color: var(--accent); }
.badge-yellow { background: var(--yellow-soft); color: var(--yellow); }
.badge-green  { background: var(--green-soft);  color: var(--green); }
.badge-red    { background: var(--red-soft);     color: var(--red); }
.badge-gray   { background: var(--surface); color: var(--text-3); }

/* ── Table ──────────────────────────────── */
.table-wrap { overflow-x: auto; }
table {
  width: 100%; border-collapse: collapse;
  font-size: 14px;
}
thead th {
  text-align: left;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.5px; text-transform: uppercase;
  color: var(--text-3);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface); }

/* ── Alert ──────────────────────────────── */
.alert {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 20px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent);
}

/* ── Page header ────────────────────────── */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.page-header h1 {
  font-family: var(--font-display);
  font-size: 24px; font-weight: 800;
}
.page-header p { font-size: 14px; color: var(--text-3); margin-top: 2px; }

/* ── Forms ──────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 12px; font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-main);
  font-size: 14px;
  padding: 9px 12px;
  transition: border-color 0.15s;
  outline: none;
}
.form-control:focus { border-color: var(--accent); }

/* ── Responsive ─────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.4);
  }
  .main-wrap { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .content { padding: 16px; }
}
