/* ============================================================
   SKUAST-K Degree Portal — Shared Design System
   ============================================================ */

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

:root {
  --primary: #6c5ce7;
  --primary-dark: #5849c2;
  --primary-light: #a29bfe;
  --accent: #00cec9;
  --accent-2: #fd79a8;
  --success: #10b981;
  --success-bg: #d1fae5;
  --danger: #ef4444;
  --danger-bg: #fee2e2;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --info: #3b82f6;
  --info-bg: #dbeafe;

  --ink-900: #1a1a2e;
  --ink-700: #2d2d4a;
  --ink-500: #64648a;
  --ink-300: #a0a0c0;
  --ink-100: #e8e8f5;

  --surface: #ffffff;
  --bg: #f3f2fb;
  --bg-alt: #f8f7fd;

  --sidebar-grad: linear-gradient(160deg, #1a1a3d 0%, #2b1f5c 55%, #3a1f6b 100%);
  --brand-grad: linear-gradient(135deg, #6c5ce7 0%, #a06cf0 50%, #fd79a8 100%);
  --brand-grad-soft: linear-gradient(135deg, rgba(108,92,231,.12), rgba(253,121,168,.12));

  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 2px 8px rgba(26,26,62,.06);
  --shadow-md: 0 8px 24px rgba(26,26,62,.09);
  --shadow-lg: 0 20px 50px rgba(26,26,62,.16);
  --sidebar-w: 264px;
}

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

body {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--ink-700);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand-font { font-family: 'Poppins', 'Inter', sans-serif; }

::selection { background: var(--primary-light); color: #fff; }

a { color: inherit; }

/* ---------------- Scrollbar ---------------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--ink-300); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-500); }

/* ---------------- Sidebar ---------------- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-grad);
  color: #fff;
  height: 100vh;
  position: fixed;
  top: 0; left: 0;
  padding: 26px 0;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 4px 0 24px rgba(20,10,50,.25);
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 22px 22px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar .brand .logo-badge {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: var(--brand-grad);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  box-shadow: 0 6px 16px rgba(108,92,231,.45);
  flex-shrink: 0;
}
.sidebar .brand .brand-text { line-height: 1.25; }
.sidebar .brand .brand-text .t1 { font-weight: 800; font-size: 15px; letter-spacing: .2px; }
.sidebar .brand .brand-text .t2 { font-size: 10.5px; color: rgba(255,255,255,.55); letter-spacing: .4px; text-transform: uppercase; }

.sidebar .user-info {
  margin: 0 16px 20px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar .user-info .avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--brand-grad);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.sidebar .user-info .meta { min-width: 0; }
.sidebar .user-info .name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar .user-info .email { font-size: 11px; color: rgba(255,255,255,.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar .user-info .role-pill {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: .4px;
  background: rgba(255,255,255,.12); padding: 1px 7px; border-radius: 20px;
  display: inline-block; margin-top: 3px; color: rgba(255,255,255,.75);
}

.sidebar nav { padding: 0 12px; }
.sidebar a.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; margin-bottom: 3px;
  border-radius: 10px;
  color: rgba(255,255,255,.62);
  text-decoration: none;
  font-size: 13.5px; font-weight: 500;
  transition: all .2s ease;
  position: relative;
}
.sidebar a.nav-link i { width: 18px; text-align: center; font-size: 14px; }
.sidebar a.nav-link:hover { background: rgba(255,255,255,.08); color: #fff; transform: translateX(2px); }
.sidebar a.nav-link.active {
  background: var(--brand-grad);
  color: #fff;
  box-shadow: 0 6px 18px rgba(108,92,231,.4);
}
.sidebar .nav-logout-wrap { margin-top: 22px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.1); }

/* ---------------- Layout ---------------- */
.main-content { margin-left: var(--sidebar-w); padding: 28px 32px 50px; min-height: 100vh; }

.page-header {
  background: var(--surface);
  padding: 22px 28px;
  border-radius: var(--radius);
  margin-bottom: 26px;
  box-shadow: var(--shadow-sm);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
  border: 1px solid rgba(26,26,62,.04);
}
.page-header h1 { font-size: 22px; color: var(--ink-900); font-weight: 700; }
.page-header .subtitle { font-size: 13px; color: var(--ink-500); margin-top: 3px; font-weight: 400; font-family: 'Inter'; }

/* ---------------- Cards ---------------- */
.card {
  background: var(--surface);
  padding: 28px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(26,26,62,.04);
}

/* ---------------- Buttons ---------------- */
.btn {
  background: var(--brand-grad);
  color: #fff;
  border: none;
  padding: 11px 24px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  transition: all .2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(108,92,231,.3);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(108,92,231,.4); }
.btn:active { transform: translateY(0); }
.btn-secondary { background: var(--ink-100); color: var(--ink-700); box-shadow: none; }
.btn-secondary:hover { background: #dcdcf0; box-shadow: none; }
.btn-success { background: linear-gradient(135deg,#10b981,#0ea36f); box-shadow: 0 4px 14px rgba(16,185,129,.3); }
.btn-success:hover { box-shadow: 0 8px 20px rgba(16,185,129,.4); }
.btn-danger { background: linear-gradient(135deg,#ef4444,#dc2626); box-shadow: 0 4px 14px rgba(239,68,68,.3); }
.btn-danger:hover { box-shadow: 0 8px 20px rgba(239,68,68,.4); }
.btn-primary { background: var(--brand-grad); }
.btn-sm { padding: 7px 14px; font-size: 12px; border-radius: 8px; }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.btn-logout { background: var(--danger-bg); color: var(--danger); border: none; padding: 9px 18px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 13px; transition: all .2s; }
.btn-logout:hover { background: var(--danger); color: #fff; }

/* ---------------- Forms ---------------- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; color: var(--ink-700); font-weight: 600; font-size: 13px; }
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--ink-100);
  border-radius: var(--radius-sm);
  font-size: 14px; font-family: inherit;
  background: var(--bg-alt);
  transition: all .2s;
  color: var(--ink-900);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--primary); background: #fff;
  box-shadow: 0 0 0 4px rgba(108,92,231,.12);
}
.form-group input[type="file"] {
  width: 100%; padding: 10px; border-radius: var(--radius-sm);
  border: 1.5px dashed var(--ink-300); background: var(--bg-alt); font-size: 13px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 22px; }
.full-width { grid-column: 1 / -1; }

/* ---------------- Alerts ---------------- */
.error, .success, .message {
  padding: 13px 18px; border-radius: 12px; margin-bottom: 20px;
  font-size: 13.5px; font-weight: 500; display: flex; align-items: center; gap: 10px;
  border-left: 4px solid;
}
.error { background: var(--danger-bg); color: #b91c1c; border-color: var(--danger); }
.success, .message { background: var(--success-bg); color: #047857; border-color: var(--success); }

/* ---------------- Status badges ---------------- */
.status-badge { padding: 4px 13px; border-radius: 20px; font-size: 11px; font-weight: 700; display: inline-flex; align-items:center; gap:5px; letter-spacing:.2px; text-transform: uppercase; }
.status-badge::before { content:''; width:6px; height:6px; border-radius:50%; background: currentColor; }
.status-draft { background: var(--warning-bg); color: #92610a; }
.status-generated { background: var(--info-bg); color: #1d4ed8; }
.status-issued { background: var(--success-bg); color: #047857; }

/* ---------------- Tables ---------------- */
.table-container { background: var(--surface); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); overflow-x: auto; border: 1px solid rgba(26,26,62,.04); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 13px 14px; background: var(--bg-alt); color: var(--ink-500); font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; }
th:first-child { border-radius: 10px 0 0 10px; }
th:last-child { border-radius: 0 10px 10px 0; }
td { padding: 13px 14px; border-bottom: 1px solid var(--ink-100); font-size: 13.5px; color: var(--ink-700); }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: var(--bg-alt); }
td img.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 10px; border: 2px solid var(--ink-100); }

/* ---------------- Stat cards ---------------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 20px; margin-bottom: 28px; }
.stat-card {
  background: var(--surface); padding: 22px 24px; border-radius: var(--radius);
  box-shadow: var(--shadow-sm); border: 1px solid rgba(26,26,62,.04);
  position: relative; overflow: hidden;
}
.stat-card::before { content:''; position:absolute; top:0; left:0; width:5px; height:100%; background: var(--brand-grad); }
.stat-card .stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-card .icon { width: 42px; height: 42px; border-radius: 12px; background: var(--brand-grad-soft); display:flex; align-items:center; justify-content:center; color: var(--primary); font-size: 17px; }
.stat-card .number { font-size: 30px; font-weight: 800; color: var(--ink-900); margin-top: 14px; font-family: 'Poppins'; }
.stat-card .label { color: var(--ink-500); font-size: 12.5px; margin-top: 4px; font-weight: 600; }

/* ---------------- Pagination ---------------- */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 22px; }
.pagination a, .pagination span { padding: 8px 15px; border: 1.5px solid var(--ink-100); border-radius: 8px; text-decoration: none; color: var(--ink-500); font-size: 13px; font-weight: 600; transition: all .15s; }
.pagination .active { background: var(--brand-grad); color: #fff; border-color: transparent; }
.pagination a:hover { background: var(--bg-alt); border-color: var(--primary-light); }

/* ---------------- Misc ---------------- */
.hint { color: var(--ink-500); font-size: 12.5px; margin-top: 5px; }
.instructions { background: var(--bg-alt); padding: 20px 22px; border-radius: var(--radius-sm); margin-top: 20px; border: 1px solid var(--ink-100); }
.instructions h4 { color: var(--ink-900); margin-bottom: 10px; font-size: 14px; }
.instructions ul { list-style: none; padding: 0; }
.instructions ul li { padding: 5px 0; color: var(--ink-500); font-size: 13px; }
.instructions ul li:before { content: "▸ "; color: var(--primary); font-weight: bold; }

@media (max-width: 900px) {
  :root { --sidebar-w: 76px; }
  .sidebar .brand .brand-text, .sidebar .user-info .meta, .sidebar a.nav-link span { display: none; }
  .sidebar .brand, .sidebar .user-info { justify-content: center; padding-left: 0; padding-right: 0; }
  .sidebar a.nav-link { justify-content: center; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 576px) {
  .main-content { padding: 18px; }
}
