:root {
  color-scheme: light dark;
  --bg: #f5f6fa;
  --fg: #202124;
  --card-bg: #ffffff;
  --border: #dcdfe4;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1c1f;
    --fg: #e8eaed;
    --card-bg: #2a2b2f;
    --border: #3c3f44;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}

header h1 {
  font-size: 18px;
  margin: 0;
}

.controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

#dept-select,
#refresh-btn {
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--fg);
}

#refresh-btn,
#logout-btn {
  cursor: pointer;
}

#logout-btn {
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--fg);
}

#updated-at {
  font-size: 12px;
  opacity: 0.7;
}

#user-label {
  font-size: 12px;
  opacity: 0.8;
}

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 32px;
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.login-card h1 {
  font-size: 18px;
  margin: 0 0 4px;
}

.login-subtitle {
  font-size: 13px;
  opacity: 0.75;
  margin: 0 0 16px;
}

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

.login-card label {
  font-size: 12px;
  opacity: 0.8;
  margin-top: 8px;
}

.login-card input {
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
}

.login-card button {
  margin-top: 16px;
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  cursor: pointer;
}

.login-error {
  color: #d93025;
  font-size: 13px;
  margin-top: 12px;
}

.login-error.hidden {
  display: none;
}

.banner {
  background: #d93025;
  color: white;
  padding: 10px 20px;
  font-size: 14px;
}

.banner.hidden {
  display: none;
}

#board {
  display: flex;
  gap: 12px;
  padding: 16px;
  overflow-x: auto;
  align-items: flex-start;
}

.column {
  flex: 0 0 308px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  max-height: calc(100vh - 90px);
  display: flex;
  flex-direction: column;
}

.column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 3px solid var(--column-color, #9AA0A6);
  font-weight: 600;
}

.column-count {
  background: var(--bg);
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 12px;
}

.column-body {
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card {
  display: block;
  background: var(--bg);
  border-left: 4px solid var(--column-color, #9AA0A6);
  border-radius: 4px;
  padding: 8px 10px;
  text-decoration: none;
  color: inherit;
  font-size: 13px;
}

.card:hover {
  filter: brightness(1.08);
}

.card-top {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  opacity: 0.8;
  margin-bottom: 4px;
}

.card-top-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-category {
  opacity: 0.8;
  text-transform: uppercase;
  font-size: 11px;
}

.card-priority {
  font-weight: 600;
  text-transform: uppercase;
}

.priority-urgente {
  color: #d93025;
}

.priority-alta {
  color: #e8710a;
}

.priority-normal {
  color: #1a73e8;
}

.priority-baixa {
  color: #5f6368;
}

.card-title {
  font-weight: 600;
  margin-bottom: 6px;
}

.card-assignee {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.card-assignee .card-date {
  margin-left: auto;
}

.avatar {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: white;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.5px;
}

.assignee-name {
  font-weight: 600;
  font-size: 12.5px;
}

.card-client {
  opacity: 0.8;
  margin-bottom: 6px;
}

.card-date {
  opacity: 0.55;
  font-size: 10.5px;
}
