:root {
  --bg-dark: #05080f;
  --bg-card: rgba(14, 21, 37, 0.75);
  --bg-card-hover: rgba(22, 33, 56, 0.85);
  --bg-input: rgba(8, 14, 26, 0.85);
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(59, 111, 255, 0.6);
  --primary: #3b6fff;
  --primary-hover: #2557e6;
  --primary-glow: rgba(59, 111, 255, 0.25);
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --text-main: #f3f4f6;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* AUTH / LOGIN SECTION */
.auth-wrapper {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  box-sizing: border-box;
  background: radial-gradient(circle at top right, rgba(59, 111, 255, 0.12), transparent 45%),
              radial-gradient(circle at bottom left, rgba(16, 185, 129, 0.08), transparent 45%),
              var(--bg-dark);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  box-sizing: border-box;
  background: var(--bg-card);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  padding: 36px 30px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.auth-header {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.auth-logo b {
  color: var(--primary);
}

.auth-header h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 6px;
}

.auth-header p {
  color: var(--text-muted);
  font-size: 13.5px;
}

.form-group {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-icon-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.input-icon-wrap svg:first-child {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--text-dim);
  pointer-events: none;
  z-index: 2;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="number"],
select,
textarea {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font-main);
  transition: var(--transition);
  outline: none;
}

.input-icon-wrap input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding-left: 42px;
  padding-right: 44px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.pwd-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  border-radius: 4px;
  transition: var(--transition);
}

.pwd-toggle:hover {
  color: #fff;
}

.pwd-toggle svg {
  width: 18px;
  height: 18px;
}

.btn-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  border: none;
  width: 100%;
  height: 44px;
  padding: 0 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 14px rgba(59, 111, 255, 0.35);
  box-sizing: border-box;
  margin-top: 8px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  border: none;
  width: auto;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 14px rgba(59, 111, 255, 0.35);
  white-space: nowrap;
  box-sizing: border-box;
}

.btn-submit svg,
.btn-primary svg,
.btn-secondary svg,
.btn-cancel svg,
.btn-details svg {
  width: 16px;
  height: 16px;
  max-width: 16px;
  max-height: 16px;
  flex-shrink: 0;
}

.btn-submit:hover,
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(59, 111, 255, 0.45);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid var(--border);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
}

.btn-cancel {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13.5px;
  transition: var(--transition);
}

.btn-cancel:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.auth-footer {
  margin-top: 24px;
  text-align: center;
}

.back-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  transition: var(--transition);
}

.back-link:hover {
  color: var(--primary);
}

/* DASHBOARD LAYOUT */
.dashboard-wrapper {
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR */
.dash-sidebar {
  width: 270px;
  background: rgba(8, 14, 26, 0.95);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
}

.sidebar-head {
  padding: 24px 20px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-head .logo {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-head .logo b {
  color: var(--primary);
}

.badge-admin {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: rgba(59, 111, 255, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 111, 255, 0.3);
  padding: 2px 7px;
  border-radius: 20px;
  font-family: var(--font-mono);
}

.mobile-close-btn {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}

.admin-profile-snippet {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 16px 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.avatar-wrap img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary);
}

.admin-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-info strong {
  font-size: 13.5px;
  color: #fff;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.admin-info small {
  color: var(--text-dim);
  font-size: 11.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.dash-nav {
  flex: 1;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 14px;
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}

.nav-item svg {
  width: 18px;
  height: 18px;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}

.nav-item.active {
  background: rgba(59, 111, 255, 0.15);
  color: #60a5fa;
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--primary);
}

.count-pill {
  margin-left: auto;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 7px;
  border-radius: 12px;
  font-family: var(--font-mono);
}

.sidebar-foot {
  padding: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-side-action,
.btn-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
}

.btn-side-action {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  border: 1px solid var(--border);
}

.btn-side-action:hover {
  background: rgba(255, 255, 255, 0.08);
}

.btn-logout {
  background: transparent;
  color: var(--danger);
  border: none;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.1);
}

.btn-side-action svg,
.btn-logout svg {
  width: 16px;
  height: 16px;
}

/* MAIN CONTENT */
.dash-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 80% 20%, rgba(59, 111, 255, 0.05), transparent 60%),
              var(--bg-dark);
  min-width: 0;
}

.dash-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 14, 26, 0.5);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 90;
}

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.mobile-menu-btn span {
  width: 22px;
  height: 2px;
  background: #fff;
}

