/* ProMan — Project Management Dashboard */

.badge-purple {
  background: color-mix(in srgb, #8b5cf6 18%, transparent);
  color: #6d28d9;
}
.dark .badge-purple {
  color: #c4b5fd;
}

.badge-emerald {
  background: color-mix(in srgb, #10b981 18%, transparent);
  color: #047857;
}
.dark .badge-emerald {
  color: #6ee7b7;
}

.proman-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

.proman-project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.proman-project-card {
  transition: box-shadow 0.2s ease;
}
.proman-project-card:hover {
  box-shadow: var(--shadow-md);
}

.proman-mini-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.proman-mini-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.proman-mini-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.progress-ring {
  position: relative;
  width: var(--ring-size, 88px);
  height: var(--ring-size, 88px);
  display: inline-grid;
  place-items: center;
}
.progress-ring svg {
  transform: rotate(-90deg);
}
.progress-ring-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 8;
}
.progress-ring-fg {
  fill: none;
  stroke: var(--primary);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.4s ease;
}
.progress-ring-label {
  position: absolute;
  font-size: 0.85rem;
  font-weight: 700;
}

.progress-bar-wrap {
  width: 100%;
}
.progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--primary) 70%, #14b8a6));
  border-radius: 999px;
  transition: width 0.35s ease;
}

.proman-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}
.proman-tab {
  border: 0;
  background: transparent;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--muted-foreground);
  font: inherit;
}
.proman-tab.active {
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
  font-weight: 600;
}
.proman-tab-panel.hidden {
  display: none;
}

.proman-phase-timeline {
  position: relative;
}

.login-page {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  box-sizing: border-box;
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 8%, var(--background)), var(--background));
}

#app:has(> .login-page) {
  display: block;
  width: 100%;
}

.login-card-wrap {
  width: min(100%, 420px);
  margin-inline: auto;
}

.login-card {
  width: 100%;
  box-shadow: var(--shadow-lg);
}

.login-card .card-body {
  text-align: start;
}

.login-brand {
  margin-bottom: 1.5rem;
  text-align: center;
}

.login-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.4;
}

.login-subtitle {
  margin: 0.5rem 0 0;
  color: var(--muted-foreground);
  font-size: 0.875rem;
  line-height: 1.5;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-form .form-group {
  margin: 0;
}

.login-submit {
  margin-top: 0.25rem;
}

.login-hint {
  margin: 1.5rem 0 0;
  color: var(--muted-foreground);
  font-size: 0.75rem;
  line-height: 1.5;
  text-align: center;
}

.login-lang-switch {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1rem;
}

/* Topbar layout */
.topbar-start {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

#topbar-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notif-card.notif-unread {
  border-inline-start: 3px solid var(--primary);
}

.proman-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.proman-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

@media (max-width: 768px) {
  .data-table {
    font-size: 0.85rem;
  }
  .proman-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media print {
  [dir="rtl"] table {
    direction: rtl;
  }

  .mobile-bottom-nav,
  .mobile-more-drawer {
    display: none !important;
  }
}

/* Mobile bottom navigation */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  align-items: stretch;
  justify-content: space-around;
  gap: 0.15rem;
  padding: 0.35rem 0.5rem 0;
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--card);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 24px rgb(0 0 0 / 0.08);
}

.mobile-nav-item,
.mobile-nav-more {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.35rem 0.25rem 0.5rem;
  border: none;
  background: transparent;
  color: var(--muted-foreground);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  border-radius: var(--radius);
  transition: color 0.15s ease, background 0.15s ease;
}

.mobile-nav-icon {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius);
  transition: background 0.15s ease, color 0.15s ease;
}

.mobile-nav-icon .icon {
  width: 1.25rem;
  height: 1.25rem;
}

.mobile-nav-label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

.mobile-nav-item:hover,
.mobile-nav-more:hover {
  color: var(--foreground);
}

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

.mobile-nav-item.active .mobile-nav-icon,
.mobile-nav-more.active .mobile-nav-icon {
  background: color-mix(in srgb, var(--primary) 12%, transparent);
}

.mobile-nav-item.active .mobile-nav-icon .icon,
.mobile-nav-more.active .mobile-nav-icon .icon {
  color: var(--primary);
}

.mobile-more-drawer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 45;
  pointer-events: none;
}

.mobile-more-drawer.is-open {
  pointer-events: auto;
}

.mobile-more-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 0.4);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.mobile-more-drawer.is-open .mobile-more-backdrop {
  opacity: 1;
}

.mobile-more-panel {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  max-height: min(70vh, 32rem);
  background: var(--card);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-lg);
  transform: translateY(100%);
  transition: transform 0.24s ease;
  padding-bottom: env(safe-area-inset-bottom);
}

.mobile-more-drawer.is-open .mobile-more-panel {
  transform: translateY(0);
}

.mobile-more-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.mobile-more-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.mobile-more-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem;
  overflow: auto;
}

.mobile-more-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted-foreground);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: start;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.mobile-more-item:hover {
  background: var(--muted);
  color: var(--foreground);
}

.mobile-more-item.active {
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
}

.mobile-more-item .mobile-nav-icon {
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
}

.mobile-more-empty {
  margin: 0;
  padding: 1rem;
  text-align: center;
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

body.mobile-more-open {
  overflow: hidden;
}

@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: flex;
  }

  .mobile-more-drawer {
    display: block;
  }

  .main-wrap.has-mobile-nav .page-content {
    padding-bottom: calc(4.75rem + env(safe-area-inset-bottom));
  }
}

@media (min-width: 769px) {
  .mobile-bottom-nav,
  .mobile-more-drawer {
    display: none !important;
  }

  .main-wrap.has-mobile-nav .page-content {
    padding-bottom: 0;
  }
}
