/* Modernus CRM — App Shell Layout */

/* ============================================
   LOGIN SCREEN
   ============================================ */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: var(--bg-secondary);
}

.login-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-3xl);
  width: 380px;
  box-shadow: var(--shadow-lg);
}

.login-card h1 {
  margin-bottom: var(--space-xs);
}

.login-card .subtitle {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  margin-bottom: var(--space-xl);
}

.login-card .form-group {
  margin-bottom: var(--space-lg);
}

.login-card label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.login-card input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  transition: border-color var(--transition-fast);
}

.login-card input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(35, 131, 226, 0.15);
}

.login-error {
  color: var(--color-urgent);
  font-size: var(--text-sm);
  min-height: 20px;
  margin-bottom: var(--space-md);
}

/* ============================================
   APP SHELL
   ============================================ */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
}

.sidebar-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-light);
}

.sidebar-header h2 {
  font-size: var(--text-base);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.sidebar-header .sidebar-sub {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-top: 2px;
}

.sidebar-nav {
  padding: var(--space-sm);
  flex: 1;
}

.nav-section {
  margin-bottom: var(--space-lg);
}

.nav-section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--space-sm) var(--space-sm);
  margin-bottom: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 6px var(--space-sm);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
  text-decoration: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  text-decoration: none;
}

.nav-item.active {
  background: var(--bg-active);
  color: var(--text-primary);
  font-weight: 500;
}

.nav-item .nav-icon {
  width: 20px;
  text-align: center;
  font-size: var(--text-base);
}

.nav-item .nav-badge {
  margin-left: auto;
  background: var(--color-urgent);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* Sidebar footer */
.sidebar-footer {
  padding: var(--space-md);
  border-top: 1px solid var(--border-light);
}

.sidebar-footer button {
  width: 100%;
  padding: 6px;
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.sidebar-footer button:hover {
  background: var(--bg-hover);
  color: var(--text-secondary);
}

/* Main content area */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* Page header */
.page-header {
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.page-header h1 {
  font-size: var(--text-xl);
  font-weight: 600;
}

.page-header .header-actions {
  display: flex;
  gap: var(--space-sm);
}

/* View container */
#view-container {
  flex: 1;
  overflow: auto;
  padding: 0;
}

/* ============================================
   LOADING & EMPTY STATES
   ============================================ */
/* Action Queue loading text */
.action-queue .loading {
  padding: var(--space-xl);
  color: var(--text-tertiary);
  font-size: var(--text-sm);
}

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3xl);
  color: var(--text-tertiary);
  gap: var(--space-sm);
}

.loading-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-light);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state {
  text-align: center;
  padding: var(--space-3xl);
  color: var(--text-tertiary);
}

.empty-state .empty-icon {
  font-size: 2rem;
  margin-bottom: var(--space-md);
}

.empty-state h3 {
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.empty-state p {
  font-size: var(--text-sm);
  max-width: 320px;
  margin: 0 auto;
}
