@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=Source+Sans+Pro:wght@300;400;600;700&display=swap');

:root {
  --navy: #1a2744;
  --gold: #C9A84C;
  --gold-light: #f0e6c8;
  --bg: #f0f2f5;
  --white: #ffffff;
  --text: #2d3748;
  --text-light: #718096;
  --border: #e2e8f0;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --radius: 10px;
}

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

body {
  font-family: 'Source Sans Pro', sans-serif;
  background: var(--bg);
  color: var(--text);
}

.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: 240px;
  height: 100vh;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-brand img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.sidebar-brand-text h2 {
  font-family: 'Playfair Display', serif;
  font-size: 14px;
  color: var(--gold);
  line-height: 1.3;
}

.sidebar-brand-text span {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
}

.sidebar-nav {
  flex: 1;
  padding: 20px 0;
}

.nav-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.3);
  padding: 8px 20px 6px;
  text-transform: uppercase;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
  background: rgba(255,255,255,0.07);
  color: #fff;
  border-left-color: rgba(201,168,76,0.5);
}

.sidebar-nav a.active {
  background: rgba(201,168,76,0.15);
  color: var(--gold);
  border-left-color: var(--gold);
}

.sidebar-nav a i {
  width: 18px;
  text-align: center;
  font-size: 15px;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-footer .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--navy);
  font-size: 14px;
  flex-shrink: 0;
}

.sidebar-footer .user-info h4 {
  font-size: 13px;
  color: #fff;
  font-weight: 600;
}

.sidebar-footer .user-info span {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
}

.main-content {
  margin-left: 250px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--white);
  padding: 0 28px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar h1 {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  color: var(--navy);
  font-weight: 700;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.page-body {
  padding: 28px;
  flex: 1;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
  border-left: 4px solid;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-card.blue  { border-left-color: #3b82f6; }
.stat-card.green { border-left-color: #10b981; }
.stat-card.teal  { border-left-color: #0891b2; }
.stat-card.amber { border-left-color: #f59e0b; }
.stat-card.red   { border-left-color: #ef4444; }

.stat-info h3 {
  font-size: 32px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-info p {
  font-size: 13px;
  color: var(--text-light);
  font-weight: 600;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.stat-card.blue  .stat-icon { background:#eff6ff; color:#3b82f6; }
.stat-card.green .stat-icon { background:#f0fdf4; color:#10b981; }
.stat-card.teal  .stat-icon { background:#ecfeff; color:#0891b2; }
.stat-card.amber .stat-icon { background:#fffbeb; color:#f59e0b; }
.stat-card.red   .stat-icon { background:#fef2f2; color:#ef4444; }

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  overflow: hidden;
}

.card-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
}

.card-header h3 {
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  color: var(--navy);
  font-weight: 700;
}

.card-body { padding: 0; }

.table-wrapper { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

thead tr {
  background: var(--navy);
  color: #fff;
}

thead th {
  padding: 13px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

tbody tr:nth-child(even) { background: #f8fafc; }
tbody tr:hover { background: #f0f4ff; }

tbody td {
  padding: 13px 16px;
  color: var(--text);
  vertical-align: middle;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.badge-active  { background:#d1fae5; color:#065f46; }
.badge-expired { background:#fee2e2; color:#991b1b; }
.badge-pending { background:#fef3c7; color:#92400e; }
.badge-suspended { background:#e5e7eb; color:#374151; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.2s;
  font-family: 'Source Sans Pro', sans-serif;
}

.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: #243460; }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: #b8923e; }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--navy); color: var(--navy); }

/* Logout Button - Dashboard Style */
.logout-btn {
  background: #0f1f3d !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 8px 16px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  cursor: pointer !important;
}
.logout-btn:hover {
  background: #1a3a6e !important;
}
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-danger { background:#ef4444; color:#fff; }

.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-light);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  font-size: 14px;
  font-family: 'Source Sans Pro', sans-serif;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.2s;
  outline: none;
}

.form-control:focus { border-color: var(--navy); }

.search-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 16px 24px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-bar input, .search-bar select {
  padding: 9px 14px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  font-size: 13.5px;
  font-family: 'Source Sans Pro', sans-serif;
  outline: none;
  transition: border-color 0.2s;
}

.search-bar input:focus, .search-bar select:focus { border-color: var(--navy); }
.search-bar input { min-width: 280px; }

.alert {
  padding: 12px 18px;
  border-radius: 8px;
  margin-bottom: 18px;
  font-size: 14px;
  font-weight: 600;
}
.alert-success { background:#d1fae5; color:#065f46; border-left: 4px solid #10b981; }
.alert-danger  { background:#fee2e2; color:#991b1b; border-left: 4px solid #ef4444; }
.alert-warning { background:#fef3c7; color:#92400e; border-left: 4px solid #f59e0b; }

@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 640px) {
  .sidebar { width: 0; overflow: hidden; }
  .main-content { margin-left: 0; }
  .stats-grid { grid-template-columns: 1fr; }
}

/* ── ACTION DROPDOWN ── */
.action-dropdown {
    position: relative;
    display: inline-block;
}

.action-btn {
    height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #d1d5db;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s;
}

.action-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.action-btn::after {
    content: '▾';
    font-size: 12px;
    margin-left: 2px;
}

.action-menu {
    position: absolute;
    right: 0;
    top: 100%;
    width: 180px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.12);
    z-index: 9999;
    padding: 8px 0;
    overflow: visible;
    display: none;
    margin-top: 4px;
}

.action-dropdown.open .action-menu {
    display: block;
}

.action-menu a,
.action-menu button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    font-size: 14px;
    color: #1f2937;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.action-menu a:hover,
.action-menu button:hover {
    background: #f3f4f6;
}

.action-menu .view { color: #111827; }
.action-menu .edit { color: #1d4ed8; }
.action-menu .suspend { color: #f59e0b; }
.action-menu .revoke { color: #dc2626; }
.action-menu .print { color: #059669; }
.action-menu .qr { color: #7c3aed; }

/* Prevent overflow issues */
.table-responsive,
.card,
.card-body,
.page-body {
    overflow: visible !important;
}
