:root{
  --bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --bg-light: #f8f9fe;
  --card:#ffffff;
  --brand: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --brand-solid: #667eea;
  --brand-hover: #5568d3;
  --text:#1a202c;
  --text-light: #4a5568;
  --muted:#718096;
  --sidebar: linear-gradient(180deg, #1a202c 0%, #2d3748 100%);
  --success: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  --warning: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --danger: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  --info: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
  --shadow-sm: 0 2px 8px rgba(0,0,0,.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,.08);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.12);
}

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

html,body{height:100%; margin:0;}
body{
  background: var(--bg-light);
  color:var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
}

.navbar-brand{font-weight:700; letter-spacing:.3px;}
a{ text-decoration: none; transition: all 0.3s ease; }
a:hover { transform: translateY(-1px); }

/* Layout */
.layout{
  display:grid;
  grid-template-columns: 280px 1fr;
  min-height: calc(100vh - 70px);
  gap: 0;
}
@media (max-width: 991.98px){
  .layout{ grid-template-columns: 1fr; }
}

/* Sidebar */
.sidebar{
  background: var(--sidebar);
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  box-shadow: 4px 0 24px rgba(0,0,0,.1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: rgba(255,255,255,.05);
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.2);
  border-radius: 3px;
}

.sidebar .title{
  color:#fff;
  font-weight:700;
  font-size: 0.75rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin: 20px 12px 16px;
  opacity: 0.6;
}

.sidebar .nav-link{
  color: #cbd5e0;
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.sidebar .nav-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 3px;
  background: var(--brand-solid);
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

.sidebar .nav-link:hover{
  background: rgba(255,255,255,.1);
  color:#fff;
  transform: translateX(4px);
}

.sidebar .nav-link.active{
  background: rgba(255,255,255,.15);
  color:#fff;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
}

.sidebar .nav-link.active::before {
  transform: scaleY(1);
}

/* Cards */
.card{
  border: 0;
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.card-header{
  background: transparent;
  border-bottom: 1px solid #f0f0f0;
  padding: 20px 24px;
  font-weight: 600;
  font-size: 1.1rem;
}

.card-body {
  padding: 24px;
}

.badge{
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
}

/* Stat cards */
.stat{
  display: flex;
  gap: 16px;
  align-items: center;
}

.stat .ico{
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #fff;
  font-size: 1.5rem;
  box-shadow: 0 8px 16px rgba(102,126,234,.3);
}

.stat .val{
  font-size: 2rem;
  font-weight: 800;
  background: var(--brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat .hint{
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

/* Topbar */
.topbar{
  background: #fff;
  box-shadow: var(--shadow-sm);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.topbar .brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar .brand .logo {
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.topbar .search{
  flex: 1;
  max-width: 500px;
  margin: 0 20px;
}

.topbar .search input{
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  padding: 10px 16px;
  width: 100%;
  transition: all 0.3s ease;
}

.topbar .search input:focus {
  border-color: var(--brand-solid);
  box-shadow: 0 0 0 3px rgba(102,126,234,.1);
  outline: none;
}

/* Tables */
.table{
  border-collapse: separate;
  border-spacing: 0;
}

.table thead th{
  color: var(--text);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 1px;
  padding: 16px;
  border-bottom: 2px solid #e2e8f0;
  background: #f8f9fe;
}

.table tbody td{
  vertical-align: middle;
  padding: 16px;
  border-bottom: 1px solid #f0f0f0;
}

.table tbody tr {
  transition: all 0.2s ease;
}

.table tbody tr:hover{
  background: #f8f9fe;
  transform: scale(1.01);
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}

/* Buttons */
.btn{
  border-radius: 12px;
  padding: 10px 20px;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  box-shadow: var(--shadow-sm);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-primary{
  background: var(--brand-solid);
  color: #fff;
}

.btn-primary:hover{
  background: var(--brand-hover);
  color: #fff;
}

.btn-brand{
  background: var(--brand);
  color: #fff;
  border-radius: 12px;
}

.btn-brand:hover{
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102,126,234,.4);
  color: #fff;
}

.btn-success {
  background: #38ef7d;
  color: #fff;
}

.btn-warning {
  background: #f5576c;
  color: #fff;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.85rem;
}

/* Forms */
.form-control, .form-select{
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  padding: 10px 16px;
  transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus{
  border-color: var(--brand-solid);
  box-shadow: 0 0 0 3px rgba(102,126,234,.1);
  outline: none;
}

.form-label {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.input-group-text {
  border: 2px solid #e2e8f0;
  background: #f8f9fe;
  color: var(--text-light);
}

.input-group .form-control {
  border-left: 0;
}

.input-group .form-control:focus {
  border-left: 0;
}

.input-group-text:has(+ .form-control:focus) {
  border-color: var(--brand-solid);
}

/* Login page */
.auth-wrap{
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 16px;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.auth-wrap::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,.1) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: moveBackground 20s linear infinite;
}

@keyframes moveBackground {
  0% { transform: translate(0, 0); }
  100% { transform: translate(50px, 50px); }
}

.auth-card{
  max-width: 480px;
  width: 100%;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  backdrop-filter: blur(10px);
  background: rgba(255,255,255,.95);
  position: relative;
  z-index: 1;
}

/* Alerts */
.alert {
  border-radius: 12px;
  border: none;
  padding: 16px 20px;
  font-weight: 500;
}

.alert-success {
  background: linear-gradient(135deg, #11998e15 0%, #38ef7d15 100%);
  color: #11998e;
  border-left: 4px solid #38ef7d;
}

.alert-danger {
  background: linear-gradient(135deg, #fa709a15 0%, #fee14015 100%);
  color: #c53030;
  border-left: 4px solid #fa709a;
}

.alert-warning {
  background: linear-gradient(135deg, #f093fb15 0%, #f5576c15 100%);
  color: #c05621;
  border-left: 4px solid #f5576c;
}

/* Badges with gradients */
.badge.bg-primary {
  background: var(--brand) !important;
}

.badge.bg-success {
  background: var(--success) !important;
}

.badge.bg-warning {
  background: var(--warning) !important;
}

.badge.bg-danger {
  background: var(--danger) !important;
}

/* Page header */
.page-header {
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 2px solid #e2e8f0;
}

.page-header h1 {
  font-size: 2rem;
  font-weight: 800;
  background: var(--brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.card, .table tbody tr {
  animation: fadeIn 0.5s ease;
}

/* Main content */
main.container-fluid {
  padding: 32px;
  background: var(--bg-light);
}

/* Responsive */
@media (max-width: 991.98px) {
  .topbar { padding: 12px 20px; }
  main.container-fluid { padding: 20px; }
  .sidebar { display: none; }
}
