/* ── Design tokens ──────────────────────────────────────────── */
:root {
  --blue:        #378ADD;
  --blue-dark:   #2670bf;
  --blue-light:  #eaf2fd;
  --red:         #D85A30;
  --red-light:   #fdf0ec;
  --red-border:  #f5c4b4;
  --green:       #16a34a;
  --green-light: #f0fdf4;
  --text:        #111827;
  --text-2:      #4b5563;
  --text-3:      #9ca3af;
  --border:      #e5e7eb;
  --border-2:    #d1d5db;
  --bg:          #f8fafc;
  --card:        #ffffff;
  --nav-h:       56px;
  --radius-sm:   5px;
  --radius:      8px;
  --radius-lg:   12px;
  --shadow-sm:   0 1px 2px rgba(0,0,0,.06);
  --shadow:      0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:   0 4px 8px rgba(0,0,0,.08), 0 1px 3px rgba(0,0,0,.05);
  --shadow-lg:   0 12px 28px rgba(0,0,0,.12), 0 4px 8px rgba(0,0,0,.06);
  --t:           150ms ease;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.55;
  min-height: 100vh;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; }
button { font-family: inherit; cursor: pointer; }

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px; gap: 0;
}
.navbar-brand {
  font-size: 1rem; font-weight: 700; color: var(--blue);
  letter-spacing: -.01em; margin-right: 32px; flex-shrink: 0;
}
.navbar-center { flex: 1; display: flex; gap: 2px; }
.navbar-right { display: flex; align-items: center; gap: 8px; margin-left: 16px; }

.nav-link {
  display: inline-flex; align-items: center;
  padding: 6px 12px; border-radius: var(--radius-sm);
  font-size: .875rem; font-weight: 500; color: var(--text-2);
  transition: background var(--t), color var(--t);
}
.nav-link:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.nav-link.active { color: var(--blue); background: var(--blue-light); }
.nav-admin { color: var(--red); }
.nav-admin:hover { background: var(--red-light); color: var(--red); }
.nav-admin.active { background: var(--red-light); color: var(--red); }
.nav-logout {
  padding: 6px 10px; color: var(--text-3); font-size: 1rem;
  border-radius: var(--radius-sm);
}
.nav-logout:hover { color: var(--text); background: var(--bg); }

.nav-user {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 10px 5px 5px; border-radius: 20px;
  border: 1px solid var(--border); background: var(--card);
  transition: background var(--t), border-color var(--t);
  text-decoration: none;
}
.nav-user:hover { background: var(--bg); border-color: var(--border-2); text-decoration: none; }
.nav-user.active { border-color: var(--blue); }
.nav-avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--blue);
  color: #fff; font-size: .75rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.nav-username { font-size: .8rem; font-weight: 500; color: var(--text-2); }

