/* =================================================_
   Massusi Inventory — Modern Blue Shell
   ================================================= */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Poppins", sans-serif;
  color: var(--text-main);
  background: var(--bg-main);
}

/* =================================================_
   Background Pattern
   ================================================= */

.app-body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(96, 165, 250, 0.18) 0,
      rgba(96, 165, 250, 0.18) 180px,
      transparent 181px
    ),
    linear-gradient(135deg, #eef5ff 0%, #f6f9ff 48%, #edf4ff 100%);
}

.app-body::before {
  content: "";
  position: fixed;
  z-index: -2;
  width: 650px;
  height: 650px;
  top: -350px;
  right: -180px;
  border-radius: 50%;
  background: #dce9ff;
}

.app-body::after {
  content: "";
  position: fixed;
  z-index: -2;
  width: 720px;
  height: 400px;
  bottom: -260px;
  left: -170px;
  border-radius: 50%;
  background: #d5e5ff;
}

/* =================================================_
   Main Application Container
   ================================================= */

.app-container {
  min-height: 100vh;
  padding: 28px;
  position: relative;
}

.app-layout {
  height: calc(100vh - 56px);
  min-height: 0;
  display: flex;
  overflow: hidden;
  background: var(--bg-surface);
  box-shadow: var(--shadow-lg);
}
/* =================================================_
   Sidebar
   ================================================= */

.app-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);

  display: flex;
  flex-direction: column;

  background:
    radial-gradient(
      ellipse 100% 55% at 0% 0%,
      rgba(147, 197, 253, 0.28),
      transparent 60%
    ),
    radial-gradient(
      ellipse 90% 65% at 100% 35%,
      rgba(59, 130, 246, 0.18),
      transparent 65%
    ),
    linear-gradient(160deg, #2563eb 0%, #1d4ed8 48%, #173b8f 100%);

  color: #ffffff;

  position: fixed;
  top: 16px;
  left: 16px;
  bottom: 16px;

  border-radius: 0 24px 24px 0;
  border: 1px solid rgba(255, 255, 255, 0.12);

  box-shadow: 0 8px 24px rgba(30, 64, 175, 0.14);

  z-index: 20;
}

.sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 24px;
}

.logo-box {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-icon svg {
  width: 25px;
  height: 25px;
  stroke-width: 2;
}

.brand-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* =================================================_
   Sidebar Navigation
   ================================================= */

.sidebar-menu {
  flex: 1;
  overflow-y: auto;
  padding: 18px 13px;
}

.menu-group {
  margin-bottom: 23px;
}

.menu-title {
  display: block;
  padding: 0 14px;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.9px;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 43px;
  padding: 10px 14px;
  margin: 3px 0;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.nav-link svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  stroke-width: 2;
}

.nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
}

.nav-link.active {
  color: var(--primary);
  background: #ffffff;
  box-shadow: 0 5px 16px rgba(4, 24, 73, 0.18);
}

.nav-link.active::before {
  content: "";
  position: absolute;
  left: -13px;
  width: 4px;
  height: 25px;
  border-radius: 0 5px 5px 0;
  background: #60a5fa;
}

/* =================================================_
   Sidebar Footer
   ================================================= */

.sidebar-footer {
  padding: 15px;
}

.btn-logout {
  width: 100%;
  min-height: 43px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.78);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: 0.2s ease;
}

.btn-logout:hover {
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
}

.btn-logout svg {
  width: 16px;
}

/* =================================================_
   Main Wrapper
   ================================================= */

.app-main {
  min-width: 0;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #ffffff;
}


/* ==================================================
   Header
   ================================================== */

.app-header {
  height: var(--header-height);
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: #e9e9fc;
  color: var(--text-main);
  
  position: fixed;
  top: 16px;
  right: 20px;
  left: calc(var(--sidebar-width) + 20px);
  border-radius: 0 0 18px 18px;
  border: 1px solid rgb(40, 64, 185);
  box-shadow: 0 8px 24px rgba(30, 64, 175, 0.12);
  z-index: 10;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.header-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-light);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 11px;
}

.sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
  color: var(--text-main);
  cursor: pointer;
}

/* ==================================================
   Topbar User Actions
   ================================================== */

.header-right.header-profile {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.header-profile .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: var(--text-main, #1e293b);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  line-height: 1;
  white-space: nowrap;
}

.header-profile .username {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main, #1e293b);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

/* ==================================================
   Attendance Notification
   ================================================== */

.attendance-notification-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  cursor: pointer;
  flex-shrink: 0;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.attendance-notification-button[hidden],
#attendance-notification-count[hidden] {
  display: none;
}

.attendance-notification-button:hover {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.22);
}

.attendance-notification-button:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

.attendance-notification-button i,
.attendance-notification-button svg {
  width: 19px;
  height: 19px;
}

#attendance-notification-count {
  position: absolute;
  top: -5px;
  right: -5px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border: 2px solid #1d4ed8;
  border-radius: 999px;
  background: #ef4444;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

/* ==================================================
   User Avatar
   ================================================== */

.header-profile .user-avatar {
  display: block;
  width: 38px;
  height: 38px;
  object-fit: cover;
  object-position: center;
  border: 2px solid rgba(255, 255, 255, 0.65);
  border-radius: 50%;
  background: #ffffff;
  flex-shrink: 0;
}



/* =================================================_
   Content
   ================================================= */

.app-content {
  flex: 1;
  min-width: 0;
  min-height: 0;
  padding: 28px;
  overflow: auto;
  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(219, 234, 254, 0.42),
      transparent 300px
    ),
    #f8fafc;
  margin-left: var(--sidebar-width);
  padding-top: var(--header-height);
}

/* =================================================_
   Loading
   ================================================= */

.loading-state {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.loading-state svg {
  color: var(--primary);
}

.loading-state p {
  margin-top: 12px;
  font-size: 12px;
}

/* =================================================_
   Scrollbar
   ================================================= */

.sidebar-menu::-webkit-scrollbar,
.app-content::-webkit-scrollbar {
  width: 5px;
}

.sidebar-menu::-webkit-scrollbar-track,
.app-content::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-menu::-webkit-scrollbar-thumb,
.app-content::-webkit-scrollbar-thumb {
  border-radius: 10px;
  background: rgba(100, 116, 139, 0.25);
}
