@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500;600&family=Syne:wght@700;800&display=swap');

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

:root {
  --accent: #1D9E75;
  --accent-dark: #157a5a;
  --accent-light: #e6f6f1;
  --warn: #BA7517;
  --warn-light: #fdf5e6;
  --danger: #A32D2D;
  --danger-light: #fef1f1;
  --info: #185FA5;
  --info-light: #e9f2fa;
  
  --bg: #f8f9fa;
  --sidebar-bg: #0c0c0e;
  --surface: #ffffff;
  --border: #eef0f2;
  --text: #1a1a1e;
  --text-muted: #64748b;
  
  --font-display: 'Syne', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
  
  --sidebar-w: 240px;
  --radius: 12px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  -webkit-font-smoothing: antialiased;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  min-height: 100vh;
  position: fixed;
  left: 0; top: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  border-right: 1px solid rgba(255,255,255,0.05);
}

.sidebar-logo {
  padding: 32px 24px 24px;
}
.sidebar-logo h1 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -1px;
  line-height: 1;
}
.sidebar-logo h1 span { color: var(--accent); }
.sidebar-logo p {
  font-size: 11px;
  color: #64748b;
  margin-top: 6px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-nav { flex: 1; padding: 12px 12px; }
.nav-label {
  font-size: 10px;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 24px 12px 8px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  color: #94a3b8;
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 4px;
  text-decoration: none;
}
.nav-item:hover { background: rgba(255,255,255,0.05); color: #fff; }
.nav-item.active { background: var(--accent); color: #fff; }
.nav-item .icon { font-size: 16px; opacity: 0.8; }
.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
}

.sidebar-footer {
  padding: 24px;
  border-top: 1px solid rgba(255,255,255,0.05);
}
#liveClock { 
  font-family: var(--font-mono);
  color: var(--accent); 
  font-weight: 600; 
  font-size: 12px;
}
.version-text {
  font-size: 10px;
  color: #475569;
  margin-top: 4px;
  font-weight: 500;
}

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

/* ── TOPBAR ── */
.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
}
.page-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -1px;
  color: #0f172a;
}
.page-subtitle { font-size: 14px; color: var(--text-muted); margin-top: 4px; }
.topbar-actions { display: flex; gap: 12px; }

/* ── BUTTONS ── */
.btn {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: #334155;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}
.btn:hover { background: #f8fafc; border-color: #cbd5e1; }
.btn-primary { 
  background: var(--accent); 
  color: #fff; 
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ── STATS GRID ── */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 32px; }
.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.stat-label { 
  font-size: 11px; 
  font-weight: 600; 
  color: var(--text-muted); 
  text-transform: uppercase; 
  letter-spacing: 0.8px; 
  margin-bottom: 12px; 
}
.stat-value { 
  font-family: var(--font-mono); 
  font-size: 36px; 
  font-weight: 600; 
  line-height: 1; 
  color: #0f172a;
  letter-spacing: -1px;
}
.stat-footer { font-size: 12px; color: var(--text-muted); margin-top: 10px; font-weight: 500; }
.stat-card.info .stat-value { color: var(--info); }
.stat-card.accent .stat-value { color: var(--accent); }
.stat-card.warn .stat-value { color: var(--warn); }
.stat-card.danger .stat-value { color: var(--danger); }

/* ── CARDS ── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.card-title { font-family: var(--font-display); font-size: 16px; font-weight: 700; color: #0f172a; }

/* ── LAB GRID ── */
.lab-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 12px;
  padding: 24px;
}
.pc-cell {
  aspect-ratio: 1;
  border-radius: 10px;
  border: 1px solid;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: var(--font-mono);
  gap: 6px;
  position: relative;
}
.pc-cell:hover { transform: translateY(-4px); box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); }
.pc-cell .pc-num { font-size: 11px; font-weight: 600; }
.pc-cell.free { background: #e6f6f1; color: #157a5a; border-color: #9fe1cb; }
.pc-cell.in-use { background: #e9f2fa; color: #185fa5; border-color: #b5d4f4; }
.pc-cell.maintenance { background: #fdf5e6; color: #ba7517; border-color: #fac775; }
.pc-cell.offline { background: #f1f5f9; color: #94a3b8; border-color: #e2e8f0; border-style: dashed; }

.legend { display: flex; gap: 20px; padding: 0 24px 20px; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); font-weight: 500; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; }

/* ── TABLES ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  padding: 14px 24px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  color: #334155;
}
tr:hover td { background: #fcfdfe; }
.mono { font-family: var(--font-mono); font-size: 12.5px; }

/* ── BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}
.badge-green { background: #e6f6f1; color: #157a5a; }
.badge-info { background: #e9f2fa; color: #185fa5; }
.badge-warn { background: #fdf5e6; color: #ba7517; }
.badge-danger { background: #fef1f1; color: #991b1b; }

/* ── TICKET CARDS ── */
.ticket-list { padding: 24px; }
.ticket-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  transition: all 0.2s;
  position: relative;
  display: flex;
  flex-direction: column;
}
.ticket-card:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.ticket-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.ticket-id { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); font-weight: 600; }
.ticket-title { font-size: 16px; font-weight: 600; color: #0f172a; margin-bottom: 8px; }
.ticket-meta { display: flex; gap: 20px; font-size: 13px; color: var(--text-muted); flex-wrap: wrap; }
.ticket-meta-item { display: flex; align-items: center; gap: 6px; }
.ticket-actions { margin-top: 20px; display: flex; gap: 10px; border-top: 1px solid var(--border); padding-top: 16px; }

/* ── MODALS ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface);
  border-radius: 16px;
  width: 540px;
  max-width: 90vw;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  animation: modalIn 0.3s ease-out;
}
@keyframes modalIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-header { padding: 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-family: var(--font-display); font-size: 18px; font-weight: 800; color: #0f172a; }
.modal-body { padding: 24px; }
.modal-footer { padding: 20px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 12px; background: #f8fafc; }

/* ── UTILS ── */
.mb-24 { margin-bottom: 24px; }
.mt-16 { margin-top: 16px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ── SEARCH BAR ── */
.search-bar { display: flex; gap: 12px; margin-bottom: 24px; }
.form-control {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(29, 158, 117, 0.1); }
