/* ============================================================
   Sirat Organization — Dashboard Stylesheet
   ============================================================ */

:root {
  --sidebar-width: 260px;
  --sidebar-bg:    #1a1a2e;
  --sidebar-hover: rgba(255,255,255,0.07);
  --sidebar-active:#2e7d32;
  --topbar-height: 60px;
  --card-radius:   12px;
  --primary:       #2e7d32;
  --secondary:     #f9a825;
  --accent:        #1565c0;
  --danger:        #d32f2f;
  --warning:       #f57f17;
  --bg-main:       #f0f2f5;
  --white:         #ffffff;
  --border:        #e5e7eb;
  --text-dark:     #1a1a2e;
  --text-muted:    #6b7280;
  --shadow:        0 2px 12px rgba(0,0,0,0.07);
}

/* ── RESET ─────────────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }
body.dashboard-body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-main);
  color: var(--text-dark);
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ───────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 1000;
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}
.sidebar-brand {
  padding: 22px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.sidebar-brand .brand-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  display: flex; align-items: center; gap: 10px;
}
.brand-icon {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--primary); display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #fff; flex-shrink: 0;
}
.sidebar-role {
  font-size: 11px; color: rgba(255,255,255,0.45);
  text-transform: uppercase; letter-spacing: 1.5px;
  padding: 0 24px; margin: 14px 0 6px;
}
.sidebar-nav { flex: 1; padding: 8px 12px; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 8px; margin-bottom: 2px;
  color: rgba(255,255,255,0.70); font-size: 0.88rem; font-weight: 500;
  text-decoration: none; transition: all 0.2s ease;
}
.sidebar-nav a i { width: 20px; text-align: center; font-size: 0.95rem; }
.sidebar-nav a:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar-nav a.active {
  background: var(--primary); color: #fff;
  box-shadow: 0 3px 10px rgba(46,125,50,0.35);
}
.sidebar-nav .nav-group-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px;
  color: rgba(255,255,255,0.3); padding: 14px 14px 4px; font-weight: 600;
}
.sidebar-user {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; gap: 12px;
  flex-shrink: 0;
}
.sidebar-user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary); display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.sidebar-user-name { font-size: 0.85rem; color: #fff; font-weight: 600; }
.sidebar-user-role { font-size: 0.75rem; color: rgba(255,255,255,0.5); }
.sidebar-user-logout { margin-left: auto; color: rgba(255,255,255,0.4); font-size: 14px; }
.sidebar-user-logout:hover { color: #f44336; }

/* ── MAIN CONTENT ──────────────────────────────────────────── */
.dashboard-main {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.dashboard-topbar {
  height: var(--topbar-height);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  position: sticky; top: 0; z-index: 999;
  box-shadow: 0 1px 8px rgba(0,0,0,0.04);
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.page-title  { font-size: 1rem; font-weight: 700; color: var(--text-dark); }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-btn { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 1.1rem; padding: 6px; border-radius: 6px; transition: all 0.2s; }
.topbar-btn:hover { background: var(--bg-main); color: var(--text-dark); }
.sidebar-toggle { display: none; }

.dashboard-content {
  padding: 28px;
  flex: 1;
}

/* ── STAT CARDS ────────────────────────────────────────────── */
.stat-card {
  background: var(--white);
  border-radius: var(--card-radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
  display: flex; align-items: flex-start; justify-content: space-between;
  border: 1px solid var(--border);
  transition: all 0.25s ease;
}
.stat-card:hover { box-shadow: 0 6px 24px rgba(0,0,0,0.1); transform: translateY(-2px); }
.stat-card-icon {
  width: 52px; height: 52px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex-shrink: 0;
}
.stat-green  { background: #e8f5e9; color: var(--primary); }
.stat-gold   { background: #fff8e1; color: var(--warning); }
.stat-blue   { background: #e3f2fd; color: var(--accent); }
.stat-red    { background: #fce4ec; color: var(--danger); }
.stat-purple { background: #f3e5f5; color: #7b1fa2; }
.stat-label  { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value  { font-size: 1.8rem; font-weight: 800; color: var(--text-dark); line-height: 1; }
.stat-change { font-size: 0.78rem; margin-top: 4px; }
.stat-change.up   { color: var(--primary); }
.stat-change.down { color: var(--danger); }

/* ── DATA TABLES ───────────────────────────────────────────── */
.data-card {
  background: var(--white); border-radius: var(--card-radius);
  box-shadow: var(--shadow); border: 1px solid var(--border); overflow: hidden;
}
.data-card-header {
  padding: 16px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.data-card-header h5 { font-size: 0.97rem; font-weight: 700; margin: 0; }
.data-card-body { padding: 0; overflow-x: auto; }
.data-table {
  width: 100%; border-collapse: collapse; font-size: 0.875rem;
}
.data-table thead th {
  background: #f9fafb; color: var(--text-muted); font-size: 0.75rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  padding: 10px 16px; text-align: left; border-bottom: 1px solid var(--border);
}
.data-table tbody td {
  padding: 12px 16px; border-bottom: 1px solid #f0f0f0; vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: #fafafa; }

/* ── BADGES ────────────────────────────────────────────────── */
.badge-pending  { background: #fff3e0; color: #e65100; padding: 3px 10px; border-radius: 50px; font-size: 11px; font-weight: 700; }
.badge-approved { background: #e8f5e9; color: #2e7d32; padding: 3px 10px; border-radius: 50px; font-size: 11px; font-weight: 700; }
.badge-rejected { background: #fce4ec; color: #c62828; padding: 3px 10px; border-radius: 50px; font-size: 11px; font-weight: 700; }
.badge-active   { background: #e3f2fd; color: #1565c0; padding: 3px 10px; border-radius: 50px; font-size: 11px; font-weight: 700; }
.badge-inactive { background: #f5f5f5; color: #757575; padding: 3px 10px; border-radius: 50px; font-size: 11px; font-weight: 700; }

/* ── ACTION BUTTONS ────────────────────────────────────────── */
.btn-action {
  padding: 5px 12px; font-size: 12px; border-radius: 6px;
  font-weight: 600; border: none; cursor: pointer; transition: all 0.2s;
  display: inline-flex; align-items: center; gap: 5px;
}
.btn-approve  { background: #e8f5e9; color: #2e7d32; }
.btn-approve:hover  { background: #2e7d32; color: #fff; }
.btn-reject   { background: #fce4ec; color: #c62828; }
.btn-reject:hover   { background: #c62828; color: #fff; }
.btn-edit     { background: #e3f2fd; color: #1565c0; }
.btn-edit:hover     { background: #1565c0; color: #fff; }
.btn-delete   { background: #fce4ec; color: #c62828; }
.btn-delete:hover   { background: #c62828; color: #fff; }
.btn-view     { background: #f3e5f5; color: #7b1fa2; }
.btn-view:hover     { background: #7b1fa2; color: #fff; }
.btn-print    { background: #e0f2f1; color: #00695c; }
.btn-print:hover    { background: #00695c; color: #fff; }

/* ── FORMS IN DASHBOARD ────────────────────────────────────── */
.form-card {
  background: var(--white); border-radius: var(--card-radius);
  padding: 28px; box-shadow: var(--shadow); border: 1px solid var(--border);
}
.form-card .form-label { font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); }
.form-control, .form-select {
  border: 1.5px solid var(--border); border-radius: 8px;
  padding: 9px 13px; font-size: 0.88rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(46,125,50,0.1);
}

/* ── PROGRESS BAR ──────────────────────────────────────────── */
.progress-sm { height: 6px; border-radius: 50px; background: var(--border); }
.progress-sm .progress-bar { border-radius: 50px; background: var(--primary); }

/* ── RESPONSIVE DASHBOARD ──────────────────────────────────── */
@media (max-width: 991px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .dashboard-main {
    margin-left: 0;
  }
  .sidebar-toggle { display: block; }
  .sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.45); z-index: 999;
  }
  .sidebar-overlay.show { display: block; }
}

@media (max-width: 576px) {
  .dashboard-content { padding: 16px; }
  .stat-value { font-size: 1.5rem; }
}

/* ── ALERTS ────────────────────────────────────────────────── */
.alert { border: none; border-radius: 8px; font-size: 0.88rem; }
.alert-success { background: #e8f5e9; color: #2e7d32; }
.alert-danger   { background: #fce4ec; color: #c62828; }
.alert-warning  { background: #fff3e0; color: #e65100; }
.alert-info     { background: #e3f2fd; color: #1565c0; }

/* ── LOGIN PAGES ───────────────────────────────────────────── */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary-dark, #1b5e20), var(--primary, #2e7d32));
  padding: 20px;
}
.login-card {
  background: var(--white); border-radius: 16px; padding: 44px 40px;
  width: 100%; max-width: 420px; box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo .org-name { font-size: 1.6rem; font-weight: 800; }
.login-logo .role-tag { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }

/* ── CERTIFICATE ───────────────────────────────────────────── */
.certificate-card {
  max-width: 800px; margin: 40px auto;
  background: #fff;
  border: 8px solid var(--primary);
  border-radius: 8px; padding: 50px;
  text-align: center; position: relative;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}
.certificate-card::before {
  content: ''; position: absolute; inset: 12px;
  border: 2px solid var(--secondary); border-radius: 4px; pointer-events: none;
}
.cert-org-name { font-size: 1.1rem; text-transform: uppercase; letter-spacing: 3px; color: var(--primary); font-weight: 700; }
.cert-title { font-size: 2.2rem; font-weight: 800; color: var(--text-dark); margin: 12px 0; }
.cert-student { font-size: 1.8rem; font-weight: 700; color: var(--primary); margin: 10px 0; }
.cert-course  { font-size: 1.1rem; color: var(--text-muted); }
.cert-number  { font-size: 0.8rem; color: var(--text-muted); margin-top: 30px; }
.cert-seal {
  width: 80px; height: 80px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #4caf50);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; margin: 20px auto;
}