/* ── Flash messages ─────────────────────────────────────────── */
.flash-container {
  position: fixed; top: calc(var(--nav-h) + 12px); right: 20px;
  z-index: 400; display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.flash {
  padding: 10px 16px; border-radius: var(--radius); font-size: .875rem;
  box-shadow: var(--shadow-md); pointer-events: all;
  max-width: 360px; border: 1px solid transparent;
  animation: flashIn .2s ease;
}
.flash-success { background: var(--green-light); color: var(--green); border-color: #bbf7d0; }
.flash-error   { background: var(--red-light); color: var(--red); border-color: var(--red-border); }
.flash-info    { background: var(--blue-light); color: var(--blue-dark); border-color: #bfdbfe; }
@keyframes flashIn { from { opacity:0; transform:translateX(12px); } to { opacity:1; transform:none; } }

/* ── Layout ─────────────────────────────────────────────────── */
.main-content {
  max-width: 1200px; margin: 0 auto;
  padding: calc(var(--nav-h) + 28px) 24px 56px;
}

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; gap: 16px;
}
.page-header h1 { font-size: 1.35rem; font-weight: 700; letter-spacing: -.02em; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  font-size: .875rem; font-weight: 500; white-space: nowrap;
  transition: background var(--t), border-color var(--t), box-shadow var(--t);
  cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--bg); border-color: var(--border-2); text-decoration: none; box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }
.btn-danger  { background: var(--red); color: #fff; border-color: var(--red); }
.btn-danger:hover { background: #b84b25; border-color: #b84b25; color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); box-shadow: none; }
.btn-ghost:hover { background: var(--bg); border-color: var(--border); color: var(--text); box-shadow: none; }
.btn-sm { height: 30px; padding: 0 12px; font-size: .8125rem; }
.btn-full { width: 100%; }

/* ── Forms ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block; margin-bottom: 6px;
  font-size: .8125rem; font-weight: 600; color: var(--text-2);
}
input[type=text], input[type=email], input[type=password], textarea, select {
  width: 100%; height: 38px; padding: 0 12px;
  border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  font-size: .9rem; color: var(--text); background: var(--card);
  transition: border-color var(--t), box-shadow var(--t);
  font-family: inherit;
}
textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 80px; }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(55,138,221,.15);
}
.form-row-right { display: flex; justify-content: flex-end; margin-top: 8px; }

.alert { padding: 10px 14px; border-radius: var(--radius-sm); font-size: .875rem; margin-bottom: 16px; border: 1px solid transparent; }
.alert-error { background: var(--red-light); color: var(--red); border-color: var(--red-border); }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
  box-shadow: var(--shadow);
}
.card-title {
  font-size: .75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-3); margin-bottom: 20px;
}

/* ── Auth ────────────────────────────────────────────────────── */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-box {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 36px 32px; width: 100%; max-width: 400px; box-shadow: var(--shadow-md);
}
.auth-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 24px; letter-spacing: -.02em; }
.auth-link { margin-top: 18px; text-align: center; font-size: .875rem; color: var(--text-2); }

/* ── View toggle (dashboard) ──────────────────────────────── */
.view-toggle { display: flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.view-btn {
  width: 36px; height: 32px; display: flex; align-items: center; justify-content: center;
  background: var(--card); border: none; color: var(--text-3);
  transition: background var(--t), color var(--t); cursor: pointer;
}
.view-btn:hover { background: var(--bg); color: var(--text-2); }
.view-btn.active { background: var(--blue-light); color: var(--blue); }
.view-btn + .view-btn { border-left: 1px solid var(--border); }

/* ── Dashboard grid ─────────────────────────────────────────── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(295px, 1fr));
  gap: 16px;
}
.project-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px; display: flex; flex-direction: column; gap: 12px;
  box-shadow: var(--shadow); transition: box-shadow var(--t), border-color var(--t), transform var(--t);
  cursor: pointer; text-decoration: none; color: var(--text);
}
.project-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-2); transform: translateY(-1px); text-decoration: none; color: var(--text); }
.project-card.has-problems { border-left: 3px solid var(--red); }
.project-card.all-done { opacity: .8; }

.project-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.project-card-title { font-size: .95rem; font-weight: 700; color: var(--text); line-height: 1.3; }
.project-card-objectives {
  font-size: .82rem; color: var(--text-2); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.project-card-tasks { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.task-chip {
  font-size: .78rem; padding: 3px 8px; border-radius: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.task-chip-problem { background: var(--red-light); color: var(--red); }
.task-chip-progress { background: var(--bg); color: var(--text-2); }
.task-chip-more { color: var(--text-3); font-style: italic; padding-left: 8px; }
.task-chip-ok { color: var(--green); background: var(--green-light); }

.project-card-footer {
  display: flex; align-items: center; gap: 8px;
  padding-top: 10px; border-top: 1px solid var(--border); margin-top: auto;
  font-size: .78rem;
}
.stat-pill { color: var(--text-2); }
.stat-pill-red { color: var(--red); font-weight: 600; }
.card-arrow { margin-left: auto; color: var(--text-3); font-size: .85rem; }

/* ── Dashboard table ─────────────────────────────────────────── */
.table-wrap { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.data-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.data-table thead { background: var(--bg); border-bottom: 1px solid var(--border); }
.data-table th {
  padding: 10px 16px; text-align: left; font-size: .75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: var(--text-3);
  white-space: nowrap;
}
.th-center { text-align: center; }
.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg); }
.data-table .row-problem td:first-child { border-left: 3px solid var(--red); padding-left: 13px; }
.data-table .row-ok { opacity: .7; }
.td-name { max-width: 200px; }
.td-objectives { max-width: 300px; color: var(--text-2); }
.td-center { text-align: center; }
.td-action { text-align: right; white-space: nowrap; }

/* ── Project list ────────────────────────────────────────────── */
.project-list { display: flex; flex-direction: column; gap: 8px; }
.project-list-item {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 18px; display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow-sm); transition: box-shadow var(--t);
}
.project-list-item:hover { box-shadow: var(--shadow); }
.project-list-item.project-archived { opacity: .6; }
.project-list-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.project-list-name { font-weight: 600; font-size: .9rem; color: var(--text); }
.project-list-objectives { font-size: .8rem; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-list-badges { display: flex; gap: 6px; flex-shrink: 0; }
.archives-link { margin-top: 20px; text-align: right; font-size: .8125rem; }

/* ── Badges ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 2px 9px; border-radius: 99px; font-size: .72rem; font-weight: 700;
  white-space: nowrap; letter-spacing: .01em;
}
.badge-problem { background: var(--red); color: #fff; }
.badge-gray    { background: #f1f3f5; color: var(--text-2); border: 1px solid var(--border); }
.badge-ok      { background: var(--green-light); color: var(--green); border: 1px solid #bbf7d0; }
.badge-admin   { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.badge-user    { background: var(--blue-light); color: var(--blue-dark); border: 1px solid #bfdbfe; }
.badge-owner   { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.badge-write   { background: var(--blue-light); color: var(--blue-dark); border: 1px solid #bfdbfe; }
.badge-read    { background: #f1f3f5; color: var(--text-2); border: 1px solid var(--border); }

/* ── Project page header ─────────────────────────────────────── */
.project-header { margin-bottom: 24px; }
.project-header-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 10px; }

.project-title { font-size: 1.5rem; font-weight: 800; line-height: 1.2; letter-spacing: -.02em; }
.project-title[data-editable] { cursor: text; border-radius: var(--radius-sm); padding: 2px 6px; margin: -2px -6px; }
.project-title[data-editable]:hover { background: var(--blue-light); }

.project-objectives {
  font-size: .9rem; color: var(--text-2); line-height: 1.65; white-space: pre-wrap;
  min-height: 26px; padding: 4px 0; border-radius: var(--radius-sm);
}
.project-objectives[data-editable] { cursor: text; padding: 4px 8px; margin: 0 -8px; }
.project-objectives[data-editable]:hover { background: var(--blue-light); }
.placeholder { color: var(--text-3); font-style: italic; }

/* ── Task columns ────────────────────────────────────────────── */
.task-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
@media (max-width: 720px) { .task-columns { grid-template-columns: 1fr; } }

.task-col {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px; box-shadow: var(--shadow);
}
.task-col-problems { border-top: 3px solid var(--red); }

.col-title {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-3); margin-bottom: 14px;
}
.col-title-problems { color: var(--red); }

