/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #f8fafc;
    color: #1e293b;
    line-height: 1.6;
    transition: background 0.4s ease, color 0.4s ease;
}

body.dark-theme {
    background: #0f172a;
    color: #e2e8f0;
}

/* Header */
.dashboard-header {
    display: flex;
    justify-content:space-between;
    align-items: center;
    padding: 1rem 0.5rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.dark-theme .dashboard-header {
    background: rgba(15, 23, 42, 0.9);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.header-left h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-right {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Icon Button */
.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.icon-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px rgba(0,0,0,0.2);
}

.icon-btn svg {
    position: absolute;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s;
    color: #64748b;
}

.icon-btn .sun {
    transform: rotate(0deg) scale(1);
    opacity: 1;
}

.icon-btn .moon {
    transform: rotate(90deg) scale(0);
    opacity: 0;
}

.dark-theme .icon-btn .sun {
    transform: rotate(-90deg) scale(0);
    opacity: 0;
}

.dark-theme .icon-btn .moon {
    transform: rotate(0deg) scale(1);
    opacity: 1;
    color: #94a3b8;
}

/* Profile */
.profile-btn {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    overflow: hidden;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

.profile-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px rgba(0,0,0,0.25);
}

.profile-pic {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-wrapper {
    position: relative;
}

.profile-menu {
    position: absolute;
    top: 110px;
    right: 0;
    width: 260px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.hidden {
    display: none !important;
}

.dark-theme .profile-menu {
    background: #1e293b;
}

.profile-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.menu-header {
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f1f5f9;
}

.dark-theme .menu-header {
    background: #0f172a;
}

.menu-header img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.profile-menu a {
    display: block;
    padding: 0.9rem 1.2rem;
    text-decoration: none;
    color: #475569;
    transition: background 0.2s;
}

.dark-theme .profile-menu a {
    color: #cbd5e1;
}

.profile-menu a:hover {
    background: #f1f5f9;
}

.dark-theme .profile-menu a:hover {
    background: #1e293b;
}

.profile-menu hr {
    margin: 0.5rem 0;
    border: none;
    border-top: 1px solid #e2e8f0;
}

.dark-theme .profile-menu hr {
    border-top: 1px solid #334155;
}

.logout {
    color: #ef4444 !important;
}

/* Main Content */
.dashboard-main {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.welcome-card {
    margin-bottom: 2rem;
}

.welcome-card h2 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.welcome-card p {
    color: #64748b;
    font-size: 1.1rem;
}

.flex-column {
    display: flex;
    flex-direction: column;     /* Stack items vertically */
    align-items: center;        /* Horizontally center each button */
    justify-content: center;    /* Vertically center the whole group (if container has height) */
    gap: 1rem;                  /* Space between buttons – adjust as needed */
}
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.card {
    background: white;
    padding: 0.8rem;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    /* transition: transform 0.3s ease; */
}

.width-100 {
    width: 100%;
}

.dark-theme .card {
    background: #1e293b;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

.card.full {
    grid-column: 1 / -1;
}

.card h3 {
    margin-bottom: 1.2rem;
    color: #3b82f6;
    font-size: 1.3rem;
}

/* Form Elements */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #475569;
}

.dark-theme .form-group label {
    color: #cbd5e1;
}

input, select {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid #cbd5e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border 0.3s;
}

input:focus, select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.dark-theme input, .dark-theme select {
    background: #0f172a;
    border-color: #334155;
    color: white;
}

.btn-primary {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0.9rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary:hover {
    background: #2563eb;
}

.dark-theme a {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.3s;
}
a {
    color: #3b82f6;
    text-decoration: none;
    transition: color 0.3s;
}

/* Stats & Activity */
.stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.stat {
    flex: 1;
    min-width: 120px;
    text-align: center;
}

.stat strong {
    display: block;
    font-size: 2rem;
    color: #3b82f6;
}

.stat span {
    color: #64748b;
    font-size: 0.9rem;
}

.activity-list {
    list-style: none;
}

.activity-list li {
    padding: 0.8rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.activity-list li:last-child {
    border-bottom: none;
}

.dark-theme .activity-list li {
    border-color: #334155;
}

/* Responsive */
@media (max-width: 768px) {
    .header-left h1 {
        font-size: 1rem;
    }
    .dashboard-header {
        padding: 1rem;
    }
    
    .header-right {
        gap: 0.8rem;
    }
    
    .icon-btn, .profile-btn {
        width: 36px;
        height: 36px;
    }
    
    .icon-btn svg {
        width: 28px;
        height: 28px;
    }
    
    .dashboard-main {
        padding: 1rem;
    }
    
    .welcome-card h2 {
        font-size: 1.8rem;
    }
}

#page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6); /* dark overlay */
  display: none;               /* hidden by default */
  justify-content: center;
  align-items: center;
  z-index: 99999;
}

/* Simple CSS spinner */
.loader-spinner {
  width: 60px;
  height: 60px;
  border: 6px solid #fff;
  border-top: 6px solid transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  color: #333;
  margin-bottom: 1em;
}

th, td {
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid #e0e0e0;
}

th {
  background-color: #f9f9f9;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #555;
}

tr:nth-child(even) {
  background-color: #f8fcee;
}

.dark-theme table {
  width: 100%;
  border-collapse: collapse;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  color: #ffffff;
  margin-bottom: 1em;
}

.dark-theme th,.dark-theme td {
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid #334155;
}

.dark-theme th {
  background-color: #273a57;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #ffffff;
}

.dark-theme tr:nth-child(even) {
  background-color: #1e2c43;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(3px); /* nice blur effect (optional) */
  justify-content: center;
  align-items: center;
}

.alert {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(3px); /* nice blur effect (optional) */
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: #fff;
  color: #333;
  padding: 20px 25px;
  border-radius: 10px;
  width: auto;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: fadeInUp 0.25s ease-out;
}

.modal-content h3 {
  margin-top: 0;
  text-align: center;
}

.modal-content label {
  font-size: 0.9em;
  font-weight: 500;
}

.modal-content input {
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.modal-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
}

.modal-buttons button {
  flex: 1;
  margin: 0 5px;
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
.profile-img {
    width: 240px;
    height: 240px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 20px;
    border: 3px solid #202020;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
.dark-theme .profile-img {
    box-shadow: 0 2px 5px rgba(255, 255, 255, 0.9   );
}
.error-message {
  background-color: #d33636;
  padding: 10px;
  color: white;
  border-radius: 8px;
  font-size: 1.2rem;
  margin-top: 0.5rem;
}
.success-message {
  background-color: #4caf50;
  padding: 10px;
  color: white;
  border-radius: 8px;
  font-size: 1.2rem;
  margin-top: 0.5rem;
}
