@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");

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

:root{
  --bg: #f4f6fb;
  --bg-soft: #eef1f8;
  --card: #ffffff;
  --text: #1a1d26;
  --muted: #64748b;
  --border: #e8ecf4;
  --primary: #5d5fef;
  --primary-soft: rgba(93, 95, 239, 0.12);
  --primary-700: #4f46e5;
  --accent-blue: #4895ef;
  --danger: #dc2626;
  --shadow-sm: 0 4px 14px rgba(26, 29, 38, 0.06);
  --shadow-md: 0 12px 32px rgba(26, 29, 38, 0.08);
  --shadow-lg: 0 24px 48px rgba(93, 95, 239, 0.18);
  --radius: 16px;
  --radius-lg: 20px;
  --sidebar-w: 268px;
}

body{
  font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a{ color: inherit; }

/* Shell */
.app-shell{
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
}

/* Sidebar — soft UI */
.sidebar{
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 14px;
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff 0%, #fafbff 100%);
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 4px 0 24px rgba(26, 29, 38, 0.04);
}

.sidebar-brand{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 18px;
  border-bottom: 1px solid var(--border);
}

.brand-mark{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 55%, var(--accent-blue) 100%);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.5px;
  box-shadow: 0 10px 24px rgba(93, 95, 239, 0.35);
}

