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

:root {
  --primary-color: #6366f1;
  --primary-hover: #818cf8;
  --primary-light: rgba(99, 102, 241, 0.2);
  --bg-body: #0a0b10;
  --bg-sidebar: #0f121b;
  --bg-surface: #141824;
  --bg-surface-hover: #1e2436;
  --bg-input: #1b2031;
  --text-primary: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: #272f43;
  --danger-color: #ef4444;
  --success-color: #10b981;
  
  --sidebar-w: 280px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 9999px;
  --shadow-base: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-body);
  color: var(--text-primary);
  font-size: 14px;
}

h1, h2, h3, h4 { color: var(--text-primary); font-weight: 600; }
a { text-decoration: none; color: var(--primary-color); }
button { font-family: inherit; cursor: pointer; }

/* Layout Wrapper */
.layout-wrapper { display: flex; height: 100vh; overflow: hidden; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex; flex-direction: column;
  padding: 1.5rem 0;
  flex-shrink: 0;
}
.sidebar-brand { display: flex; align-items: center; gap: 0.75rem; padding: 0 1.5rem 1.5rem; }
.sidebar-brand h1 { font-size: 1.5rem; letter-spacing: -0.5px; }
.brand-icon h1 { color: var(--text-primary); }
.user-info { padding: 1rem 1.5rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border-color); }
.user-name { font-weight: 600; font-size: 0.95rem; }
.user-role { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.5px; }

.sidebar-links { display: flex; flex-direction: column; gap: 0.25rem; flex: 1; padding: 0 1rem; }
.sidebar-links a {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 1rem; color: var(--text-muted);
  border-radius: var(--radius-md); font-weight: 500;
  transition: all 0.2s;
}
.sidebar-links a svg { width: 18px; height: 18px; }
.sidebar-links a:hover { background: var(--bg-surface); color: var(--text-primary); }
.sidebar-links a.router-link-active { background: var(--primary-color); color: #fff; }

.sidebar-footer { padding: 1rem 1.5rem; }
.btn-logout {
  display: flex; align-items: center; gap: 0.5rem; color: var(--danger-color);
  font-weight: 500; transition: color 0.2s;
}
.btn-logout:hover { color: #f87171; }
.btn-logout svg { width: 18px; height: 18px; }

/* Main layout */
.main-content {
  flex: 1; padding: 2rem 3rem; overflow-y: auto;
  position: relative;
}

/* Glass panel / Cards */
.glass-panel {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 1.5rem; margin-bottom: 1.5rem;
}

/* Forms */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); font-weight: 600;}
.form-control {
  width: 100%; padding: 0.75rem 1rem; background: var(--bg-input);
  border: 1px solid var(--border-color); border-radius: var(--radius-md);
  color: var(--text-primary); outline: none; transition: 0.2s;
}
.form-control:focus { border-color: var(--primary-color); }
textarea.form-control { resize: vertical; min-height: 80px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.75rem 1.5rem; border-radius: var(--radius-md); gap: 0.5rem;
  border: none; font-weight: 500; font-size: 0.9rem; transition: 0.2s;
}
.btn-primary { background: var(--primary-color); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-outline { background: transparent; border: 1px solid var(--border-color); color: var(--text-primary); }
.btn-outline:hover { background: var(--bg-surface-hover); }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.8rem; }

/* Student Cards (Report) */
.student-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem; margin-bottom: 1rem;
  display: flex; gap: 2rem;
  align-items: stretch;
}
.student-meta { flex: 0 0 160px; border-right: 1px dashed var(--border-color); padding-right: 1.5rem; }
.student-meta .stt { font-size: 0.75rem; color: var(--primary-color); font-weight: 600; letter-spacing: 1px; margin-bottom: 0.5rem; }
.student-meta h4 { font-size: 1.1rem; margin-bottom: 0.25rem; }
.student-meta .student-id { font-size: 0.8rem; color: var(--text-muted); font-family: monospace; }

.student-actions { flex: 1; display: flex; flex-direction: column; }
.action-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.5rem; font-weight: 600; }
.violation-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pill {
  background: var(--bg-input); border: 1px solid var(--border-color);
  color: var(--text-muted); padding: 0.4rem 0.8rem; border-radius: var(--radius-pill);
  font-size: 0.8rem; cursor: pointer; transition: all 0.2s; user-select: none;
}
.pill:hover { border-color: var(--primary-color); color: var(--text-primary); }
.pill.active { background: var(--primary-color); border-color: var(--primary-color); color: white; }

