/* ============================================================
   manageIT — Professional IT Management Theme
   ============================================================ */

/* ---------- Variables ---------- */
:root {
  --sidebar-width: 260px;
  --sidebar-bg: #0f172a;
  --sidebar-hover: rgba(99, 149, 237, 0.12);
  --sidebar-active: rgba(99, 149, 237, 0.2);
  --sidebar-accent: #6395ed;
  --topbar-bg: #ffffff;
  --body-bg: #f1f5f9;
  --card-border: #e2e8f0;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --input-border: #94a3b8;
  --input-focus: #6395ed;
  --table-header-bg: #f8fafc;
  --table-hover: #f1f5f9;
  --login-bg: #0f172a;
}

/* ---------- Global ---------- */
body {
  background: var(--body-bg);
  color: var(--text-primary);
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ---------- Form inputs — more visible ---------- */
.form-control, .form-select {
  border-color: var(--input-border);
  border-width: 1.5px;
  transition: border-color .2s, box-shadow .2s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px rgba(99, 149, 237, 0.15);
}
.form-control::placeholder { color: #94a3b8; }
.form-label { font-weight: 500; color: var(--text-primary); font-size: .875rem; }
.form-text { color: var(--text-secondary); }

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 1040;
  transition: transform 0.25s ease;
  background: var(--sidebar-bg);
  border-right: 1px solid rgba(255,255,255,0.06);
}

.sidebar-header {
  border-bottom: 1px solid rgba(255,255,255,0.08) !important;
}

.sidebar .nav-link {
  color: rgba(255,255,255,0.65);
  font-size: .855rem;
  padding: .5rem .85rem;
  border-radius: .5rem;
  margin: 1px 0;
  transition: all .15s ease;
}
.sidebar .nav-link:hover {
  background: var(--sidebar-hover);
  color: #fff;
}
.sidebar .nav-link.active {
  background: var(--sidebar-active);
  color: #fff;
  font-weight: 600;
}
.sidebar .nav-link i { opacity: .7; }
.sidebar .nav-link:hover i,
.sidebar .nav-link.active i { opacity: 1; }

.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: margin-left 0.25s ease;
}

/* ---------- Top bar ---------- */
.navbar {
  background: var(--topbar-bg) !important;
  border-bottom: 1px solid var(--card-border) !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

#topBarTitle {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ---------- Cards ---------- */
.card {
  border: 1px solid var(--card-border);
  border-radius: .75rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: box-shadow .2s;
}
.card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.card-header {
  background: var(--table-header-bg);
  border-bottom: 1px solid var(--card-border);
  font-weight: 600;
  font-size: .9rem;
}

/* ---------- Tables ---------- */
.table {
  font-size: .875rem;
  color: var(--text-primary);
}
.table thead th {
  background: var(--table-header-bg);
  border-bottom: 2px solid var(--card-border);
  font-weight: 600;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--text-secondary);
  padding: .65rem .75rem;
}
.table tbody tr {
  transition: background .1s;
}
.table-hover tbody tr:hover {
  background: var(--table-hover);
}
.table td {
  padding: .6rem .75rem;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
}

/* Sortable headers */
th[data-sort] { cursor: pointer; user-select: none; white-space: nowrap; }
th[data-sort]:hover { background-color: #e9ecef !important; }
th[data-sort]::after { content: ' \2195'; opacity: .3; font-size: .7em; }
th[data-sort].sort-asc::after { content: ' \2191'; opacity: .8; }
th[data-sort].sort-desc::after { content: ' \2193'; opacity: .8; }

/* Table filter */
.table-filter-input { border-color: var(--input-border); }
.table-filter-input:focus { box-shadow: 0 0 0 3px rgba(99, 149, 237, 0.15) !important; border-color: var(--input-focus); }
.table-filter-wrapper { position: relative; }

/* ---------- Buttons ---------- */
.btn { font-weight: 500; border-radius: .5rem; font-size: .875rem; }
.btn-primary { background: #4f7df0; border-color: #4f7df0; }
.btn-primary:hover { background: #3d6ad8; border-color: #3d6ad8; }
.btn-outline-primary { border-color: #4f7df0; color: #4f7df0; }
.btn-outline-primary:hover { background: #4f7df0; border-color: #4f7df0; }
.btn-sm { font-size: .8rem; padding: .3rem .6rem; }

/* ---------- Badges ---------- */
.badge { font-weight: 500; letter-spacing: .02em; }

/* ---------- Modals ---------- */
.modal-content {
  border: none;
  border-radius: .75rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.modal-header {
  cursor: move;
  border-bottom: 1px solid var(--card-border);
  padding: 1rem 1.25rem;
}
.modal-header .modal-title { font-weight: 600; font-size: 1rem; }
.modal-footer { border-top: 1px solid var(--card-border); }

/* ---------- Login ---------- */
#viewLogin {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%) !important;
}
#viewLogin .form-control {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}
#viewLogin .form-control:focus {
  border-color: var(--sidebar-accent) !important;
  box-shadow: 0 0 0 3px rgba(99, 149, 237, 0.2) !important;
}
#viewLogin .input-group-text {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #94a3b8 !important;
}
#viewLogin .btn-primary {
  background: var(--sidebar-accent);
  border-color: var(--sidebar-accent);
  font-weight: 600;
  padding: .6rem;
}
#viewLogin .btn-primary:hover {
  background: #527cd6;
  border-color: #527cd6;
}

/* ---------- Section headings ---------- */
.app-section h5 {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-primary);
}

/* ---------- Dashboard stat cards ---------- */
.stat-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: .75rem;
  font-size: 1.25rem;
}

/* ---------- Scrollbar (subtle) ---------- */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

/* ---------- Toast container ---------- */
.toast { border-radius: .5rem; box-shadow: 0 8px 24px rgba(0,0,0,0.12); }

/* ---------- Nav tabs (modal) ---------- */
.nav-tabs .nav-link {
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-secondary);
  border: none;
  border-bottom: 2px solid transparent;
  padding: .5rem 1rem;
}
.nav-tabs .nav-link:hover { color: var(--text-primary); border-bottom-color: #cbd5e1; }
.nav-tabs .nav-link.active { color: #4f7df0; border-bottom-color: #4f7df0; font-weight: 600; }

/* ---------- Alert improvements ---------- */
.alert { border-radius: .5rem; font-size: .875rem; }

/* ---------- Mobile ---------- */
@media (max-width: 767.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .main-content { margin-left: 0; }
}
