/* ============================================================
   IT Asset Manager — Stíluslap
   Modern, reszponzív, sidebar-alapú layout
   ============================================================ */

/* ── CSS változók ─────────────────────────────────────────── */
:root {
  --primary:       #4f46e5;
  --primary-dark:  #3730a3;
  --primary-light: #e0e7ff;
  --success:       #16a34a;
  --success-light: #dcfce7;
  --danger:        #dc2626;
  --danger-light:  #fee2e2;
  --warning:       #d97706;
  --warning-light: #fef3c7;
  --info:          #0891b2;
  --info-light:    #cffafe;

  --sidebar-w:     260px;
  --sidebar-bg:    #1e1b4b;
  --sidebar-text:  #c7d2fe;
  --sidebar-hover: rgba(255,255,255,.07);
  --sidebar-active:#4f46e5;

  --bg:            #f8fafc;
  --surface:       #ffffff;
  --border:        #e2e8f0;
  --text:          #1e293b;
  --text-muted:    #64748b;

  --radius:        10px;
  --shadow:        0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:     0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.05);

  --font:          'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

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

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

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.01em;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand i { font-size: 20px; color: #818cf8; }

.sidebar-menu {
  list-style: none;
  padding: 12px 0;
  flex: 1;
  overflow-y: auto;
}
.sidebar-menu li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: var(--sidebar-text);
  font-size: 14px;
  font-weight: 500;
  border-radius: 0;
  transition: background .15s, color .15s;
  text-decoration: none;
}
.sidebar-menu li a:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar-menu li a.active {
  background: var(--sidebar-active);
  color: #fff;
}
.sidebar-menu li a i { width: 18px; text-align: center; font-size: 15px; }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 8px;
}
.user-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--sidebar-text);
  text-decoration: none;
  padding: 6px 8px;
  border-radius: 8px;
  transition: background .15s;
}
.user-info:hover { background: var(--sidebar-hover); }
.user-avatar {
  width: 34px; height: 34px;
  background: var(--sidebar-active);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}
