/* components.css */
/* App Layout with Collapsible Sidebar */
.app-layout {
  display: flex;
  min-height: calc(100vh - var(--header-height));
  position: relative;
}

/* Sidebar Styling */
.app-sidebar {
  width: 250px;
  background: #ffffff;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 45;
  flex-shrink: 0;
}

/* Collapsed Sidebar on Desktop */
.app-sidebar.collapsed {
  width: 68px;
}

.app-sidebar.collapsed .sidebar-text,
.app-sidebar.collapsed .sidebar-header-text,
.app-sidebar.collapsed .nav-badge-text {
  display: none !important;
}

.app-sidebar.collapsed .sidebar-link {
  justify-content: center;
  padding: 12px 0;
}

/* Sidebar Menu Items */
.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 8px;
  flex: 1;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.15s ease;
  position: relative;
}

.sidebar-link:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}

.sidebar-link.active {
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-weight: 700;
}

.sidebar-link .icon {
  font-size: 18px;
  line-height: 1;
}

/* Mobile Drawer Overlay */
@media (max-width: 767px) {
  .app-sidebar {
    position: fixed;
    top: var(--header-height);
    bottom: 0;
    left: 0;
    width: 260px;
    box-shadow: var(--shadow-float);
    transform: translateX(-100%);
  }

  .app-sidebar.mobile-open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    top: var(--header-height);
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(2px);
    z-index: 44;
  }
}

/* Content Area inside Layout */
.app-main-content {
  flex: 1;
  width: 100%;
  min-width: 0;
  padding-bottom: 40px;
}

.container-app {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 16px;
}

@media (min-width: 768px) {
  .container-app {
    padding: 24px 32px;
  }
}

/* Header */
.top-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-color);
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

/* Bottom Nav (Retired in favor of Sidebar) */
.bottom-nav {
  display: none !important;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 100%;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  position: relative;
  gap: 3px;
}

.nav-item.active {
  color: var(--color-primary);
}

.nav-item .icon {
  width: 22px;
  height: 22px;
}

/* Nav Badge */
.nav-badge {
  position: absolute;
  top: 6px;
  right: calc(50% - 18px);
  background: #e11d48;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 9999px;
  min-width: 17px;
  height: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:active {
  box-shadow: var(--shadow-md);
}

/* Badges / Chips */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.badge-urgent { background: var(--chip-urgent-bg); color: var(--chip-urgent-text); }
.badge-pending { background: var(--chip-pending-bg); color: var(--chip-pending-text); }
.badge-acked { background: var(--chip-acked-bg); color: var(--chip-acked-text); }
.badge-info { background: var(--chip-info-bg); color: var(--chip-info-text); }
.badge-doc { background: var(--chip-doc-bg); color: var(--chip-doc-text); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.25;
}

.btn-primary {
  background: var(--color-primary);
  color: #ffffff;
}
.btn-primary:hover {
  background: var(--color-primary-hover);
}

.btn-secondary {
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}
.btn-secondary:hover {
  background: var(--bg-subtle);
}

.btn-pill {
  border-radius: var(--radius-full);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-block {
  width: 100%;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

@media (min-width: 640px) {
  .modal-overlay {
    align-items: center;
    padding: 20px;
  }
}

.modal-content {
  background: #ffffff;
  width: 100%;
  max-width: 560px;
  border-radius: 20px 20px 0 0;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-float);
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 640px) {
  .modal-content {
    border-radius: 20px;
    animation: scaleIn 0.2s ease-out;
  }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
