/* ============================================
   Miran Board — Kanban Dashboard
   ============================================ */

:root {
  --bg-primary: #0f0f1a;
  --bg-secondary: #1a1a2e;
  --bg-card: #16213e;
  --bg-card-hover: #1a2744;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-subtle: #2d3748;
  --accent-blue: #3b82f6;
  --accent-red: #ef4444;
  --accent-orange: #f59e0b;
  --accent-yellow: #eab308;
  --accent-green: #22c55e;
  --accent-purple: #8b5cf6;
  --priority-high: #ef4444;
  --priority-medium: #f59e0b;
  --priority-low: #22c55e;
  --column-blocked: #ef4444;
  --column-waiting: #f59e0b;
  --column-progress: #3b82f6;
  --column-review: #a855f7;
  --column-done: #22c55e;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --shadow-card: 0 2px 12px rgba(0,0,0,0.2);
  --transition: 0.2s ease;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: auto;
}

/* ---- Password Screen ---- */
.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.auth-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 48px 40px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow);
}

.auth-logo {
  font-size: 48px;
  margin-bottom: 8px;
}

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

.auth-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.auth-input-wrap {
  position: relative;
  margin-bottom: 16px;
}

.auth-input {
  width: 100%;
  padding: 14px 18px;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 16px;
  outline: none;
  transition: border-color var(--transition);
}

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

.auth-input.error {
  border-color: var(--accent-red);
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.auth-btn {
  width: 100%;
  padding: 14px;
  background: var(--accent-blue);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}

.auth-btn:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

.auth-btn:active {
  transform: translateY(0);
}

.auth-error {
  color: var(--accent-red);
  font-size: 13px;
  margin-top: 12px;
  min-height: 20px;
}

/* ---- Board Layout ---- */
.board-screen {
  display: none;
  flex-direction: column;
  min-height: 100vh;
}

.board-screen.active {
  display: flex;
}

/* ---- Header ---- */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

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

.header-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

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

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

.lock-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
}

.lock-btn:hover {
  border-color: var(--accent-red);
  color: var(--accent-red);
  background: rgba(239, 68, 68, 0.08);
}

/* ---- Kanban Grid ---- */
.kanban {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  padding: 24px;
  flex: 1;
  min-width: 900px;
}

.column {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 200px;
}

.column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
}

.column-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.column-count {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--bg-primary);
  color: var(--text-muted);
}

.column-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.column-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
  min-height: 100px;
}

/* ---- Cards ---- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 16px;
  box-shadow: var(--shadow-card);
  transition: all var(--transition);
  opacity: 0;
  transform: translateY(8px);
  animation: cardIn 0.4s ease forwards;
}

.card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

/* priority classes kept for badge styling only */

@keyframes cardIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.2s; }
.card:nth-child(5) { animation-delay: 0.25s; }

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

.card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.card-priority-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  margin-left: 8px;
}

.card-priority-badge.high {
  background: rgba(239, 68, 68, 0.15);
  color: var(--priority-high);
}

.card-priority-badge.medium {
  background: rgba(245, 158, 11, 0.15);
  color: var(--priority-medium);
}

.card-priority-badge.low {
  background: rgba(34, 197, 94, 0.15);
  color: var(--priority-low);
}

.card-client {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.card-status {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 10px;
}

.card-blockers {
  margin-bottom: 10px;
}

.card-blockers-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-red);
  margin-bottom: 4px;
}

.card-blocker-item {
  font-size: 12px;
  color: #fca5a5;
  line-height: 1.5;
  padding-left: 12px;
  position: relative;
}

.card-blocker-item::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--accent-red);
}

.card-next {
  font-size: 13px;
  color: var(--accent-blue);
  font-style: italic;
  line-height: 1.4;
  margin-bottom: 10px;
  padding-left: 0;
}

.card-next::before {
  content: '→ ';
  color: var(--text-muted);
}

.card-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

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

/* ---- Responsive ---- */
@media (max-width: 1100px) {
  .kanban {
    grid-template-columns: repeat(3, 1fr);
    min-width: unset;
  }
}

@media (max-width: 768px) {
  .kanban {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .header-right {
    width: 100%;
    justify-content: space-between;
  }
}