/* ── Task items ──────────────────────────────────────────────── */
.task-list { display: flex; flex-direction: column; gap: 1px; margin-bottom: 12px; }

.task-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 8px; border-radius: var(--radius);
  cursor: default; transition: background var(--t);
}
.task-item:hover { background: var(--bg); }
.task-item.task-done .task-title-text { text-decoration: line-through; color: var(--text-3); }

.task-item.task-problem:not(.task-done) {
  background: var(--red-light);
  border: 1px solid var(--red-border); border-radius: var(--radius);
}
.task-item.task-problem:not(.task-done):hover { background: #fae7e0; }

.task-title-text {
  flex: 1; font-size: .875rem; cursor: pointer; line-height: 1.45;
  display: flex; align-items: baseline; gap: 6px;
}
.task-title-text:hover { color: var(--blue); }
.task-item.task-done .task-title-text:hover { color: var(--text-3); }

.problem-icon { font-size: .8em; flex-shrink: 0; }
.file-indicator { font-size: .75em; opacity: .6; }

/* ── Custom checkbox ─────────────────────────────────────────── */
.checkbox-wrap {
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; cursor: pointer; padding: 2px;
}
.checkbox-wrap input[type=checkbox] { display: none; }
.checkmark {
  width: 20px; height: 20px; border: 2px solid var(--border-2);
  border-radius: 5px; background: var(--card); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--t);
}
.checkbox-wrap:hover .checkmark { border-color: var(--blue); background: var(--blue-light); }
.checkmark::after {
  content: ''; display: none; width: 5px; height: 9px;
  border: 2px solid #fff; border-top: none; border-left: none;
  transform: rotate(45deg) translate(0, -1px);
}
.checkbox-wrap input:checked ~ .checkmark { background: var(--blue); border-color: var(--blue); }
.checkbox-wrap input:checked ~ .checkmark::after { display: block; }