.user-name  { font-size: 13px; font-weight: 600; color: #e0e7ff; line-height: 1.2; }
.user-role  { font-size: 11px; color: var(--sidebar-text); }
.logout-btn {
  color: var(--sidebar-text);
  padding: 8px;
  border-radius: 8px;
  transition: background .15s, color .15s;
  font-size: 16px;
}
.logout-btn:hover { background: rgba(220,38,38,.2); color: #f87171; text-decoration: none; }

.sidebar-toggle {
  display: none;
  position: fixed; top: 12px; left: 12px; z-index: 200;
  background: var(--sidebar-bg); color: #fff;
  border: none; padding: 8px 10px; border-radius: 8px;
  cursor: pointer; font-size: 16px;
}

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

/* ── Page header ──────────────────────────────────────────── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  gap: 16px;
}
.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}
.page-title i { color: var(--primary); }
.page-sub   { color: var(--text-muted); font-size: 13px; margin-top: 2px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Card ─────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 20px 24px;
  margin-bottom: 20px;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.card-title i { color: var(--primary); }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary  { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); text-decoration: none; color: #fff; }
.btn-outline  { background: #fff; color: var(--text); border-color: var(--border); }
.btn-outline:hover { background: var(--bg); text-decoration: none; color: var(--text); }
.btn-danger   { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #b91c1c; text-decoration: none; color: #fff; }
.btn-block    { width: 100%; justify-content: center; padding: 11px; font-size: 15px; }
.btn-sm       { padding: 5px 10px; font-size: 12px; border-radius: 6px; }

/* ── Flash üzenetek ───────────────────────────────────────── */
.flash {
  position: fixed;
  top: 20px; right: 20px;
  z-index: 999;
  padding: 12px 20px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  max-width: 400px;
  transition: opacity .3s;
}
.flash-success { background: var(--success-light); color: var(--success); border: 1px solid #86efac; }
.flash-error   { background: var(--danger-light);  color: var(--danger);  border: 1px solid #fca5a5; }
.flash-close   { background: none; border: none; cursor: pointer; font-size: 18px; color: inherit; margin-left: auto; }

/* ── Alert ────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.alert-danger  { background: var(--danger-light);  color: var(--danger);  border: 1px solid #fca5a5; }
.alert-warning { background: var(--warning-light); color: var(--warning); border: 1px solid #fcd34d; }
.alert-success { background: var(--success-light); color: var(--success); border: 1px solid #86efac; }
.alert a       { color: inherit; font-weight: 600; }
.alert-row     { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }

/* ── Táblázat ─────────────────────────────────────────────── */
.table-responsive { overflow-x: auto; margin: -4px -4px; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table thead th {
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: var(--bg);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.table tbody tr:hover { background: #f8fafc; }
.table tbody tr:last-child { border-bottom: none; }
.table tbody td { padding: 10px 12px; vertical-align: middle; }
.table-sm thead th,
.table-sm tbody td { padding: 7px 12px; }
.row-inactive td { opacity: .55; }
.text-right { text-align: right !important; }

/* ── Badge-ek ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-success   { background: var(--success-light);  color: var(--success); }
.badge-danger    { background: var(--danger-light);   color: var(--danger); }
.badge-warning   { background: var(--warning-light);  color: var(--warning); }
.badge-info      { background: var(--info-light);     color: var(--info); }
.badge-primary   { background: var(--primary-light);  color: var(--primary); }
.badge-secondary { background: #f1f5f9; color: var(--text-muted); }

/* ── Szűrő panel ──────────────────────────────────────────── */
.filter-card { padding: 16px 20px; }
.filter-form .filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}
.filter-group { display: flex; flex-direction: column; gap: 4px; min-width: 160px; }
.filter-group label { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.filter-check { justify-content: flex-end; }
.filter-check label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); cursor: pointer; }
.filter-buttons { display: flex; gap: 8px; align-items: flex-end; }

/* ── Forms ────────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-bottom: 24px;
}
.form-grid-single { max-width: 600px; }
.form-section { display: flex; flex-direction: column; gap: 0; }
.form-section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.form-group { margin-bottom: 16px; }
.form-group.has-error .form-control { border-color: var(--danger); }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 5px;
}
.form-label.required::after { content: ' *'; color: var(--danger); }
.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.checkbox-wrap { display: flex; align-items: center; gap: 8px; padding: 8px 0; }
.checkbox-wrap input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; }
.input-password-wrap { position: relative; }
.input-password-wrap .form-control { padding-right: 40px; }
.toggle-password {
  position: absolute; right: 0; top: 0;
  height: 100%; width: 38px;
  background: none; border: none;
  color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.toggle-password:hover { color: var(--text); }

/* ── Stat kártyák ─────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.stat-total   .stat-icon { background: var(--primary-light); color: var(--primary); }
.stat-active  .stat-icon { background: var(--success-light); color: var(--success); }
.stat-storage .stat-icon { background: var(--info-light);    color: var(--info); }
.stat-repair  .stat-icon { background: var(--warning-light); color: var(--warning); }
.stat-retired .stat-icon { background: #f1f5f9; color: var(--text-muted); }
.stat-users   .stat-icon { background: var(--primary-light); color: var(--primary); }
.stat-value   { font-size: 26px; font-weight: 700; line-height: 1; }
.stat-label   { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

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

/* ── Type chart ───────────────────────────────────────────── */
.type-chart { display: flex; flex-direction: column; gap: 10px; }
.type-row   { display: flex; align-items: center; gap: 10px; }
.type-name  { min-width: 90px; font-size: 13px; }
.type-bar-wrap { flex: 1; background: var(--bg); border-radius: 20px; height: 8px; overflow: hidden; }
.type-bar   { height: 100%; background: var(--primary); border-radius: 20px; transition: width .4s; }
.type-count { min-width: 28px; text-align: right; font-size: 13px; font-weight: 600; color: var(--text-muted); }

/* ── Detail grid ──────────────────────────────────────────── */
.detail-grid { display: grid; grid-template-columns: 1fr 380px; gap: 20px; }
.detail-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.detail-table th, .detail-table td { padding: 8px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.detail-table th { font-weight: 600; color: var(--text-muted); width: 140px; padding-right: 16px; white-space: nowrap; }
.detail-table tr:last-child th,
.detail-table tr:last-child td { border-bottom: none; }

.assigned-user { display: flex; align-items: center; gap: 12px; }
.user-avatar-lg {
  width: 44px; height: 44px;
  background: var(--primary); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 16px; flex-shrink: 0;
}
.user-avatar-xl {
  width: 60px; height: 60px;
  background: var(--primary); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 22px; flex-shrink: 0;
}
.user-avatar-sm {
  width: 28px; height: 28px;
  background: var(--primary); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 11px; flex-shrink: 0;
}
.user-profile-header { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.user-profile-header h2 { font-size: 18px; font-weight: 700; }
.user-row { display: flex; align-items: center; gap: 8px; }

/* ── Asset mini-lista ─────────────────────────────────────── */
.asset-list-mini { display: flex; flex-direction: column; gap: 0; }
.asset-mini-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.asset-mini-row:last-child { border-bottom: none; }

/* ── Lapozó ───────────────────────────────────────────────── */
.pagination-wrap { padding: 16px 0 4px; }
.pagination { display: flex; gap: 4px; list-style: none; flex-wrap: wrap; }
.page-item.disabled .page-link { opacity: .4; pointer-events: none; }
.page-link {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  transition: all .15s;
}
.page-link:hover { background: var(--bg); text-decoration: none; }
.page-item.active .page-link { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ── Action buttons ───────────────────────────────────────── */
.action-buttons { display: flex; gap: 4px; justify-content: flex-end; }

/* ── Empty state ──────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}
.empty-state i { font-size: 48px; display: block; margin-bottom: 14px; opacity: .4; }
.empty-state p { font-size: 15px; margin-bottom: 16px; }
.empty-state-sm { padding: 24px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* ── Utility ──────────────────────────────────────────────── */
.text-muted   { color: var(--text-muted) !important; }
.text-sm      { font-size: 12px !important; }
.text-mono    { font-family: 'Courier New', monospace; font-size: 12px; }
.text-danger  { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-success { color: var(--success) !important; }
.fw-bold      { font-weight: 600; }
.mt-4         { margin-top: 20px; }
.asset-name   { font-weight: 500; }
.notes-text   { font-size: 13px; line-height: 1.7; color: var(--text); background: var(--bg); padding: 10px; border-radius: 6px; }
.meta-info    { border-top: 1px solid var(--border); padding-top: 12px; }

/* ── Login oldal ──────────────────────────────────────────── */
body.login-body {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.login-wrapper { width: 100%; max-width: 420px; padding: 20px; }
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 36px 40px;
  box-shadow: 0 20px 40px rgba(0,0,0,.25);
}
.login-header { text-align: center; margin-bottom: 28px; }
.login-icon {
  width: 60px; height: 60px;
  background: var(--primary-light);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: var(--primary);
  margin: 0 auto 14px;
}
.login-header h1 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.login-header p  { color: var(--text-muted); font-size: 14px; }
.login-form      { display: flex; flex-direction: column; gap: 4px; }
.login-footer    { text-align: center; margin-top: 20px; color: var(--text-muted); }

/* ── Reszponzív ───────────────────────────────────────────── */
@media (max-width: 1024px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .detail-grid    { grid-template-columns: 1fr; }
  .form-grid      { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 300;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: block; }
  .main-content { margin-left: 0; padding: 16px; padding-top: 56px; }
  .page-header { flex-direction: column; }
  .stats-grid  { grid-template-columns: repeat(2, 1fr); }
  .filter-form .filter-row { flex-direction: column; }
  .filter-group { min-width: 100%; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .stats-grid   { grid-template-columns: 1fr 1fr; }
  .login-card   { padding: 24px 20px; }
  .table thead  { display: none; }
  .table tbody tr { display: block; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; }
  .table tbody td { display: flex; justify-content: space-between; padding: 6px 12px; border: none; }
  .table tbody td::before { content: attr(data-label); font-weight: 600; color: var(--text-muted); }
}
