/* Expo — dark theme */
:root {
  --bg: #0a0a0a;
  --panel: #151515;
  --panel-2: #1d1d1d;
  --line: #2a2a2a;
  --text: #ececec;
  --muted: #8a8a8a;
  --amber: #f0a020;
  --amber-dim: #c47f12;
  --blue: #4a90d9;
  --red: #e0524a;
  --green: #45b06a;
  --radius: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.cap { text-transform: capitalize; }
.spacer { flex: 1; }

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

/* brand */
.brand { font-weight: 800; letter-spacing: 0.5px; color: var(--amber); font-size: 18px; }
.brand-lg { font-size: 34px; text-align: center; }

/* auth */
.auth-card {
  width: 100%; max-width: 360px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 14px; padding: 28px;
  display: flex; flex-direction: column; gap: 14px;
}
.auth-card .muted { text-align: center; margin: 0 0 4px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* inputs & buttons */
input, textarea, select {
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; font: inherit; width: 100%;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--amber-dim); }
textarea { resize: vertical; }
.select { width: auto; }

.btn {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 14px; cursor: pointer; font: inherit; white-space: nowrap;
}
.btn:hover { border-color: #3a3a3a; background: #242424; }
.btn-primary { background: var(--amber); color: #1a1300; border-color: var(--amber); font-weight: 600; }
.btn-primary:hover { background: #ffb43a; }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--red); border-color: #4a2420; }
.btn-danger:hover { background: #2a1512; }
.btn-block { width: 100%; }
.link { background: none; border: none; color: var(--amber); cursor: pointer; font: inherit; padding: 0; }

/* topbar */
.topbar {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.user-chip { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.role-tag {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; color: var(--amber);
}
.icon-btn {
  background: transparent; border: none; color: var(--text); cursor: pointer;
  font-size: 18px; position: relative; padding: 4px 6px; border-radius: 8px;
}
.icon-btn:hover { background: var(--panel-2); }
.badge-count {
  position: absolute; top: -2px; right: -2px; background: var(--red); color: #fff;
  font-size: 10px; min-width: 16px; height: 16px; border-radius: 8px; display: none;
  align-items: center; justify-content: center; padding: 0 4px; line-height: 16px; text-align: center;
}

/* notifications dropdown */
.notif-wrap { position: relative; }
.dropdown {
  position: absolute; right: 0; top: 38px; width: 320px; max-height: 420px; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; z-index: 40;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
}
.dd-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 600; }
.dd-item { padding: 10px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.dd-item:hover { background: var(--panel-2); }
.dd-item.unread { border-left: 3px solid var(--amber); }
.dd-body { font-size: 13px; }
.dd-time { color: var(--muted); font-size: 11px; margin-top: 2px; }
.dd-empty, .dd-item:last-child { border-bottom: none; }
.dd-empty { padding: 20px 14px; color: var(--muted); text-align: center; }

/* view toggle */
.viewtoggle { display: flex; gap: 6px; padding: 12px 16px 0; }
.viewtoggle button {
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  padding: 6px 14px; border-radius: 8px; cursor: pointer; font: inherit;
}
.viewtoggle button.active { color: var(--text); border-color: var(--amber-dim); background: var(--panel-2); }

/* board */
.board { padding: 16px; }
.kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: start; }
.column { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); min-height: 120px; }
.column.drop-hover { border-color: var(--amber-dim); background: #181410; }
.column-head { display: flex; justify-content: space-between; padding: 12px 14px; font-weight: 600; border-bottom: 1px solid var(--line); }
.column-head .count { color: var(--muted); font-weight: 400; }
.column-body { padding: 10px; display: flex; flex-direction: column; gap: 10px; min-height: 60px; }
.col-empty { color: var(--muted); font-size: 13px; padding: 14px; text-align: center; }

/* cards */
.card {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px;
  padding: 11px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 7px;
}
.card:hover { border-color: #3a3a3a; }
.card.dragging { opacity: 0.4; }
.card-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.card-title { font-weight: 500; }
.card-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.meta { color: var(--muted); font-size: 12px; }
.meta-due { color: var(--amber); }

.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.dot-low { background: #5a5a5a; }
.dot-normal { background: var(--blue); }
.dot-high { background: var(--amber); }
.dot-urgent { background: var(--red); }

.badge { font-size: 10px; text-transform: uppercase; letter-spacing: 0.4px; padding: 2px 6px; border-radius: 5px; border: 1px solid var(--line); color: var(--muted); }
.badge-ticket { color: var(--red); border-color: #4a2420; }
.badge-task { color: var(--blue); border-color: #20344a; }
.badge-group { color: var(--amber); border-color: var(--amber-dim); }
.badge-cat { color: var(--text); }

/* list */
.list-table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list-table th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.list-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.list-table tr { cursor: pointer; }
.list-table tbody tr:hover { background: var(--panel-2); }
.cell-title { font-weight: 500; }

/* modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 60; overflow-y: auto; }
.modal { width: 100%; max-width: 560px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-body { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--line); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12px; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.radio-row { display: flex; gap: 16px; }
.radio { display: flex; align-items: center; gap: 6px; color: var(--text); }
.radio input { width: auto; }

/* photos */
.photo-strip { display: flex; gap: 8px; flex-wrap: wrap; }
.thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; }

/* comments */
.comments { display: flex; flex-direction: column; gap: 10px; max-height: 220px; overflow-y: auto; }
.comment { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; }
.comment-head { font-size: 12px; font-weight: 600; display: flex; gap: 8px; align-items: baseline; }
.comment-head .muted { font-weight: 400; }
.comment-body { margin-top: 3px; }
.comment-compose { display: flex; gap: 8px; }

/* team admin */
.team-row { display: grid; grid-template-columns: 1.4fr 0.8fr 1.6fr; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.team-row:last-child { border-bottom: none; }
.team-name { font-weight: 500; }
.role-select { width: auto; text-transform: capitalize; }
.team-stores { display: flex; gap: 14px; flex-wrap: wrap; }
.store-check { display: flex; align-items: center; gap: 5px; color: var(--text); font-size: 13px; }
.store-check input { width: auto; }
.store-check.dim { opacity: 0.4; }

/* toasts */
#toast-container { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 90; }
.toast { background: var(--panel-2); border: 1px solid var(--line); color: var(--text); padding: 11px 16px; border-radius: 9px; opacity: 0; transform: translateY(10px); transition: all 0.2s; box-shadow: 0 8px 24px rgba(0,0,0,0.5); }
.toast.show { opacity: 1; transform: translateY(0); }
.toast-error { border-color: #4a2420; }
.toast-info { border-color: var(--line); }

@media (max-width: 820px) {
  .kanban { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; }
  .user-chip span:first-child { display: none; }
  .grid2 { grid-template-columns: 1fr; }
}
