/* ═══════════════════════════════════════════════════
   OmnIT – Custom Stylesheet
   ═══════════════════════════════════════════════════ */

:root {
  --sidebar-bg:       #0f172a;
  --sidebar-border:   #1e293b;
  --sidebar-text:     #94a3b8;
  --sidebar-hover-bg: #1e293b;
  --sidebar-active-bg:#3b82f6;
  --sidebar-active-tx:#ffffff;
  --sidebar-icon:     #64748b;
  --sidebar-width:    240px;
  --topbar-height:    60px;
  --body-bg:          #f1f5f9;
  --card-shadow:      0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --card-shadow-hover:0 4px 12px rgba(0,0,0,.12);
  --primary:          #3b82f6;
  --danger:           #ef4444;
  --success:          #10b981;
  --warning:          #f59e0b;
  --info:             #06b6d4;
}

/* ── Layout ───────────────────────────────────────── */

body {
  background: var(--body-bg);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 0.9rem;
}

#wrapper {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────── */

#sidebar {
  width: var(--sidebar-width);
  min-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;
  scrollbar-width: thin;
  scrollbar-color: #1e293b transparent;
}

#sidebar::-webkit-scrollbar { width: 4px; }
#sidebar::-webkit-scrollbar-thumb { background: #334155; border-radius: 2px; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--sidebar-border);
  text-decoration: none;
}

.sidebar-brand img {
  height: 62px;
  width: auto;
  border-radius: 10px;
}

.sidebar-brand-text {
  font-size: 1.55rem;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: -.5px;
}

.sidebar-brand-text span {
  color: var(--primary);
}

.sidebar-section {
  padding: 20px 0 8px;
}

.sidebar-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #475569;
  padding: 0 20px 6px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: var(--sidebar-text);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all .15s ease;
  border-radius: 0;
  font-size: 0.875rem;
}

.sidebar-nav-item i {
  width: 18px;
  text-align: center;
  font-size: 0.95rem;
  color: var(--sidebar-icon);
  transition: color .15s;
}

.sidebar-nav-item:hover {
  background: var(--sidebar-hover-bg);
  color: #e2e8f0;
  border-left-color: #334155;
}

.sidebar-nav-item:hover i {
  color: #94a3b8;
}

.sidebar-nav-item.active {
  background: rgba(59,130,246,.15);
  color: #93c5fd;
  border-left-color: var(--primary);
}

.sidebar-nav-item.active i {
  color: var(--primary);
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid var(--sidebar-border);
  font-size: 0.75rem;
  color: #475569;
}

/* ── Main Content ─────────────────────────────────── */

#main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  background: #fff;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-title i {
  color: var(--primary);
}

.page-body {
  padding: 28px;
  flex: 1;
}

/* ── Cards ────────────────────────────────────────── */

.card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: var(--card-shadow);
  transition: box-shadow .2s;
}

.card:hover {
  box-shadow: var(--card-shadow-hover);
}

.card-header {
  background: #fff;
  border-bottom: 1px solid #f1f5f9;
  border-radius: 10px 10px 0 0 !important;
  padding: 14px 20px;
  font-weight: 600;
  font-size: 0.9rem;
  color: #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header i {
  color: var(--primary);
  margin-right: 6px;
}

/* ── Stat Cards ───────────────────────────────────── */

.stat-card {
  border-radius: 12px;
  padding: 22px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 16px;
  border: none;
  box-shadow: 0 4px 14px rgba(0,0,0,.12);
  transition: transform .2s, box-shadow .2s;
  text-decoration: none;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,.18);
  color: #fff;
}

.stat-card-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: rgba(255,255,255,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-card-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.stat-card-label {
  font-size: 0.8rem;
  opacity: .85;
  margin-top: 2px;
}

.stat-bg-blue   { background: linear-gradient(135deg,#3b82f6,#1d4ed8); }
.stat-bg-green  { background: linear-gradient(135deg,#10b981,#059669); }
.stat-bg-orange { background: linear-gradient(135deg,#f59e0b,#d97706); }
.stat-bg-purple { background: linear-gradient(135deg,#8b5cf6,#6d28d9); }
.stat-bg-red    { background: linear-gradient(135deg,#ef4444,#b91c1c); }
.stat-bg-teal   { background: linear-gradient(135deg,#06b6d4,#0e7490); }

/* ── Tables ───────────────────────────────────────── */

.table {
  font-size: 0.875rem;
}

.table thead th {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: #64748b;
  border-bottom: 2px solid #e2e8f0;
  background: #f8fafc;
  padding: 10px 14px;
}

.table tbody td {
  padding: 12px 14px;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
}

.table-hover tbody tr:hover td {
  background: #f8fafc;
}

/* ── Badges ───────────────────────────────────────── */

.badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 5px;
  letter-spacing: .3px;
}

/* ── Forms ────────────────────────────────────────── */

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.form-control, .form-select {
  font-size: 0.875rem;
  border-color: #e2e8f0;
  border-radius: 7px;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}

.form-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 8px;
  margin-bottom: 16px;
  margin-top: 8px;
}

/* ── Buttons ──────────────────────────────────────── */

.btn {
  font-size: 0.85rem;
  border-radius: 7px;
  font-weight: 500;
}

.btn-sm {
  font-size: 0.78rem;
  padding: 3px 9px;
}

/* ── Alert / Flash ────────────────────────────────── */

.flash-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  min-width: 300px;
}

/* ── Network Diagram Editor ───────────────────────── */

#network-canvas {
  width: 100%;
  height: 540px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fafbfc;
}

.network-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px 10px 0 0;
  border-bottom: none;
}

.node-type-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  color: #475569;
}

.node-type-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #eff6ff;
}

.node-type-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.node-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Ticket Timeline ──────────────────────────────── */

.ticket-timeline {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ticket-timeline li {
  display: flex;
  gap: 12px;
  padding-bottom: 18px;
  position: relative;
}

.ticket-timeline li:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 32px;
  width: 2px;
  bottom: 0;
  background: #e2e8f0;
}

.timeline-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.timeline-content {
  flex: 1;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.875rem;
}

.timeline-meta {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-bottom: 4px;
}

/* ── Project Tasks (Kanban) ───────────────────────── */

.kanban-col {
  background: #f1f5f9;
  border-radius: 10px;
  padding: 12px;
  min-height: 200px;
}

.kanban-col-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: #64748b;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.task-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 0.85rem;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

.task-card-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity .15s;
}

.task-card:hover .task-card-actions {
  opacity: 1;
}

/* ── Search Box ───────────────────────────────────── */

.search-box {
  position: relative;
}

.search-box i {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 0.85rem;
}

.search-box input {
  padding-left: 32px;
}

/* ── Empty State ──────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #94a3b8;
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: .4;
  display: block;
}

.empty-state p {
  font-size: 0.95rem;
  margin-bottom: 20px;
}

/* ── Detail View ──────────────────────────────────── */

.detail-row {
  display: flex;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.875rem;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  width: 160px;
  flex-shrink: 0;
  font-weight: 600;
  color: #64748b;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: .4px;
  padding-top: 1px;
}

.detail-value {
  flex: 1;
  color: #1e293b;
}

/* ── Responsive ───────────────────────────────────── */

@media (max-width: 768px) {
  #sidebar {
    transform: translateX(-100%);
    transition: transform .25s;
  }
  #sidebar.open {
    transform: translateX(0);
  }
  #main-content {
    margin-left: 0;
  }
}

/* ── Scrollbar (main content) ─────────────────────── */

* {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}
