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

:root{
  --red-900:#7f1d1d;
  --red-800:#991b1b;
  --red-700:#b91c1c;
  --red-600:#dc2626;
  --red-500:#ef4444;
  --red-400:#f87171;
  --red-100:#fee2e2;
  --red-50:#fef2f2;
  --white:#ffffff;
  --gray-50:#f9fafb;
  --gray-100:#f3f4f6;
  --gray-200:#e5e7eb;
  --gray-300:#d1d5db;
  --gray-400:#9ca3af;
  --gray-500:#6b7280;
  --gray-600:#4b5563;
  --gray-700:#374151;
  --gray-800:#1f2937;
  --gray-900:#111827;
  --shadow-sm:0 1px 2px rgba(0,0,0,.05);
  --shadow:0 4px 16px rgba(153,27,27,.08);
  --shadow-lg:0 12px 40px rgba(153,27,27,.15);
  --shadow-xl:0 25px 60px rgba(0,0,0,.25);
  --radius:14px;
  --radius-lg:20px;
  --transition:.25s cubic-bezier(.4,0,.2,1);
}

*{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}

body{
  font-family:'Inter',sans-serif;
  background:var(--gray-50);
  color:var(--gray-900);
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
}

/* ============ SIDEBAR ============ */
.sidebar{
  position:fixed;
  left:0;top:0;
  width:260px;height:100vh;
  background:linear-gradient(180deg,#7f1d1d 0%,#991b1b 40%,#b91c1c 100%);
  padding:24px 14px;
  display:flex;flex-direction:column;
  z-index:20;
  box-shadow:4px 0 24px rgba(127,29,29,.25);
  overflow-y:auto;
}
.sidebar::-webkit-scrollbar{width:5px}
.sidebar::-webkit-scrollbar-thumb{background:rgba(255,255,255,.2);border-radius:10px}

.brand{
  color:#fff;
  padding:8px 14px 26px;
  font-size:17px;
  font-weight:800;
  letter-spacing:-.3px;
  border-bottom:1px solid rgba(255,255,255,.12);
  margin-bottom:16px;
}
.brand i{
  color:#fff;
  font-size:26px;
  margin-right:10px;
  background:rgba(255,255,255,.15);
  width:42px;height:42px;
  display:inline-grid;place-items:center;
  border-radius:12px;
  vertical-align:middle;
}
.brand span{vertical-align:middle}
.brand small{
  display:block;
  color:rgba(255,255,255,.7);
  font-weight:500;
  margin:8px 0 0 52px;
  font-size:11px;
  letter-spacing:1.5px;
  text-transform:uppercase;
}

.sidebar a{
  color:rgba(255,255,255,.85);
  text-decoration:none;
  padding:12px 14px;
  border-radius:11px;
  margin:3px 0;
  font-weight:600;
  font-size:14px;
  display:flex;
  align-items:center;
  gap:12px;
  transition:var(--transition);
  position:relative;
  overflow:hidden;
}
.sidebar a::before{
  content:'';
  position:absolute;
  left:0;top:0;bottom:0;
  width:3px;
  background:#fff;
  transform:scaleY(0);
  transition:var(--transition);
}
.sidebar a:hover{
  background:rgba(255,255,255,.12);
  color:#fff;
  transform:translateX(3px);
}
.sidebar a:hover::before{transform:scaleY(1)}
.sidebar a i{
  width:22px;
  text-align:center;
  font-size:15px;
}
.logout{
  margin-top:auto !important;
  background:rgba(0,0,0,.2) !important;
  color:#fff !important;
  border:1px solid rgba(255,255,255,.15);
}
.logout:hover{background:rgba(0,0,0,.35) !important}

/* ============ MAIN ============ */
.main{
  margin-left:260px;
  min-height:100vh;
  display:flex;
  flex-direction:column;
}

.topbar{
  height:74px;
  background:var(--white);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 30px;
  border-bottom:1px solid var(--gray-200);
  box-shadow:0 1px 3px rgba(0,0,0,.04);
  position:sticky;
  top:0;
  z-index:15;
}
.topbar b{font-size:15px;color:var(--gray-900)}
.topbar .muted{font-size:12px;color:var(--gray-400);font-weight:500}

.avatar{
  width:44px;height:44px;
  border-radius:50%;
  background:linear-gradient(135deg,var(--red-600),var(--red-800));
  color:#fff;
  display:grid;place-items:center;
  font-size:17px;
  box-shadow:0 4px 12px rgba(220,38,38,.35);
  border:2px solid var(--white);
}

.mobile-menu{
  display:none;
  border:0;
  background:var(--red-50);
  color:var(--red-700);
  padding:10px 13px;
  border-radius:10px;
  font-size:16px;
  cursor:pointer;
  transition:var(--transition);
}
.mobile-menu:hover{background:var(--red-100)}

.content{padding:30px;flex:1}

/* ============ PAGE TITLE ============ */
.page-title{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:26px;
  gap:16px;
  flex-wrap:wrap;
}
.page-title h1{
  font-size:26px;
  font-weight:800;
  letter-spacing:-.5px;
  color:var(--gray-900);
  display:flex;
  align-items:center;
  gap:12px;
}
.page-title h1::before{
  content:'';
  width:5px;height:28px;
  background:linear-gradient(180deg,var(--red-500),var(--red-800));
  border-radius:10px;
}
.muted{font-size:12px;color:var(--gray-400)}

/* ============ GRID ============ */
.grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:20px;
}

