/* VIP Command Center - Styles */

:root {
  --bg-color: #f8fafc;
  --card-bg: white;
  --card-border: 1px solid #e5e7eb;
  --card-radius: 16px;
  --btn-radius: 12px;
  --accent: #0EA5E9;
  --accent-dark: #0284c7;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --border-color: #e5e7eb;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
}

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

body {
  font-family: var(--font);
  background-color: var(--bg-color);
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 400"><defs><pattern id="veins" patternUnits="userSpaceOnUse" width="100" height="100"><path d="M20 0 Q30 25 20 50 T20 100" stroke="%23e5e7eb" fill="none" stroke-width="0.5"/><path d="M60 0 Q70 25 60 50 T60 100" stroke="%23e5e7eb" fill="none" stroke-width="0.5"/><path d="M0 30 Q25 40 50 30 T100 30" stroke="%23e5e7eb" fill="none" stroke-width="0.5"/><path d="M0 70 Q25 80 50 70 T100 70" stroke="%23e5e7eb" fill="none" stroke-width="0.5"/></pattern></defs><rect fill="url(%23veins)" width="400" height="400"/></svg>');
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
}

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

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

.login-logo {
  font-size: 48px;
  margin-bottom: 16px;
}

.login-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

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

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-input {
  padding: 14px 16px;
  border: var(--card-border);
  border-radius: var(--btn-radius);
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
}

.login-input:focus {
  border-color: var(--accent);
}