.topbar-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-title h1 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
}

.db-status-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--success);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 3px 10px;
  border-radius: 20px;
  font-family: var(--font-mono);
}

.ping-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

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

.btn-refresh {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-refresh:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.btn-refresh svg {
  width: 17px;
  height: 17px;
}

.btn-preview-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(59, 111, 255, 0.12);
  border: 1px solid rgba(59, 111, 255, 0.25);
  color: #60a5fa;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.btn-preview-link:hover {
  background: rgba(59, 111, 255, 0.22);
}

.btn-preview-link svg {
  width: 15px;
  height: 15px;
}

/* PANES */
.tab-pane {
  display: none;
  padding: 32px;
  animation: fadeIn 0.25s ease-out;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* OVERVIEW STATS */
.stats-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  backdrop-filter: blur(16px);
  border-radius: var(--radius-md);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}

.stat-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon svg {
  width: 22px;
  height: 22px;
}

.stat-icon.p-icon { background: rgba(59, 111, 255, 0.15); color: #60a5fa; }
.stat-icon.c-icon { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.stat-icon.i-icon { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.stat-icon.r-icon { background: rgba(239, 68, 68, 0.15); color: #f87171; }

.stat-details {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.stat-details h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
  margin: 2px 0;
}

.stat-details small {
  font-size: 11.5px;
  color: var(--text-muted);
}

.overview-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.card-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  backdrop-filter: blur(16px);
  border-radius: var(--radius-md);
  padding: 24px;
}

.card-panel.max-w-700 {
  max-width: 700px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.panel-head h3 {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

.badge-tag {
  font-size: 11px;
  background: rgba(59, 111, 255, 0.15);
  color: #60a5fa;
  padding: 3px 8px;
  border-radius: 12px;
  font-family: var(--font-mono);
}

.quick-actions-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.btn-quick {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 16px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 13px;
  font-weight: 500;
}

.btn-quick:hover {
  background: rgba(59, 111, 255, 0.1);
  border-color: rgba(59, 111, 255, 0.3);
  color: #60a5fa;
}

.btn-quick svg {
  width: 20px;
  height: 20px;
}

.preview-mini-profile {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 0;
}

.preview-mini-profile img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary);
}

.hero-stats-preview {
  margin-top: 8px;
  font-size: 12px;
  color: #60a5fa;
  font-family: var(--font-mono);
}

/* SECTION ACTION BAR */
.section-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.section-actions-bar h2 {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

.section-actions-bar .btn-primary {
  height: 40px;
  padding: 0 16px;
  font-size: 13.5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.search-filter-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  max-width: 500px;
}

.search-filter-wrap input {
  flex: 1;
  height: 40px;
  box-sizing: border-box;
}

.search-filter-wrap select {
  width: 170px;
  height: 40px;
  box-sizing: border-box;
}

/* PROJECTS ADMIN GRID */
.projects-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 22px;
}

.project-admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.project-admin-card:hover {
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-2px);
}

.pac-media {
  height: 170px;
  background: #020408;
  position: relative;
  overflow: hidden;
}

.pac-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.project-admin-card:hover .pac-media img {
  transform: scale(1.03);
}

.pac-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-family: var(--font-mono);
}

.pac-badge.team {
  border-color: rgba(245, 158, 11, 0.5);
  color: #fbbf24;
}

.pac-badge.flagship {
  border-color: rgba(59, 111, 255, 0.5);
  color: #60a5fa;
}

.pac-content {
  padding: 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.pac-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.pac-title-row h3 {
  font-size: 17px;
  font-weight: 600;
  color: #fff;
}

.pac-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pac-tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.pac-tech-tags span {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.05);
  color: #93c5fd;
  padding: 2px 7px;
  border-radius: 4px;
}

.pac-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pac-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon-action {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon-action:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.btn-icon-action.delete:hover {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
  border-color: var(--danger);
}

.btn-icon-action svg {
  width: 15px;
  height: 15px;
}

/* CERTIFICATES ADMIN GRID */
.certs-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 22px;
}

.cert-admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  gap: 16px;
  padding: 16px;
  transition: var(--transition);
}

.cert-admin-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.cac-cover {
  width: 110px;
  height: 110px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: #000;
}

.cac-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cac-details {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.cac-details h4 {
  font-size: 14.5px;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 4px;
}

.cac-org {
  font-size: 12px;
  color: #60a5fa;
  margin-bottom: 4px;
}

.cac-date {
  font-size: 11.5px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.cac-actions {
  margin-top: auto;
  display: flex;
  gap: 8px;
}

/* AVATAR UPLOAD BLOCK */
.avatar-upload-block {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.avatar-preview-box {
  width: 130px;
  height: 130px;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  border: 2px solid var(--primary);
  flex-shrink: 0;
  background: #000;
}

.avatar-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 11px;
  color: #fff;
  text-align: center;
  padding: 8px;
}

.avatar-upload-controls {
  flex: 1;
  min-width: 200px;
}

.btn-upload-file {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(59, 111, 255, 0.15);
  border: 1px dashed rgba(59, 111, 255, 0.4);
  color: #60a5fa;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.btn-upload-file:hover {
  background: rgba(59, 111, 255, 0.25);
}

.btn-upload-file svg {
  width: 16px;
  height: 16px;
}

.tip-text {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 8px;
}

/* FORMS GRID */
.grid-2col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.form-submit-row {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
}

.form-divider {
  margin: 24px 0 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

/* RESUME MANAGER */
.resume-manager-block {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.resume-current-info {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.resume-current-info svg {
  width: 28px;
  height: 28px;
  color: var(--primary);
  flex-shrink: 0;
}

.resume-current-info div {
  flex: 1;
}

.resume-current-info strong {
  font-size: 13px;
  color: var(--text-muted);
}

.font-mono {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: #fff;
}

.btn-details {
  background: rgba(59, 111, 255, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 111, 255, 0.3);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
}

.btn-details:hover {
  background: rgba(59, 111, 255, 0.25);
}

.upload-dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 36px 20px;
  text-align: center;
  background: rgba(255, 255, 255, 0.015);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: var(--transition);
  cursor: pointer;
}

.upload-dropzone:hover,
.upload-dropzone.drag-over {
  border-color: var(--primary);
  background: rgba(59, 111, 255, 0.05);
}

.upload-dropzone svg {
  width: 36px;
  height: 36px;
  color: var(--primary);
}

.upload-dropzone h4 {
  font-size: 16px;
  color: #fff;
}

.upload-dropzone p {
  font-size: 13px;
  color: var(--text-muted);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  margin-top: 6px;
  transition: var(--transition);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
}

.input-with-btn {
  display: flex;
  gap: 8px;
}

/* MODALS */
.dash-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
  overflow-y: auto;
}

.dash-modal.active {
  display: flex;
}

.modal-card {
  background: #090e1a;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.7);
  animation: modalScale 0.25s ease-out;
}

.modal-card.modal-lg {
  max-width: 780px;
}

@keyframes modalScale {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-head {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.modal-head h2 {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
}

.modal-x {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  transition: var(--transition);
}

.modal-x:hover {
  color: #fff;
}

.modal-form {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* TOGGLES & CHECKBOXES */
.checkbox-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 22px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: .3s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--primary);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* IMAGE UPLOAD PREVIEW ROW */
.proj-img-preview-row {
  display: flex;
  gap: 16px;
  align-items: center;
}

.proj-preview-thumb {
  width: 100px;
  height: 65px;
  border-radius: var(--radius-sm);
  background: #000;
  border: 1px solid var(--border);
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}

.proj-preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.img-spinner {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
}

.proj-img-inputs {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* SPINNER & TOASTS */
.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
}

.toast {
  background: rgba(14, 21, 37, 0.95);
  border: 1px solid var(--border);
  backdrop-filter: blur(16px);
  color: #fff;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.3s ease;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--primary); }

@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* SIDEBAR BACKDROP */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 95;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.sidebar-backdrop.active {
  opacity: 1;
  visibility: visible;
}

/* ==========================================================================
   RESPONSIVE DESIGN BREAKPOINTS
   ========================================================================== */

@media (max-width: 1024px) {
  .projects-admin-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
  .certs-admin-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}

@media (max-width: 900px) {
  .dash-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: -300px;
    width: 280px;
    max-width: 85vw;
    height: 100vh;
    z-index: 100;
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: none;
  }

  .dash-sidebar.open {
    left: 0;
    box-shadow: 12px 0 32px rgba(0, 0, 0, 0.8);
  }

  .mobile-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.06);
  }

  .mobile-close-btn:hover {
    background: rgba(255, 255, 255, 0.12);
  }

  .mobile-menu-btn {
    display: flex;
  }

  .dash-topbar {
    padding: 14px 18px;
  }

  .tab-pane {
    padding: 20px 16px;
  }

  .form-grid-2,
  .form-grid-3,
  .grid-2col {
    grid-template-columns: 1fr;
  }

  .overview-quick-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .dash-topbar {
    padding: 12px 14px;
    gap: 10px;
  }

  .topbar-title {
    gap: 8px;
    flex: 1;
    min-width: 0;
  }

  .topbar-title h1 {
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .db-status-tag {
    font-size: 10.5px;
    padding: 2px 7px;
    white-space: nowrap;
  }

  .btn-preview-link span {
    display: none;
  }

  .btn-preview-link {
    padding: 8px 10px;
  }

  .stats-cards-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
  }

  .stat-card {
    padding: 14px;
    gap: 12px;
  }

  .stat-icon {
    width: 40px;
    height: 40px;
  }

  .stat-icon svg {
    width: 18px;
    height: 18px;
  }

  .stat-details h2 {
    font-size: 20px;
  }

  .stat-label {
    font-size: 11px;
  }

  .section-actions-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
  }

  .search-filter-wrap {
    max-width: 100%;
    width: 100%;
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .search-filter-wrap input {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    font-size: 13px;
  }

  .search-filter-wrap select {
    width: 135px;
    flex-shrink: 0;
    padding: 10px 8px;
    font-size: 12.5px;
  }

  .section-actions-bar .btn-primary {
    width: auto;
    align-self: flex-start;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    box-shadow: 0 3px 10px rgba(59, 111, 255, 0.28);
  }

  .projects-admin-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .certs-admin-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .cert-admin-card {
    flex-direction: row;
    padding: 14px;
    gap: 14px;
  }

  .cac-cover {
    width: 90px;
    height: 90px;
  }

  .avatar-upload-block {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .avatar-upload-controls {
    width: 100%;
    text-align: left;
  }

  .avatar-upload-controls .btn-upload-file {
    width: 100%;
    justify-content: center;
  }

  .dash-modal {
    padding: 12px;
  }

  .modal-card {
    max-height: 94vh;
    border-radius: var(--radius-md);
  }

  .modal-head {
    padding: 14px 18px;
  }

  .modal-form {
    padding: 16px;
    gap: 14px;
  }

  .modal-footer {
    flex-direction: column-reverse;
    gap: 8px;
  }

  .modal-footer button {
    width: 100%;
    justify-content: center;
  }

  .proj-img-preview-row {
    flex-direction: column;
    align-items: stretch;
  }

  .proj-preview-thumb {
    width: 100%;
    height: 140px;
  }

  .proj-img-inputs .btn-upload-file {
    justify-content: center;
  }

  .resume-current-info {
    flex-direction: column;
    align-items: flex-start;
  }

  .resume-current-info .btn-details {
    width: 100%;
    text-align: center;
  }

  .input-with-btn {
    flex-direction: column;
  }

  .input-with-btn .btn-secondary {
    width: 100%;
  }

  .form-submit-row .btn-primary {
    width: 100%;
    justify-content: center;
  }

  .toast-container {
    top: 12px;
    left: 12px;
    right: 12px;
  }

  .toast {
    min-width: 0;
    width: 100%;
    padding: 12px 16px;
    font-size: 13px;
  }
}

@media (max-width: 440px) {
  .stats-cards-grid {
    grid-template-columns: 1fr;
  }

  .cert-admin-card {
    flex-direction: column;
  }

  .cac-cover {
    width: 100%;
    height: 140px;
  }

  .quick-actions-btns {
    grid-template-columns: 1fr;
  }

  .preview-mini-profile {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }

  .preview-mini-profile img {
    margin: 0 auto;
  }

  .auth-wrapper {
    padding: 16px 12px;
  }

  .auth-card {
    padding: 24px 18px;
    border-radius: var(--radius-md);
  }

  .auth-header {
    margin-bottom: 22px;
  }

  .auth-logo {
    font-size: 24px;
  }

  .auth-header h2 {
    font-size: 18px;
  }

  .auth-header p {
    font-size: 12.5px;
  }

  .tab-pane {
    padding: 16px 10px;
  }
}