.brand-name{
  font-weight: 800;
  font-size: 15px;
  line-height: 1.25;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.brand-subtitle{
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
  font-weight: 500;
}

.sidebar-nav{
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 4px;
  flex: 1;
  overflow-y: auto;
}

.sidebar-item{
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  width: 100%;
  text-align: left;
  padding: 11px 12px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  cursor: pointer;
  color: #334155;
  font-size: 14px;
  font-weight: 600;
  transition: background 180ms ease, border-color 180ms ease, transform 160ms ease, color 180ms ease;
}

.sidebar-item:hover{
  background: var(--bg-soft);
  border-color: rgba(93, 95, 239, 0.08);
}

.sidebar-item:active{ transform: translateY(1px); }

.sidebar-item.active{
  background: linear-gradient(90deg, var(--primary-soft), rgba(93, 95, 239, 0.06));
  border-color: rgba(93, 95, 239, 0.12);
  color: var(--primary);
  font-weight: 700;
  position: relative;
}

.sidebar-item.active::after{
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 56%;
  max-height: 28px;
  background: linear-gradient(180deg, var(--primary), var(--accent-blue));
  border-radius: 99px;
  box-shadow: 0 2px 8px rgba(93, 95, 239, 0.4);
}

.sidebar-ico{ width: 20px; display: inline-flex; justify-content: center; }

.sidebar-footer{
  margin-top: auto;
  padding: 8px 4px 4px;
  border-top: 1px solid var(--border);
}

/* Footer logout — soft secondary (mockup bottom area) */
.sidebar-item.danger{
  border: 1px solid var(--border);
  color: #64748b;
  background: #fff;
  box-shadow: var(--shadow-sm);
  margin-top: 8px;
  font-weight: 600;
}

.sidebar-item.danger:hover{
  color: var(--primary);
  border-color: rgba(93, 95, 239, 0.25);
  background: var(--primary-soft);
  box-shadow: var(--shadow-md);
}

/* Main */
.main{
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* Topbar — centered search hint (CSS-only visual) */
.topbar{
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}

.topbar::before{
  content: "🔍  Search lockers…";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: min(420px, 36vw);
  padding: 11px 16px 11px 40px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  pointer-events: none;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.8);
}

@media (max-width: 900px){
  .topbar::before{ display: none; }
}

.page-title-wrap{ position: relative; z-index: 1; }

.page-title{
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.page-subtitle{
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  max-width: 280px;
}

.topbar-right{
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.icon-btn{
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  text-decoration: none;
  font-size: 18px;
  transition: transform 160ms ease, box-shadow 180ms ease, border-color 180ms ease;
  box-shadow: var(--shadow-sm);
}

.icon-btn:hover{
  border-color: rgba(93, 95, 239, 0.25);
  box-shadow: var(--shadow-md);
}

.icon-btn:active{ transform: translateY(1px); }

.user-chip{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  max-width: 260px;
  box-shadow: var(--shadow-sm);
}

.user-dot{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.user-info{
  color: #475569;
  font-weight: 600;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-btn{
  border: 1px solid rgba(93, 95, 239, 0.2);
  background: #fff;
  color: var(--primary);
  padding: 10px 16px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: background 180ms ease, transform 160ms ease, box-shadow 180ms ease;
  box-shadow: var(--shadow-sm);
}

.logout-btn:hover{
  background: var(--primary-soft);
  box-shadow: 0 8px 22px rgba(93, 95, 239, 0.15);
}

.logout-btn:active{ transform: translateY(1px); }

.content{
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 1180px;
}

/* Sections */
.section{
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section-head{
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.section-title{
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--primary);
}

.section-subtitle{
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

/* Welcome — gradient banner like mockup */
.welcome{ margin-top: 2px; }

.welcome-card{
  border: none;
  border-radius: var(--radius-lg);
  background: linear-gradient(125deg, #5d5fef 0%, #6366f1 35%, #4895ef 92%);
  box-shadow: var(--shadow-lg);
  padding: 28px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}

.welcome-card::before{
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 100% 0%, rgba(255, 255, 255, 0.22), transparent 55%),
    radial-gradient(ellipse 50% 40% at 0% 100%, rgba(255, 255, 255, 0.1), transparent 50%);
  pointer-events: none;
}

.welcome-text,
.welcome-actions{
  position: relative;
  z-index: 1;
}

.welcome-kicker{
  font-size: 11px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.85);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.welcome-title{
  margin-top: 8px;
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #fff;
  line-height: 1.2;
}

.welcome-sub{
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 14px;
  line-height: 1.6;
  font-weight: 500;
  max-width: 520px;
}

.welcome-actions{
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.welcome-card .btn-primary{
  background: #fff;
  color: var(--primary);
  border: none;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
}

.welcome-card .btn-primary:hover{
  background: #f8f9ff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
}

.welcome-card .btn-secondary{
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(6px);
}

.welcome-card .btn-secondary:hover{
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.6);
}

/* Buttons (global) */
.btn{
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 11px 18px;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 160ms ease, box-shadow 180ms ease, background 180ms ease, border-color 180ms ease;
}

.btn:active{ transform: translateY(1px); }

.btn-primary{
  background: linear-gradient(135deg, var(--primary), #6366f1);
  color: #fff;
  border: none;
  box-shadow: 0 12px 28px rgba(93, 95, 239, 0.3);
}

.btn-primary:hover{
  filter: brightness(1.05);
  box-shadow: 0 14px 32px rgba(93, 95, 239, 0.38);
}

.btn-secondary{
  background: #fff;
  color: var(--text);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover{
  border-color: rgba(93, 95, 239, 0.2);
  box-shadow: var(--shadow-md);
}

.btn-ghost{
  background: var(--primary-soft);
  color: var(--primary-700);
  border: 1px solid rgba(93, 95, 239, 0.15);
}

.btn-ghost:hover{
  background: rgba(93, 95, 239, 0.18);
}

/* Stats — soft cards */
.stats-grid{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat-card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px 16px;
  min-height: 118px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.stat-card:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card:nth-child(1){ border-left: 4px solid var(--accent-blue); }
.stat-card:nth-child(2){ border-left: 4px solid var(--primary); }
.stat-card:nth-child(3){ border-left: 4px solid #fb923c; }
.stat-card:nth-child(4){ border-left: 4px solid #94a3b8; }

.stat-top{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stat-label{ color: #475569; font-size: 13px; font-weight: 700; }

.stat-badge{
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(93, 95, 239, 0.15);
  background: var(--primary-soft);
  color: var(--primary-700);
  font-weight: 800;
  white-space: nowrap;
}

.stat-badge.warn{
  border-color: rgba(251, 146, 60, 0.35);
  background: rgba(251, 146, 60, 0.12);
  color: #c2410c;
}

.stat-value{
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.06em;
  color: var(--text);
}

.stat-hint{ color: var(--muted); font-size: 12px; font-weight: 500; }

/* Quick actions — 2×2 soft tiles */
.actions-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.action-card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px 18px;
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 14px;
  align-items: start;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.action-card:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.action-ico{
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--primary-soft), rgba(72, 149, 239, 0.12));
  font-size: 22px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.action-title{
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.action-sub{
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  font-weight: 500;
}

.action-foot{
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
  padding-top: 4px;
}

/* Account card */
.account-card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.account-title{ font-weight: 800; letter-spacing: -0.02em; font-size: 15px; }
.account-sub{ margin-top: 6px; color: var(--muted); font-size: 13px; font-weight: 500; }

.delete-account-btn{
  background: #fff;
  border: 1px solid #fecaca;
  color: #b91c1c;
  padding: 11px 18px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 800;
  font-size: 13px;
  transition: background 180ms ease, transform 160ms ease, box-shadow 180ms ease, border-color 180ms ease;
  box-shadow: var(--shadow-sm);
}

.delete-account-btn:hover{
  background: #fef2f2;
  border-color: #f87171;
  box-shadow: 0 10px 24px rgba(220, 38, 38, 0.1);
}

.delete-account-btn:active{ transform: translateY(1px); }

/* Delete Account Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(17, 24, 39, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.3s ease-out;
}

.modal.show {
  display: flex;
  justify-content: center;
  align-items: center;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: rgba(255, 255, 255, 0.98);
  padding: 26px;
  border-radius: var(--radius);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.35);
  width: 90%;
  max-width: 500px;
  position: relative;
  animation: modalSlide 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid var(--border);
}

.delete-modal {
  text-align: center;
}

@keyframes modalSlide {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.close-modal {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 26px;
  font-weight: 400;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.3s ease;
  line-height: 1;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.close-modal:hover {
  color: #111827;
  background: rgba(17, 24, 39, 0.06);
}

.delete-icon {
  font-size: 64px;
  margin-bottom: 20px;
}

.delete-modal h2 {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 20px;
  color: var(--danger);
}

.warning-text {
  color: #111827;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 15px;
  line-height: 1.6;
}

.warning-details {
  color: #666;
  font-size: 14px;
  margin-bottom: 10px;
  font-weight: 500;
}

.warning-list {
  text-align: left;
  color: #555;
  font-size: 14px;
  line-height: 1.9;
  margin-bottom: 30px;
  padding-left: 20px;
  list-style-type: none;
}

.warning-list li {
  position: relative;
  padding-left: 25px;
  margin-bottom: 8px;
}

.warning-list li::before {
  content: '⚠️';
  position: absolute;
  left: 0;
}

.modal-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

.confirm-delete-btn,
.cancel-delete-btn {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
  position: relative;
  overflow: hidden;
  border: none;
}

.confirm-delete-btn {
  background: #dc2626;
  color: white;
  box-shadow: 0 12px 26px rgba(220, 38, 38, 0.18);
}

.confirm-delete-btn:hover {
  background: #b91c1c;
}

.confirm-delete-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.cancel-delete-btn {
  background: #fff;
  color: #111827;
  border: 1px solid var(--border);
}

.cancel-delete-btn:hover {
  background: #f3f4f6;
}

#deleteStatus {
  margin-top: 20px;
  padding: 12px;
  border-radius: 12px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  min-height: 20px;
}

#deleteStatus:not(:empty) {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

#deleteStatus.success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

#deleteStatus.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

/* Responsive */
@media (max-width: 768px) {
  :root{ --sidebar-w: 240px; }
  .content{ padding: 18px 16px; }
  .topbar{ padding: 12px 16px; min-height: auto; }
  .stats-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .actions-grid{ grid-template-columns: 1fr; }
  .welcome-card{
    flex-direction: column;
    align-items: flex-start;
    padding: 22px 20px;
  }
  .welcome-actions{ width: 100%; justify-content: flex-start; }
}

@media (max-width: 560px){
  .app-shell{ grid-template-columns: 1fr; }
  .sidebar{
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    box-shadow: none;
  }
  .stats-grid{ grid-template-columns: 1fr; }
  .topbar{ position: relative; }
}