.login-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 14px 24px;
  border-radius: var(--btn-radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.login-btn:hover {
  background: var(--accent-dark);
}

.login-error {
  color: #EF4444;
  font-size: 14px;
  display: none;
}

.login-error.show {
  display: block;
}

.phi-warning {
  margin-top: 24px;
  padding: 12px;
  background: #fef3c7;
  border-radius: 8px;
  font-size: 13px;
  color: #92400e;
}

/* Header */
.header {
  background: var(--card-bg);
  border-bottom: var(--card-border);
  padding: 16px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon {
  font-size: 28px;
}

.header-badge {
  background: #fee2e2;
  color: #991b1b;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn {
  padding: 10px 16px;
  border-radius: var(--btn-radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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

.btn-primary:hover {
  background: var(--accent-dark);
}

.btn-secondary {
  background: white;
  color: var(--text-primary);
  border: var(--card-border);
}

.btn-secondary:hover {
  background: #f9fafb;
  border-color: var(--accent);
}

.btn-icon {
  padding: 10px;
}

/* Filter Row */
.filter-row {
  background: var(--card-bg);
  border-bottom: var(--card-border);
  padding: 12px 24px;
  position: sticky;
  top: 65px;
  z-index: 99;
}

.filter-content {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 300px;
}

.search-input {
  width: 100%;
  padding: 10px 12px 10px 36px;
  border: var(--card-border);
  border-radius: var(--btn-radius);
  font-size: 14px;
  outline: none;
}

.search-input:focus {
  border-color: var(--accent);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.filter-select {
  padding: 10px 12px;
  border: var(--card-border);
  border-radius: var(--btn-radius);
  font-size: 14px;
  background: white;
  cursor: pointer;
  outline: none;
  min-width: 120px;
}

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

.filter-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: white;
  border: var(--card-border);
  border-radius: var(--btn-radius);
  cursor: pointer;
  font-size: 14px;
}

.filter-toggle input {
  accent-color: var(--accent);
}

.view-toggle {
  display: flex;
  border: var(--card-border);
  border-radius: var(--btn-radius);
  overflow: hidden;
  margin-left: auto;
}

.view-btn {
  padding: 10px 14px;
  background: white;
  border: none;
  cursor: pointer;
  font-size: 16px;
}

.view-btn.active {
  background: var(--accent);
  color: white;
}

.filter-toggle-mobile {
  display: none;
  padding: 10px;
  background: white;
  border: var(--card-border);
  border-radius: var(--btn-radius);
  cursor: pointer;
}

/* Main Layout */
.main {
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
}

/* KPI Strip */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--card-bg);
  border: var(--card-border);
  border-radius: var(--card-radius);
  padding: 20px;
}

.kpi-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
}

.kpi-card.blocked .kpi-value {
  color: #EF4444;
}

.kpi-card.review .kpi-value {
  color: #F59E0B;
}

/* Project Count */
.project-count {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

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

.project-card {
  background: var(--card-bg);
  border: var(--card-border);
  border-radius: var(--card-radius);
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s;
}

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

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

.priority-badge {
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
}

.priority-badge.small {
  padding: 2px 6px;
  font-size: 10px;
}

.status-badge {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 20px;
  background: #f3f4f6;
  color: var(--text-secondary);
}

.status-badge.not-started { background: #f3f4f6; color: #6b7280; }
.status-badge.in-progress { background: #dbeafe; color: #1e40af; }
.status-badge.blocked { background: #fee2e2; color: #991b1b; }
.status-badge.review { background: #fef3c7; color: #92400e; }
.status-badge.done { background: #dcfce7; color: #166534; }

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.card-type {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.card-teams {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.team-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 6px;
}

.card-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  overflow: hidden;
}

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

.progress-text {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.card-date {
  font-size: 12px;
  color: var(--text-muted);
}

.compliance-badge {
  font-size: 11px;
  color: #991b1b;
  background: #fee2e2;
  padding: 3px 8px;
  border-radius: 6px;
}

/* Projects Table */
.projects-table-container {
  overflow-x: auto;
}

.projects-table {
  width: 100%;
  background: var(--card-bg);
  border: var(--card-border);
  border-radius: var(--card-radius);
  border-collapse: collapse;
  overflow: hidden;
}

.projects-table th {
  text-align: left;
  padding: 14px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: #f9fafb;
  border-bottom: var(--card-border);
}

.projects-table td {
  padding: 14px 16px;
  font-size: 14px;
  border-bottom: var(--card-border);
}

.table-row {
  cursor: pointer;
  transition: background 0.2s;
}

.table-row:hover {
  background: #f9fafb;
}

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

/* Activity Feed Sidebar */
.sidebar {
  position: sticky;
  top: 140px;
}

.activity-card {
  background: var(--card-bg);
  border: var(--card-border);
  border-radius: var(--card-radius);
  padding: 20px;
}

.activity-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.2s;
}

.activity-item:hover {
  background: #f9fafb;
}

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}

.activity-dot.in-progress { background: #3b82f6; }
.activity-dot.done { background: #22c55e; }
.activity-dot.blocked { background: #ef4444; }
.activity-dot.review { background: #f59e0b; }
.activity-dot.not-started { background: #9ca3af; }

.activity-content {
  flex: 1;
  min-width: 0;
}

.activity-project {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-meta {
  font-size: 12px;
  color: var(--text-muted);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--card-bg);
  border-radius: var(--card-radius);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: var(--card-border);
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
}

.modal-body {
  padding: 24px;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px;
  border: var(--card-border);
  border-radius: var(--btn-radius);
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: var(--card-border);
}

/* Project Detail Page */
.detail-header {
  background: var(--card-bg);
  border-bottom: var(--card-border);
  padding: 24px;
}

.detail-header-content {
  max-width: 1200px;
  margin: 0 auto;
}

.detail-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
}

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

.detail-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.detail-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.detail-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.detail-id {
  font-size: 14px;
  color: var(--text-muted);
}

.detail-actions {
  display: flex;
  gap: 8px;
}

.detail-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.detail-section {
  background: var(--card-bg);
  border: var(--card-border);
  border-radius: var(--card-radius);
  padding: 24px;
  margin-bottom: 24px;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.detail-item {
  padding: 12px 0;
}

.detail-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-value {
  font-size: 15px;
  color: var(--text-primary);
}

.deliverable-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
}

.deliverable-item:last-child {
  border-bottom: none;
}

.deliverable-item input {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
}

.deliverable-item span.done {
  text-decoration: line-through;
  color: var(--text-muted);
}

.project-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #f9fafb;
  border-radius: 8px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 8px;
  transition: background 0.2s;
}

.project-link:hover {
  background: #e5e7eb;
}

.link-icon {
  font-size: 16px;
}

.compliance-card {
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.compliance-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.compliance-icon {
  font-size: 32px;
}

.compliance-text {
  font-size: 14px;
  color: #991b1b;
}

.compliance-text strong {
  display: block;
  font-size: 16px;
}

.log-entry {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

.log-entry:last-child {
  border-bottom: none;
}

.log-time {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 2px;
}

.log-text {
  font-size: 14px;
  color: var(--text-primary);
}

.empty {
  color: var(--text-muted);
  font-size: 14px;
  font-style: italic;
}

.btn-danger {
  background: white;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.btn-danger:hover {
  background: #fef2f2;
}

/* Responsive */
@media (max-width: 1024px) {
  .main {
    grid-template-columns: 1fr;
  }
  
  .sidebar {
    position: static;
  }
  
  .detail-main {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .header-content {
    flex-wrap: wrap;
  }
  
  .filter-row {
    top: 120px;
  }
  
  .filter-content {
    display: none;
  }
  
  .filter-content.open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-toggle-mobile {
    display: block;
    width: 100%;
  }
  
  .search-box {
    max-width: none;
    width: 100%;
  }
  
  .filter-select {
    width: 100%;
  }
  
  .view-toggle {
    margin-left: 0;
  }
  
  .kpi-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .detail-grid {
    grid-template-columns: 1fr;
  }
  
  .detail-title-row {
    flex-direction: column;
  }
  
  .detail-actions {
    width: 100%;
  }
  
  .detail-actions .btn {
    flex: 1;
  }
}

/* Live Link on Cards */
.live-link {
  display: block;
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  text-align: center;
  transition: all 0.2s ease;
}

.live-link:hover {
  background: var(--accent);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.password-hint {
  font-size: 12px;
  color: #64748b;
  text-align: center;
  margin-bottom: 12px;
  padding: 4px 8px;
  background: #f1f5f9;
  border-radius: 6px;
}

.password-hint code {
  background: #e2e8f0;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Monaco', 'Consolas', monospace;
  font-size: 12px;
  color: #334155;
  font-weight: 600;
}