/* ============ CARD ============ */
.card{
  background:var(--white);
  border-radius:var(--radius-lg);
  padding:22px;
  box-shadow:var(--shadow);
  border:1px solid var(--gray-100);
  transition:var(--transition);
}
.card:hover{box-shadow:var(--shadow-lg);transform:translateY(-2px)}

.stat{display:flex;align-items:center;gap:16px}
.stat .ico{
  width:56px;height:56px;
  border-radius:16px;
  background:linear-gradient(135deg,var(--red-50),var(--red-100));
  color:var(--red-700);
  display:grid;place-items:center;
  font-size:22px;
  flex-shrink:0;
  border:1px solid var(--red-100);
}
.stat h2{
  margin:0;
  font-size:28px;
  font-weight:800;
  letter-spacing:-1px;
  color:var(--gray-900);
}
.stat p{
  margin:3px 0 0;
  color:var(--gray-500);
  font-size:13px;
  font-weight:500;
}

/* ============ TABLE ============ */
.table-wrap{
  overflow:auto;
  border-radius:var(--radius);
  border:1px solid var(--gray-100);
  background:var(--white);
}
.table{
  width:100%;
  border-collapse:collapse;
  min-width:600px;
}
.table th,.table td{
  padding:14px 16px;
  text-align:left;
  border-bottom:1px solid var(--gray-100);
  font-size:14px;
}
.table th{
  font-size:11px;
  text-transform:uppercase;
  color:var(--gray-500);
  font-weight:700;
  letter-spacing:.7px;
  background:var(--red-50);
  border-bottom:2px solid var(--red-100);
}
.table tbody tr{transition:var(--transition)}
.table tbody tr:hover{background:var(--red-50)}
.table tbody tr:last-child td{border-bottom:0}

/* ============ BUTTONS ============ */
.btn{
  border:0;
  border-radius:11px;
  padding:11px 18px;
  font-weight:700;
  font-size:13.5px;
  cursor:pointer;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  gap:8px;
  transition:var(--transition);
  white-space:nowrap;
  font-family:inherit;
}
.btn:hover{transform:translateY(-2px);box-shadow:0 6px 16px rgba(0,0,0,.15)}
.btn:active{transform:translateY(0)}

.btn-primary{
  background:linear-gradient(135deg,var(--red-600),var(--red-800));
  color:#fff;
  box-shadow:0 4px 12px rgba(220,38,38,.3);
}
.btn-primary:hover{box-shadow:0 8px 20px rgba(220,38,38,.4)}