.checkmark-problem { border-color: var(--red); }
.checkbox-wrap:hover .checkmark-problem { border-color: var(--red); background: var(--red-light); }
.checkbox-wrap input:checked ~ .checkmark-problem { background: var(--red); border-color: var(--red); }
.checkbox-wrap.readonly { font-size: .9rem; cursor: default; }

/* ── Inline add task ──────────────────────────────────────────── */
.btn-add-task {
  display: flex; align-items: center; gap: 6px;
  width: 100%; padding: 8px 8px; border: none; background: none;
  color: var(--blue); font-size: .8125rem; font-weight: 500; cursor: pointer;
  border-radius: var(--radius); text-align: left;
  border: 1px dashed transparent;
  transition: background var(--t), border-color var(--t);
}
.btn-add-task:hover { background: var(--blue-light); border-color: #bfdbfe; }
.btn-add-problem { color: var(--red); }
.btn-add-problem:hover { background: var(--red-light); border-color: var(--red-border); }

.inline-add { display: flex; gap: 8px; align-items: center; padding: 6px 0; flex-wrap: wrap; }
.inline-input {
  flex: 1; height: 34px; padding: 0 10px; border: 1px solid var(--blue);
  border-radius: var(--radius-sm); font-size: .875rem; min-width: 160px;
  font-family: inherit;
}
.inline-input:focus { outline: none; box-shadow: 0 0 0 3px rgba(55,138,221,.15); }

/* ── Project sections ────────────────────────────────────────── */
.project-section {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.section-title {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-3); margin-bottom: 14px;
}
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }

/* ── File list ───────────────────────────────────────────────── */
.file-list { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; min-height: 20px; }
.file-item {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 6px 10px; transition: border-color var(--t);
}
.file-item:hover { border-color: var(--border-2); }
.file-thumb { width: 58px; height: 58px; object-fit: cover; border-radius: var(--radius-sm); cursor: zoom-in; }
.file-name { font-size: .78rem; color: var(--text-2); max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-doc-link { font-size: .85rem; color: var(--blue); display: flex; align-items: center; gap: 6px; }
.btn-file-delete {
  background: none; border: none; color: var(--text-3); cursor: pointer;
  font-size: 1rem; line-height: 1; padding: 0 2px; transition: color var(--t);
}
.btn-file-delete:hover { color: var(--red); }
.file-empty { font-size: .82rem; color: var(--text-3); font-style: italic; padding: 2px 0; }
.file-upload-zone { display: flex; align-items: center; gap: 12px; }
.upload-hint { font-size: .75rem; color: var(--text-3); }

/* ── Share ───────────────────────────────────────────────────── */
.share-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.share-item {
  display: flex; align-items: center; gap: 10px; font-size: .875rem;
  padding: 8px 10px; background: var(--bg); border-radius: var(--radius); border: 1px solid var(--border);
}
.share-target { flex: 1; font-weight: 500; }
.share-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.share-form select { flex: 1; min-width: 110px; height: 34px; width: auto; font-size: .85rem; }

/* ── Modal ───────────────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 300;
  background: rgba(15,23,42,.5); align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--card); border-radius: var(--radius-lg); width: 100%;
  max-width: 540px; max-height: 92vh; overflow-y: auto;
  box-shadow: var(--shadow-lg); animation: modalIn .18s ease;
  border: 1px solid var(--border);
}
.modal-large { max-width: 660px; }
@keyframes modalIn { from { opacity:0; transform:scale(.97) translateY(8px); } to { opacity:1; transform:none; } }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--card); z-index: 1;
}
.modal-header h2 { font-size: 1rem; font-weight: 700; }
.modal-close {
  width: 30px; height: 30px; border-radius: 50%; background: none; border: none;
  font-size: 1.3rem; color: var(--text-3); display: flex; align-items: center; justify-content: center;
  transition: background var(--t), color var(--t); line-height: 1;
}
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-body { padding: 20px 22px; display: flex; flex-direction: column; gap: 18px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 22px; border-top: 1px solid var(--border);
  position: sticky; bottom: 0; background: var(--card);
}

/* ── Task modal ──────────────────────────────────────────────── */
.task-status-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 44px; border-radius: var(--radius);
  border: 2px dashed var(--border-2); background: var(--bg);
  font-size: .9rem; font-weight: 600; color: var(--text-2);
  cursor: pointer; transition: all var(--t);
}
.task-status-btn:hover { border-color: var(--blue); background: var(--blue-light); color: var(--blue); }
.task-status-todo:hover { border-color: var(--blue); }
.task-status-done {
  background: var(--green-light); border-color: #bbf7d0; color: var(--green); border-style: solid;
}
.task-status-done:hover { background: #dcfce7; border-color: #86efac; color: var(--green); }
.task-status-problem-done {
  background: var(--green-light); border-color: #bbf7d0; color: var(--green); border-style: solid;
}

.task-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.task-meta-date { font-size: .78rem; color: var(--text-3); margin-left: auto; }
.field-label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); margin-bottom: 6px; }
.task-title-edit { font-size: 1rem; font-weight: 700; width: 100%; }
.task-type-select { height: 30px; padding: 0 10px; font-size: .82rem; border-radius: var(--radius-sm); width: auto; border: 1px solid var(--border-2); }
.task-modal-files { display: flex; flex-wrap: wrap; gap: 10px; }
.task-modal-file {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 6px 10px;
}
.task-modal-thumb { width: 54px; height: 54px; object-fit: cover; border-radius: var(--radius-sm); cursor: zoom-in; }
.modal-upload-zone { display: flex; align-items: center; gap: 12px; }
.modal-actions { display: flex; justify-content: space-between; align-items: center; padding-top: 6px; }
.loading { text-align: center; color: var(--text-3); padding: 32px; font-size: .9rem; }

