/* ============================================
   KarbiTasks · Dark Theme · Fluid Layout
   For task.thekarbis.com
============================================ */

/* ---------- Design Tokens ---------- */
:root {
  --bg-main: #020617;
  --bg-shell: rgba(15, 23, 42, 0.96);
  --bg-card: rgba(15, 23, 42, 0.98);
  --bg-card-alt: rgba(15, 23, 42, 0.9);

  --border-soft: rgba(30, 64, 175, 0.45);
  --border-subtle: #1f2937;
  --border-strong: #0b1120;

  --accent-green: #22c55e;
  --accent-green-soft: rgba(34, 197, 94, 0.14);

  --accent-blue: #3b82f6;
  --accent-blue-soft: rgba(59, 130, 246, 0.18);

  --accent-pink: #ec4899;
  --accent-pink-soft: rgba(236, 72, 153, 0.16);

  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
  --text-soft: #6b7280;

  --radius-shell: 18px;
  --radius-card: 14px;
  --radius-pill: 999px;

  --shadow-shell: 0 24px 60px rgba(0, 0, 0, 0.9);
  --shadow-card: 0 18px 35px rgba(0, 0, 0, 0.8);
}

/* ---------- Reset ---------- */
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    sans-serif;
  background:
    radial-gradient(circle at top, rgba(59, 130, 246, 0.32), transparent 55%),
    radial-gradient(circle at bottom, rgba(34, 197, 94, 0.28), transparent 55%),
    var(--bg-main);
  color: var(--text-main);
  display: flex;
  justify-content: center;
  align-items: stretch;
}

/* ---------- Shell ---------- */
.app-shell {
  width: 100%;
  max-width: 1160px;
  margin: 16px;
  background: linear-gradient(
    140deg,
    rgba(15, 23, 42, 0.98),
    rgba(15, 23, 42, 1)
  );
  border-radius: var(--radius-shell);
  box-shadow: var(--shadow-shell);
  padding: 14px 16px 16px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  backdrop-filter: blur(22px);
  display: flex;
  flex-direction: column;
}

/* ---------- Brand Bar ---------- */
.brand-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.98);
}

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

.brand-logo-dot {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: conic-gradient(
    from 160deg,
    #22c55e,
    #3b82f6,
    #ec4899,
    #22c55e
  );
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.9),
    0 0 20px rgba(56, 189, 248, 0.65);
}

.brand-name {
  font-size: 16px;
  font-weight: 600;
}

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

.brand-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-pill {
  font-size: 11px;
  padding: 4px 9px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: radial-gradient(
    circle at top,
    rgba(15, 23, 42, 0.96),
    rgba(15, 23, 42, 1)
  );
  color: var(--text-muted);
}

.pill-host {
  border-color: var(--accent-green);
  color: #bbf7d0;
  background: radial-gradient(
    circle at top,
    rgba(22, 163, 74, 0.35),
    rgba(15, 23, 42, 1)
  );
}

.pill-guest {
  border-color: var(--accent-blue);
  color: #bfdbfe;
  background: radial-gradient(
    circle at top,
    rgba(37, 99, 235, 0.4),
    rgba(15, 23, 42, 1)
  );
}

/* ---------- Generic Buttons / Chips ---------- */
.link-btn {
  border: none;
  background: transparent;
  color: var(--accent-blue);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 6px;
}

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

.link-btn.small {
  font-size: 11px;
  opacity: 0.9;
}

.primary-btn {
  border: none;
  background: linear-gradient(
    135deg,
    var(--accent-green),
    #16a34a
  );
  color: black;
  font-weight: 600;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(21, 128, 61, 0.55);
}

.primary-btn:hover {
  filter: brightness(1.05);
}

.secondary-btn {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: radial-gradient(
    circle at top,
    rgba(15, 23, 42, 0.9),
    rgba(15, 23, 42, 1)
  );
  color: var(--text-main);
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
}

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

.full-width {
  width: 100%;
}

/* ---------- Chips ---------- */
.chip {
  border-radius: var(--radius-pill);
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.95);
  color: var(--text-soft);
  font-size: 11px;
  padding: 4px 9px;
  cursor: pointer;
}

.chip-soft {
  background: rgba(15, 23, 42, 0.8);
}

.chip-active {
  border-color: var(--accent-blue);
  color: #dbeafe;
  background: var(--accent-blue-soft);
}

/* ---------- Login View ---------- */
.login-view {
  margin-top: 4px;
}

.login-card {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  padding: 18px 18px 16px;
}

.login-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.login-users {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}

@media (min-width: 700px) {
  .login-users {
    flex-direction: row;
  }
}

.user-card {
  flex: 1;
  border-radius: 12px;
  border: 1px solid rgba(55, 65, 81, 0.8);
  background: radial-gradient(
    circle at top,
    rgba(30, 64, 175, 0.3),
    rgba(15, 23, 42, 1)
  );
  color: inherit;
  padding: 12px 12px 10px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.85);
}

.user-card:hover {
  border-color: rgba(129, 140, 248, 0.9);
}

.host-card {
  background: radial-gradient(
    circle at top,
    rgba(22, 163, 74, 0.35),
    rgba(15, 23, 42, 1)
  );
}

.guest-card {
  background: radial-gradient(
    circle at top,
    rgba(37, 99, 235, 0.4),
    rgba(15, 23, 42, 1)
  );
}

