/* Customer Portal Styles */
/* Extends design-system.css with customer-specific styles */

:root {
  --bg: #0d1117;
  --bg-card: #161b22;
  --border: #30363d;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #58a6ff;
  --success: #3fb950;
  --warning: #d29922;
  --danger: #f85149;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* Login Screen */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 48px;
  text-align: center;
  max-width: 400px;
}

.login-card .logo {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
}

.login-card .subtitle {
  color: var(--muted);
  margin-bottom: 32px;
}

.login-message {
  color: var(--muted);
  line-height: 1.6;
}

.login-message p {
  margin-bottom: 12px;
}

/* App Container */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 240px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
}

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

.sidebar-header .logo {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  color: var(--muted);
  text-decoration: none;
  transition: all 0.15s ease;
}

.nav-item:hover {
  background: rgba(88, 166, 255, 0.1);
  color: var(--text);
}

.nav-item.active {
  background: rgba(88, 166, 255, 0.15);
  color: var(--accent);
  border-right: 2px solid var(--accent);
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

.user-info {
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
}

.user-name {
  font-weight: 500;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 240px;
  padding: 32px;
}

/* Views */
.view {
  max-width: 1200px;
}

.view.hidden {
  display: none;
}

.view-header {
  margin-bottom: 32px;
}

.view-header h1 {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 8px;
}

.back-link {
  display: inline-block;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: 16px;
  font-size: 14px;
}

.back-link:hover {
  text-decoration: underline;
}

/* Stats */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  text-align: center;
}

.stat-value {
  font-size: 36px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
}

.stat-label {
  color: var(--muted);
  font-size: 14px;
}

/* Sections */
.section {
  margin-bottom: 32px;
}

.section h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.section-header h2 {
  margin-bottom: 0;
}

/* Card Grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.card-description {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 12px;
  line-height: 1.5;
}

.card-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--muted);
}

.card-progress {
  margin-top: 12px;
}

.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: var(--success);
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* Project Stats */
.project-stats {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 24px;
}

.stats-row {
  display: flex;
  gap: 24px;
  font-size: 14px;
  color: var(--muted);
}

/* Task Filters */
.task-filters {
  display: flex;
  gap: 8px;
}

.filter-btn {
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s ease;
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Task List */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.task-item:hover {
  border-color: var(--accent);
}

.task-item .status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.task-item .status-indicator.todo { background: var(--muted); }
.task-item .status-indicator.in_progress { background: var(--warning); }
.task-item .status-indicator.done { background: var(--success); }

.task-item .task-title {
  flex: 1;
  font-weight: 500;
}

.task-item .task-meta {
  font-size: 13px;
  color: var(--muted);
}

/* Status Badge */
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
}

.status-badge.todo {
  background: rgba(139, 148, 158, 0.2);
  color: var(--muted);
}

.status-badge.in_progress {
  background: rgba(210, 153, 34, 0.2);
  color: var(--warning);
}

.status-badge.done {
  background: rgba(63, 185, 80, 0.2);
  color: var(--success);
}

/* Task Details */
.task-details {
  margin-bottom: 24px;
}

.detail-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
}

.detail-section h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.content-block {
  line-height: 1.6;
  white-space: pre-wrap;
}

/* Task Actions */
.task-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.task-actions label {
  font-weight: 500;
}

/* Comments */
.comments-list {
  margin-bottom: 16px;
}

.comment {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.comment-author {
  font-weight: 500;
}

.comment-author .badge {
  font-size: 11px;
  padding: 2px 6px;
  background: rgba(88, 166, 255, 0.2);
  color: var(--accent);
  border-radius: 4px;
  margin-left: 8px;
}

.comment-date {
  font-size: 13px;
  color: var(--muted);
}

.comment-body {
  line-height: 1.6;
}

.comment-form textarea {
  width: 100%;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  margin-bottom: 12px;
}

.comment-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: #4090df;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

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

/* Select */
.select {
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
}

.select:focus {
  outline: none;
  border-color: var(--accent);
}

/* Utilities */
.hidden { display: none !important; }
.text-muted { color: var(--muted); }
.accent { color: var(--accent); }

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px;
  color: var(--muted);
}

.empty-state h3 {
  margin-bottom: 8px;
  color: var(--text);
}

/* Loading */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  color: var(--muted);
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
  }

  .main-content {
    margin-left: 0;
    padding: 16px;
  }

  .app-container {
    flex-direction: column;
  }

  .sidebar-nav {
    display: flex;
    overflow-x: auto;
    padding: 0;
  }

  .nav-item {
    padding: 12px 16px;
    white-space: nowrap;
  }

  .nav-item.active {
    border-right: none;
    border-bottom: 2px solid var(--accent);
  }

  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .card-grid {
    grid-template-columns: 1fr;
  }
}