.student-feedback { flex: 0 0 250px; }

/* Report Bottom Bar */
.report-bottom-bar {
  position: sticky; bottom: 0; left: 0; right: 0;
  background: var(--bg-sidebar); border-top: 1px solid var(--border-color);
  padding: 1rem 2rem; margin: 2rem -3rem -2rem -3rem;
  display: flex; justify-content: space-between; align-items: center;
  box-shadow: 0 -10px 20px rgba(0,0,0,0.2); z-index: 100;
}
.report-bottom-info { color: var(--text-muted); font-size: 0.9rem; }
.report-bottom-actions { display: flex; gap: 1rem; }

/* Statistics Summary Cards */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; margin-bottom: 1.5rem; }
.stat-card {
  background: var(--bg-surface); border: 1px solid var(--border-color);
  border-radius: var(--radius-lg); padding: 1.25rem;
}
.stat-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; font-weight: 600; margin-bottom: 0.5rem; box-sizing: border-box; }
.stat-value { font-size: 2rem; font-weight: 700; color: var(--text-primary); }
.stat-trend { font-size: 0.8rem; color: var(--success-color); display: flex; align-items: center; gap: 0.25rem; margin-top: 0.25rem; }
.stat-trend.danger { color: var(--danger-color); }

/* Table specific styling */
.table-wrapper {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
}
.table-toolbar {
  padding: 1rem 1.5rem; border-bottom: 1px solid var(--border-color);
  display: flex; justify-content: space-between; gap: 1rem;
}
.search-wrapper { position: relative; max-width: 300px; width: 100%; }
.search-input { width: 100%; padding: 0.5rem 1rem 0.5rem 2.5rem; background: var(--bg-input); border: 1px solid var(--border-color); border-radius: var(--radius-md); color: white; }
.search-icon { position: absolute; left: 0.8rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); }

.table { width: 100%; border-collapse: collapse; text-align: left; }
.table th, .table td { padding: 0.8rem 1.5rem; border-bottom: 1px solid var(--border-color); }
.table th { font-size: 0.75rem; text-transform: uppercase; color: var(--text-muted); font-weight: 600; letter-spacing: 0.5px; background: rgba(0,0,0,0.1); }
.table tbody tr:hover { background: var(--bg-surface-hover); }
.table td { font-size: 0.85rem; }
.badge { padding: 0.25rem 0.5rem; border-radius: var(--radius-pill); font-size: 0.7rem; font-weight: 600; background: var(--bg-input); border: 1px solid var(--border-color); color: var(--text-muted); }
.badge-blue { background: rgba(99, 102, 241, 0.1); color: var(--primary-hover); border-color: rgba(99, 102, 241, 0.2); }
.text-muted { color: var(--text-muted); }

/* Status */
.alert { padding: 1rem; border-radius: var(--radius-md); margin-bottom: 1rem; font-size: 0.9rem; }
.alert-danger { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.2); color: #fca5a5; }
.alert-success { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.2); color: #6ee7b7; }

/* Login */
.login-container { max-width: 400px; margin: 10vh auto; padding: 2.5rem; background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-lg); box-shadow: var(--shadow-base); }
.logo-icon { display: flex; justify-content: center; margin-bottom: 1.5rem; color: var(--primary-color); }
.spinner { border: 2px solid rgba(255,255,255,0.2); border-left-color: white; border-radius: 50%; width: 18px; height: 18px; animation: spin 1s linear infinite; }
@keyframes spin { 100% { transform: rotate(360deg); } }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-body); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Pagination */
.pagination { display: flex; justify-content: flex-end; align-items: center; padding: 1rem 1.5rem; gap: 0.5rem; border-top: 1px solid var(--border-color); }
.page-btn { background: var(--bg-input); border: 1px solid var(--border-color); color: var(--text-muted); width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-md); font-size: 0.8rem; cursor: pointer; transition: 0.2s;}
.page-btn:hover:not(:disabled) { background: var(--bg-surface-hover); color: white; }
.page-btn.active { background: var(--primary-color); border-color: var(--primary-color); color: white; }
.page-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.page-info { margin-right: auto; font-size: 0.8rem; color: var(--text-muted); }