.user-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(226, 232, 240, 0.8);
}

.user-name {
  font-size: 16px;
  font-weight: 600;
}

.user-role {
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 4px;
}

.login-footnote {
  font-size: 11px;
  color: var(--text-soft);
  margin-top: 8px;
}

/* ---------- Main View ---------- */
.main-view {
  margin-top: 10px;
}

/* Context bar */
.context-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.context-left {
  display: flex;
  flex-direction: column;
}

.context-title {
  font-size: 17px;
  font-weight: 600;
}

.context-subtitle {
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 3px;
}

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

/* Layout grid */
.app-main-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (min-width: 880px) {
  .app-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.3fr);
    gap: 12px;
  }
}

.column-left,
.column-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ---------- Cards ---------- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  border: 1px solid rgba(30, 64, 175, 0.4);
  box-shadow: var(--shadow-card);
  padding: 14px 14px 13px;
}

.compact-card {
  padding: 10px 12px 9px;
}

.top-bar-card {
  background: linear-gradient(
    to right,
    rgba(15, 23, 42, 0.98),
    rgba(17, 24, 39, 0.99)
  );
}

/* Card titles / badges */
.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
}

.card-badge {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  border-radius: var(--radius-pill);
  padding: 3px 7px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  color: #e5e7eb;
  background: radial-gradient(
    circle at top,
    rgba(15, 23, 42, 0.9),
    rgba(15, 23, 42, 1)
  );
}

.badge-guest {
  border-color: var(--accent-blue);
  background: radial-gradient(
    circle at top,
    var(--accent-blue-soft),
    rgba(15, 23, 42, 1)
  );
}

/* ---------- Fields ---------- */
.field-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 9px;
}

.field-group.small {
  margin-bottom: 0;
}

.field-row {
  display: flex;
  gap: 10px;
}

.field-row .half {
  flex: 1;
}

label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-soft);
  margin-bottom: 3px;
}

input[type="text"],
input[type="url"],
textarea,
select {
  background: rgba(15, 23, 42, 0.92);
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 13px;
  padding: 10px;
  outline: none;
}

input[type="text"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.4);
}

textarea {
  resize: vertical;
  min-height: 60px;
}

/* Top bar fields */
.top-bar {
  display: flex;
  gap: 8px;
}

.top-bar .field-group.small {
  flex: 1;
}

/* Error banner */
.error-banner {
  background: rgba(220, 38, 38, 0.12);
  color: #fecaca;
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 12px;
  border: 1px solid rgba(248, 113, 113, 0.7);
  margin-bottom: 8px;
}

/* Small hints */
.small-hint {
  font-size: 11px;
  color: var(--text-soft);
  margin-bottom: 8px;
}

/* ---------- Request card ---------- */
.request-card {
  background: linear-gradient(
    to bottom right,
    rgba(30, 64, 175, 0.85),
    rgba(15, 23, 42, 0.98)
  );
  border-color: rgba(96, 165, 250, 0.95);
}

#requestForm textarea {
  min-height: 68px;
}

/* ---------- Data card ---------- */
.data-card {
  background: linear-gradient(
    135deg,
    rgba(15, 23, 42, 0.98),
    rgba(17, 24, 39, 1)
  );
}

/* ---------- Tasks card / list ---------- */
.tasks-card {
  background: linear-gradient(
    to bottom,
    rgba(15, 23, 42, 0.97),
    rgba(15, 23, 42, 1)
  );
}

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

.tasks-header-main {
  display: flex;
  flex-direction: column;
}

.tasks-title {
  font-size: 15px;
  font-weight: 600;
}

.tasks-hint {
  font-size: 11px;
  color: var(--text-soft);
  margin-top: 3px;
}

.tasks-header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-chips {
  display: flex;
  gap: 4px;
}

.tasks-container {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Individual task cards inside list */
.task-item {
  border-radius: 11px;
  border: 1px solid rgba(30, 64, 175, 0.55);
  background: rgba(15, 23, 42, 0.97);
  padding: 10px 11px 9px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.08s ease;
}

.task-item:hover {
  border-color: var(--accent-blue);
  transform: translateY(-1px);
}

.task-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.task-name {
  font-size: 14px;
  font-weight: 500;
}

.task-meta-line {
  font-size: 11px;
  color: var(--text-soft);
  margin-top: 3px;
}

.task-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.task-tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(148, 163, 184, 0.5);
  color: var(--text-muted);
}

.tag-base {
  border-color: rgba(148, 163, 184, 0.6);
}

.tag-bonus {
  border-color: var(--accent-pink);
  background: var(--accent-pink-soft);
  color: #fce7f3;
}

.tag-project {
  border-color: rgba(59, 130, 246, 0.7);
}

/* Status pill */
.status-pill {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(148, 163, 184, 0.6);
}

.status-todo {
  border-color: rgba(148, 163, 184, 0.8);
}

.status-progress {
  border-color: rgba(59, 130, 246, 1);
  background: rgba(59, 130, 246, 0.18);
}

.status-blocked {
  border-color: rgba(239, 68, 68, 0.9);
  background: rgba(239, 68, 68, 0.18);
}

.status-done {
  border-color: rgba(34, 197, 94, 0.9);
  background: rgba(34, 197, 94, 0.18);
}

/* Task actions */
.task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

/* Empty state */
.empty-state {
  font-size: 12px;
  color: var(--text-soft);
  padding: 8px 1px;
}