.btn-success{
  background:linear-gradient(135deg,#16a34a,#15803d);
  color:#fff;
  box-shadow:0 4px 12px rgba(22,163,74,.3);
}

.btn-dark{
  background:linear-gradient(135deg,var(--gray-800),var(--gray-900));
  color:#fff;
}

.btn-warning{
  background:linear-gradient(135deg,#f59e0b,#d97706);
  color:#fff;
}

.btn-danger{
  background:linear-gradient(135deg,var(--red-600),var(--red-800));
  color:#fff;
}

.btn-soft{
  background:var(--red-50);
  color:var(--red-700);
  border:1px solid var(--red-100);
}
.btn-soft:hover{background:var(--red-100)}

.btn-sm{padding:8px 12px;font-size:12px;border-radius:9px}

/* ============ TOOLBAR ============ */
.toolbar{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}

/* ============ FORM ============ */
.form-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:18px;
}
.form-group{display:flex;flex-direction:column;gap:8px}
.form-group.full{grid-column:1/-1}

label{
  font-weight:600;
  font-size:13.5px;
  color:var(--gray-700);
}

input,textarea,select{
  border:1.5px solid var(--gray-200);
  border-radius:11px;
  padding:12px 14px;
  font:inherit;
  font-size:14px;
  outline:none;
  background:var(--white);
  transition:var(--transition);
  color:var(--gray-900);
  width:100%;
}
textarea{min-height:150px;resize:vertical;line-height:1.6}

input:focus,textarea:focus,select:focus{
  border-color:var(--red-500);
  box-shadow:0 0 0 4px var(--red-100);
  background:var(--white);
}
input::placeholder,textarea::placeholder{color:var(--gray-400)}

/* ============ ALERT ============ */
.alert{
  padding:14px 16px;
  border-radius:12px;
  margin-bottom:16px;
  font-size:14px;
  font-weight:600;
  display:flex;
  align-items:center;
  gap:10px;
  border-left:4px solid;
}
.alert-success{
  background:#dcfce7;
  color:#166534;
  border-color:#16a34a;
}
.alert-danger{
  background:var(--red-50);
  color:var(--red-800);
  border-color:var(--red-600);
}

/* ============ LOGIN ============ */
.login{
  min-height:100vh;
  display:grid;
  place-items:center;
  background:linear-gradient(135deg,#7f1d1d 0%,#991b1b 50%,#450a0a 100%);
  position:relative;
  overflow:hidden;
  padding:20px;
}
.login::before{
  content:'';
  position:absolute;
  inset:0;
  background:radial-gradient(circle at 20% 20%,rgba(255,255,255,.08),transparent 50%),
             radial-gradient(circle at 80% 80%,rgba(255,255,255,.06),transparent 50%);
}
.login-card{
  width:min(430px,100%);
  background:var(--white);
  padding:40px 36px;
  border-radius:24px;
  box-shadow:var(--shadow-xl);
  position:relative;
  z-index:2;
  border-top:5px solid var(--red-600);
}
.login-logo{text-align:center;margin-bottom:28px}
.login-logo i{
  font-size:38px;
  color:#fff;
  background:linear-gradient(135deg,var(--red-600),var(--red-800));
  width:76px;height:76px;
  display:inline-grid;place-items:center;
  border-radius:22px;
  margin-bottom:14px;
  box-shadow:0 10px 30px rgba(220,38,38,.4);
}
.login-logo h1{font-size:22px;font-weight:800;color:var(--gray-900);margin-bottom:5px}
.login-logo p{font-size:13px;color:var(--gray-500);font-weight:500}

/* ============ BADGE ============ */
.badge{
  padding:5px 11px;
  border-radius:999px;
  background:var(--red-50);
  color:var(--red-700);
  font-size:11px;
  font-weight:700;
  border:1px solid var(--red-100);
  display:inline-flex;
  align-items:center;
  gap:5px;
}

/* ============ ACTION ROW ============ */
.action-row{display:flex;gap:8px;flex-wrap:wrap;align-items:center}

/* ============ CHECKBOXES ============ */
.checkboxes{display:flex;gap:12px;flex-wrap:wrap}
.checkboxes label{
  display:flex;
  align-items:center;
  gap:7px;
  font-weight:500;
  padding:8px 12px;
  background:var(--gray-50);
  border-radius:9px;
  border:1.5px solid var(--gray-200);
  cursor:pointer;
  transition:var(--transition);
  font-size:13px;
}
.checkboxes label:hover{border-color:var(--red-400);background:var(--red-50)}
.checkboxes input[type=checkbox]{
  width:auto;
  accent-color:var(--red-600);
  cursor:pointer;
}

/* ============ EMPTY ============ */
.empty{
  text-align:center;
  padding:50px 20px;
  color:var(--gray-400);
  font-size:14px;
}
.empty i{
  font-size:48px;
  color:var(--red-100);
  display:block;
  margin-bottom:14px;
}

/* ============ RESPONSIVE ============ */
@media(max-width:1024px){
  .grid{grid-template-columns:repeat(2,1fr)}
}

@media(max-width:900px){
  .sidebar{transform:translateX(-100%);transition:transform .3s ease}
  .sidebar.open{transform:translateX(0)}
  .main{margin-left:0}
  .mobile-menu{display:block}
  .grid{grid-template-columns:1fr 1fr}
  .form-grid{grid-template-columns:1fr}
}

@media(max-width:560px){
  .grid{grid-template-columns:1fr}
  .content{padding:18px}
  .topbar{padding:0 18px}
  .page-title{align-items:flex-start;gap:12px;flex-direction:column}
  .page-title h1{font-size:22px}
  .login-card{padding:30px 24px}
  .stat h2{font-size:24px}
}