/* Login page styles — same viewport centering pattern as AdminLTE login-page */

.login-page {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1E293B 0%, #334155 50%, #1E293B 100%);
  padding: 16px;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto; /* if content taller than viewport, scroll instead of clipping */
  box-sizing: border-box;
}

.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(249, 115, 22, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

/* Mirrors AdminLTE .login-box — fixed compact width, centered by parent flex */
.login-container {
  width: 360px;
  max-width: 100%;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

@media (max-width: 576px) {
  .login-container {
    width: 90%;
    margin-top: 0.5rem;
  }
}

.login-theme-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.6);
  color: #F1F5F9;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.login-theme-btn:hover {
  background: rgba(30, 41, 59, 0.9);
  color: #FBBF24;
}

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

.login-brand {
  text-align: center;
  margin-bottom: 16px;
}

.login-brand-icon {
  font-size: 40px;
  display: block;
  margin-bottom: 8px;
}

.login-brand-title {
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.login-brand-tagline {
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  margin-top: 4px;
}

.login-card {
  background: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  padding: 24px 22px 20px;
  margin-bottom: 0;
}

.login-card-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 4px;
}

.login-card-subtitle {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 24px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
}

.form-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.form-input-wrap svg {
  position: absolute;
  left: 12px;
  width: 18px;
  height: 18px;
  color: var(--text-2);
  pointer-events: none;
}

.form-input {
  width: 100%;
  padding: 11px 44px 11px 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-1);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fff;
}

.form-input-password {
  padding-right: 44px;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12);
}

.form-input.no-icon {
  padding-left: 12px;
}

.password-toggle {
  position: absolute;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--text-2);
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}

.password-toggle:hover {
  color: var(--text-1);
  background: var(--page-bg);
}

.password-toggle svg {
  position: static;
  width: 18px;
  height: 18px;
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
}

.form-checkbox input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
  border-radius: 4px;
}

.form-link {
  font-size: 13px;
  color: var(--primary);
  font-weight: 500;
  transition: color 0.2s;
}

.form-link:hover {
  color: #ea580c;
}

.btn-login {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: var(--btn-primary);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  margin-top: 4px;
}

.btn-login:hover {
  background: var(--btn-primary-hover);
}

.btn-login:active {
  transform: scale(0.98);
}

.btn-login svg {
  width: 18px;
  height: 18px;
}

.login-error {
  display: none;
  padding: 10px 12px;
  background: #FEE2E2;
  color: #DC2626;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
}

.login-error.show {
  display: block;
}

.login-footer {
  text-align: center;
  margin-top: 16px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
}

.login-demo-hint {
  margin-top: 14px;
  padding: 10px 12px;
  background: #F8FAFC;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 11px;
  color: var(--text-2);
  text-align: center;
  line-height: 1.45;
}

.login-demo-hint strong {
  color: var(--text-1);
}

.login-demo-accounts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  text-align: left;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

.login-demo-account {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.login-demo-account-info {
  flex: 1;
  min-width: 0;
}

.login-demo-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.4;
}

.login-demo-hint-text {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  font-weight: 400;
  color: var(--text-2);
  line-height: 1.4;
}

.login-demo-btn {
  padding: 6px 12px;
  border: 1px solid var(--nav-active, #6366F1);
  background: #EEF2FF;
  color: var(--nav-active, #6366F1);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.login-demo-btn:hover {
  background: var(--nav-active, #6366F1);
  color: #fff;
}

.login-demo-note {
  margin: 12px 0 0;
  font-size: 11px;
  color: var(--text-2);
  text-align: center;
}

.login-demo-note-top {
  margin: 8px 0 0;
}

.login-demo-note code {
  font-size: 10px;
  padding: 1px 5px;
  background: #E2E8F0;
  border-radius: 4px;
  color: var(--text-1);
}

/* Profile page */
.profile-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  align-items: start;
}

.profile-sidebar-card {
  padding: 24px;
  text-align: center;
}

.profile-avatar-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 16px;
}

.profile-avatar-lg {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--page-bg);
  box-shadow: var(--shadow);
}

.profile-avatar-edit {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 32px;
  height: 32px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  cursor: pointer;
  transition: background 0.2s;
}

.profile-avatar-edit svg {
  width: 14px;
  height: 14px;
}

.profile-avatar-edit:hover {
  background: #ea580c;
}

.profile-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-1);
}

.profile-role-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 12px;
  background: #FFEDD5;
  color: #EA580C;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.profile-meta-list {
  margin-top: 20px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.profile-meta-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-2);
}

.profile-meta-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-2);
}

.profile-meta-item span {
  color: var(--text-1);
  font-weight: 500;
}

.profile-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.profile-section {
  padding: 24px;
}

.profile-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

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

.profile-form-grid .form-group.full-width {
  grid-column: 1 / -1;
}

.profile-form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.activity-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.activity-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--page-bg);
}

.activity-icon svg {
  width: 16px;
  height: 16px;
  color: var(--info);
}

.activity-content strong {
  display: block;
  font-size: 13px;
  color: var(--text-1);
}

.activity-content p {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 2px;
}

.activity-time {
  font-size: 11px;
  color: var(--text-2);
  margin-left: auto;
  white-space: nowrap;
}

/* Profile dropdown */
.profile-wrapper {
  position: relative;
}

.user-profile {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #FAFBFC;
}

.profile-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  border: 1px solid var(--border);
  z-index: 300;
  overflow: hidden;
}

.profile-dropdown.show {
  display: block;
}

.profile-dropdown-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-dropdown-header img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.profile-dropdown-header strong {
  display: block;
  font-size: 13px;
  color: var(--text-1);
}

.profile-dropdown-header span {
  font-size: 11px;
  color: var(--text-2);
}

.profile-dropdown-menu {
  padding: 6px;
}

.profile-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-1);
  transition: background 0.15s;
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.profile-dropdown-item:hover {
  background: var(--page-bg);
}

.profile-dropdown-item svg {
  width: 16px;
  height: 16px;
  color: var(--text-2);
}

.profile-dropdown-item.danger {
  color: var(--danger);
}

.profile-dropdown-item.danger svg {
  color: var(--danger);
}

.profile-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 8px;
}

@media (max-width: 768px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .profile-form-grid {
    grid-template-columns: 1fr;
  }
}