/* ── Lightbox ────────────────────────────────────────────────── */
.lightbox {
  display: none; position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.9); align-items: center; justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 94vw; max-height: 90vh; object-fit: contain; border-radius: var(--radius); }
.lightbox-close {
  position: absolute; top: 16px; right: 20px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2);
  border-radius: 50%; width: 36px; height: 36px;
  color: #fff; font-size: 1.3rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background var(--t);
}
.lightbox-close:hover { background: rgba(255,255,255,.2); }

/* ── Admin ───────────────────────────────────────────────────── */
.admin-section {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 24px; margin-bottom: 20px; box-shadow: var(--shadow);
}
.admin-section > h2 { font-size: .9rem; font-weight: 700; margin-bottom: 18px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.admin-table th {
  text-align: left; padding: 9px 12px; border-bottom: 2px solid var(--border);
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-3); white-space: nowrap;
}
.admin-table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background: var(--bg); }
.row-disabled { opacity: .5; }
.admin-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.team-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin-bottom: 10px;
}
.team-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.team-header strong { flex: 1; font-size: .9rem; }
.team-members { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; min-height: 26px; }
.team-member {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--card); border: 1px solid var(--border); border-radius: 99px;
  padding: 3px 10px 3px 12px; font-size: .8rem;
}
.btn-remove-member {
  background: none; border: none; color: var(--text-3); cursor: pointer;
  font-size: .9rem; padding: 0; line-height: 1; transition: color var(--t);
}
.btn-remove-member:hover { color: var(--red); }
.team-add-member { display: flex; gap: 8px; align-items: center; }

/* ── Account page ────────────────────────────────────────────── */
.account-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
  align-items: start;
}
@media (max-width: 700px) { .account-grid { grid-template-columns: 1fr; } }
.account-avatar {
  width: 56px; height: 56px; border-radius: 50%; background: var(--blue);
  color: #fff; font-size: 1.3rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
}
.card-meta { grid-column: 1 / -1; }
.meta-list { display: flex; flex-direction: column; gap: 12px; }
.meta-list dt { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin-bottom: 4px; }
.meta-list dd { display: flex; }

/* ── Misc ────────────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 60px 24px; color: var(--text-2);
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.empty-icon { font-size: 2.5rem; margin-bottom: 12px; }
.empty-state p { margin-bottom: 20px; font-size: .95rem; }
.text-muted { color: var(--text-3); }
.select-sm { height: 32px; padding: 0 8px; font-size: .82rem; width: auto; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 600px) {
  .navbar { padding: 0 14px; }
  .navbar-center { display: none; }
  .main-content { padding-left: 14px; padding-right: 14px; }
  .project-grid { grid-template-columns: 1fr; }
  .share-form { flex-direction: column; }
  .admin-actions { flex-direction: column; }
  .admin-table { font-size: .78rem; }
  .admin-table td, .admin-table th { padding: 8px; }
  .modal { border-radius: var(--radius); }
  .modal-body { padding: 16px; }
}
