@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500&family=Work+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --bg: #241220;
  --bg-card: #2C1626;
  --bg-card-2: #33192C;
  --bg-input: #1C0F19;
  --border: #4A2A3F;
  --text: #F5E9E2;
  --text-dim: #C9B8B0;
  --text-dimmer: #8A7268;
  --text-faint: #6E5A54;
  --accent: #C9A66B;
  --accent-2: #D4738A;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: 'Work Sans', sans-serif; background: var(--bg); color: var(--text); }
h1, h2 { font-family: 'Fraunces', serif; font-weight: 500; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 32px; width: 320px; display: flex; flex-direction: column; gap: 14px; }
.login-card .brand { font-family: 'IBM Plex Mono', monospace; letter-spacing: 1.5px; font-size: 11px; color: var(--accent); text-transform: uppercase; }
.login-card h1 { margin: 0 0 8px; font-size: 24px; }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-dim); }
.login-card input { background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px; padding: 10px 11px; color: var(--text); font-size: 14px; font-family: inherit; }
.login-card button { margin-top: 8px; background: var(--accent); color: var(--bg); border: none; border-radius: 8px; padding: 11px; font-weight: 600; cursor: pointer; }
.login-card .error { color: #E05252; font-size: 13px; margin: 0; }

.topbar { display: flex; justify-content: space-between; align-items: center; padding: 14px 24px; border-bottom: 1px solid var(--border); }
.topbar-left { display: flex; align-items: center; gap: 12px; }
.logo-dot { width: 22px; height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--accent), #7A3B54); display: inline-block; }
.topbar select, .topbar-left button { background: var(--bg-card); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-family: inherit; }
.topbar-left button { cursor: pointer; }
.topbar-right { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--text-dim); font-family: 'IBM Plex Mono', monospace; }
.topbar-right a { color: var(--text-dim); text-decoration: none; }

.board { max-width: 1400px; margin: 0 auto; padding: 40px 20px 70px; }
.board-head .eyebrow { display: flex; align-items: center; gap: 10px; font-family: 'IBM Plex Mono', monospace; font-size: 12px; letter-spacing: 1.5px; color: var(--accent); text-transform: uppercase; margin-bottom: 6px; }
.eyebrow-bar { width: 22px; height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--accent), #7A3B54); display: inline-block; }
.board-head h1 { margin: 0; font-size: 38px; line-height: 1.05; }
.controls-row { margin-top: 18px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.progress-wrap { flex: 1 1 240px; max-width: 340px; }
.progress-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-dim); margin-bottom: 5px; }
.progress-label span:last-child { font-family: 'IBM Plex Mono', monospace; color: var(--accent); }
.progress-bar { height: 7px; background: #3A1E32; border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); width: 0%; transition: width .3s; }
.btn-primary { background: var(--accent); color: var(--bg); border: none; border-radius: 8px; padding: 9px 16px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.filter-btn { background: transparent; border: 1px solid var(--border); color: var(--text-dim); border-radius: 20px; padding: 6px 14px; cursor: pointer; font-size: 13px; font-family: inherit; }
.filter-btn.active { font-weight: 600; }

.columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; align-items: start; margin-top: 26px; }
.column { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.column-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-family: 'Fraunces', serif; font-size: 17px; }
.count { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--text-dimmer); background: var(--bg-input); padding: 2px 8px; border-radius: 10px; }
.column-list { display: flex; flex-direction: column; gap: 9px; max-height: 560px; overflow-y: auto; }
.column-list::-webkit-scrollbar { width: 6px; }
.column-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.empty-col { color: var(--text-faint); font-size: 13px; padding: 16px 0; text-align: center; }

.task-card { background: var(--bg-card-2); border: 1px solid var(--border); border-left: 3px solid var(--border); border-radius: 8px; padding: 11px 12px; }
.task-title { font-size: 13.5px; line-height: 1.4; margin-bottom: 9px; }
.task-tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 9px; }
.tag { font-size: 10.5px; padding: 2px 7px; border-radius: 4px; font-weight: 500; }
.tag-owner { font-size: 10.5px; color: var(--text-dimmer); font-family: 'IBM Plex Mono', monospace; }
.task-actions { display: flex; gap: 4px; align-items: center; }
.move-btn { background: none; border: 1px solid var(--border); color: var(--text-dim); border-radius: 5px; width: 24px; height: 22px; cursor: pointer; }
.move-btn:disabled { color: var(--border); cursor: default; }
.del-btn { margin-left: auto; background: none; border: none; color: var(--text-faint); cursor: pointer; font-size: 13px; padding: 2px 4px; }

.modal { display: none; position: fixed; inset: 0; background: rgba(15,8,13,.7); align-items: center; justify-content: center; padding: 20px; z-index: 50; }
.modal.open { display: flex; }
.modal-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 24px; width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 14px; }
.modal-card h2 { margin: 0 0 4px; font-size: 20px; }
.modal-card label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--text-dim); }
.modal-card input, .modal-card select { background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; color: var(--text); font-size: 14px; font-family: inherit; }
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.modal-actions button { padding: 9px 16px; border-radius: 8px; border: 1px solid var(--border); background: transparent; color: var(--text-dim); cursor: pointer; font-family: inherit; }
.modal-actions .btn-primary { border: none; }

.board-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 60vh; gap: 16px; color: var(--text-dim); text-align: center; }
.view-only-badge { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--text-dimmer); border: 1px solid var(--border); border-radius: 20px; padding: 8px 14px; }

.admin-wrap { max-width: 1000px; margin: 0 auto; padding: 40px 20px 70px; }
.admin-section { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 24px; }
.admin-section h2 { margin: 0 0 16px; font-size: 20px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th, .admin-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table th { color: var(--text-dim); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.admin-table input, .admin-table select { background: var(--bg-input); border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; color: var(--text); font-size: 13px; font-family: inherit; width: 100%; }
.inline-form { display: flex; gap: 6px; align-items: center; }
.btn-small { background: var(--bg-input); border: 1px solid var(--border); color: var(--text-dim); border-radius: 6px; padding: 6px 10px; font-size: 12px; cursor: pointer; font-family: inherit; }
.btn-danger { color: #E05252; border-color: #E05252; }
.new-row-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-top: 16px; align-items: end; }
.new-row-form label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--text-dim); }
.new-row-form input, .new-row-form select { background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; color: var(--text); font-size: 14px; font-family: inherit; }
.flash { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.flash-ok { background: rgba(111,168,160,.15); color: #7FA8A0; }
.flash-error { background: rgba(224,82,82,.15); color: #E05252; }
.perm-matrix { overflow-x: auto; }
