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

:root {
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #1e293b;
  --text-light: #64748b;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #1e293b;
  --text-light: #64748b;
  --border: #e2e8f0;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #1e293b;
  --text: #e5e7eb;
  --text-light: #94a3b8;
  --border: #334155;
}

.topic-card {
  cursor: grab;
}

.topic-card:active {
  cursor: grabbing;
}
.topic-card.compact {
  padding: 0.75rem;
}
.topic-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}
.done-btn {
  padding: 0;
  height: 33px;
  width: 24px;
  font-size: 0.9rem;
  line-height: 1;
}
.topic-main {
  flex: 1;
  min-width: 0;
}
.topic-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
.topic-owner {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 0.1rem;
}
.topic-line {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}
.topic-badges {
  display: flex;
  gap: 0.25rem;
  white-space: nowrap;
}
.topic-card.ultra-compact {
  padding: 0.5rem 0.6rem;
}
.topic-description.ultra-compact {
  margin-top: 11px;
  font-size: 0.8rem;
  color: var(--text-light);
  line-height: 1.2;
  width: 80%;
  float: left;
}
.topic-actions.ultra-compact {
  display: flex;
  justify-content: flex-end;
  gap: 0.25rem;
  margin-top: 0.25rem;
  width: 80px;
  float: right;
}
.topic-card.ultra-compact.completed {
  opacity: 0.6;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 
               sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-content {
  background: var(--surface);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  max-width: 400px;
  width: 100%;
  animation: modalSlideIn 0.3s ease;
}

.modal-large {
  max-width: 600px;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-light);
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.close-btn:hover {
  background: var(--bg);
  color: var(--text);
}

/* Header */
header {
  background: var(--surface);
  padding: 1.5rem 2rem;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

header h1 {
  font-size: 1.75rem;
  color: var(--primary);
}

.header-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.user-badge {
  padding: 0.5rem 1rem;
  background: var(--bg);
  border-radius: 20px;
  font-size: 0.875rem;
  color: var(--text);
}

/* Forms */
input, textarea, select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  margin-bottom: 1rem;
  transition: border-color 0.2s;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text);
}

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

.form-col {
  display: flex;
  flex-direction: column;
}

/* Buttons */
button {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

button.primary {
  background: var(--primary);
  color: white;
  border: none;
}

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

button.danger {
  background: var(--danger);
  color: white;
  border: none;
}

.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

.error {
  color: var(--danger);
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

/* Main Content */
main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

section {
  margin-bottom: 2rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.search-bar {
  margin-bottom: 1.5rem;
}

.search-bar input {
  max-width: 400px;
}

/* Unassigned Topics */
.unassigned-section {
  background: var(--surface);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.topics-container {
  display: grid;
  gap: 0.75rem;
  min-height: 60px;
  padding: 0.5rem;
  background: var(--bg);
  border-radius: 8px;
}

/* Meeting Card */
.meeting-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
  border-left: 4px solid var(--primary);
}

.meeting-card.past {
  opacity: 0.7;
  border-left-color: var(--text-light);
}

.meeting-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.meeting-info h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--primary);
}

.meeting-date {
  color: var(--text-light);
  font-size: 0.875rem;
}

.meeting-actions {
  display: flex;
  gap: 0.5rem;
}

.icon-btn {
  padding: 0.5rem;
  min-width: 40px;
  font-size: 1.125rem;
}

.meeting-stats {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.stat {
  padding: 0.75rem 1rem;
  background: var(--bg);
  border-radius: 8px;
  flex: 1;
  min-width: 150px;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 0.25rem;
}

.stat.warning .stat-value {
  color: var(--warning);
}

.stat.danger .stat-value {
  color: var(--danger);
}

.stat.success .stat-value {
  color: var(--success);
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 0.5rem;
}

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

.progress-fill.warning {
  background: var(--warning);
}

.progress-fill.danger {
  background: var(--danger);
}

/* Topic Card */
.topic-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  cursor: move;
  transition: all 0.2s;
  position: relative;
}

.topic-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.topic-card.dragging {
  opacity: 0.5;
}

.topic-card.drag-over {
  border-color: var(--primary);
  border-style: dashed;
}

.topic-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.topic-title {
  flex: 1;
  font-weight: 600;
  font-size: 1.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topic-owner-inline {
  font-size: 0.75rem;
  color: var(--text-light);
  white-space: nowrap;
}

.topic-description.compact {
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-light);
}
.topic-actions.compact {
  display: flex;
  justify-content: flex-end;
  gap: 0.25rem;
  margin-top: 0.4rem;
}

.topic-card.compact.completed {
  opacity: 0.7;
}

.badge {
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge.severity-low {
  background: #dbeafe;
  color: #1e40af;
}

.badge.severity-medium {
  background: #fef3c7;
  color: #92400e;
}

.badge.severity-high {
  background: #fed7aa;
  color: #9a3412;
}

.badge.severity-critical {
  background: #fee2e2;
  color: #991b1b;
}

.badge.status-pending {
  background: var(--bg);
  color: var(--text-light);
}

.badge.status-in-progress {
  background: #dbeafe;
  color: #1e40af;
}

.badge.status-completed {
  background: #d1fae5;
  color: #065f46;
}

.badge.status-deferred {
  background: #f3f4f6;
  color: #4b5563;
}


.topic-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: var(--text-light);
}

.topic-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.topic-actions {
  display: flex;
  gap: 0.25rem;
}

.topic-actions button {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
  header {
    padding: 1rem;
  }

  header h1 {
    font-size: 1.5rem;
    width: 100%;
  }

  main {
    padding: 1rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .meeting-stats {
    flex-direction: column;
  }

  .stat {
    min-width: 100%;
  }
}

/*Proress*/
.live-progress {
  margin-top: 0.75rem;
}

.live-progress-bar {
  height: 10px;
  background: var(--bg);
  border-radius: 6px;
  overflow: hidden;
}

.live-progress-fill {
  height: 100%;
  transition: width 0.5s ease;
}

.live-progress-fill.ok {
  background: #10b981; /* green */
}

.live-progress-fill.warn {
  background: #f59e0b; /* amber */
}

.live-progress-fill.danger {
  background: #ef4444; /* red */
}

/* Utility Classes */
.hidden {
  display: none !important;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }

