/* ==========================================================
   Board - main stylesheet
   Plain CSS, no framework. Organized by section, edit freely.
   ========================================================== */

/* ---------- Reset / base ---------- */

* { box-sizing: border-box; }

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    color: #2b2f36;
    background: #f4f5f7;
}

a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0 0 12px; font-weight: 600; }

.muted { color: #7d7d7d; }
.error { color: #b91c1c; background: #fee2e2; padding: 8px 12px; border-radius: 6px; }
.success { color: #166534; background: #dcfce7; padding: 8px 12px; border-radius: 6px; }

:root {
  --accent-a: #000;
}

/* ---------- App layout ---------- */

.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 210px;
    flex-shrink: 0;
    background: #1f2430;
    color: #cfd3dc;
    display: flex;
    flex-direction: column;
    padding: 16px 0;
}

.sidebar-logo {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    padding: 0 20px 16px;
}

.sidebar-scroll {
    flex: 1;
    overflow-y: auto;
}

.sidebar-nav, .sidebar-recent {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-nav li a, .sidebar-recent li a {
    display: block;
    padding: 10px 20px;
    color: #cfd3dc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-nav li a:hover, .sidebar-recent li a:hover {
    background: #2a3140;
    text-decoration: none;
}

.sidebar-nav li.active a, .sidebar-recent li.active a {
    background: #2563eb;
    color: #fff;
}

.sidebar-section-label {
    font-size: 11px;
    text-transform: uppercase;
    color: #6b7280;
    padding: 16px 20px 4px;
}

.sidebar-recent li a { padding: 6px 20px; font-size: 13px; }

.sidebar-footer {
    padding: 10px 20px;
    border-top: 1px solid #333a4a;
    margin-top: 12px;
}

.sidebar-footer a { color: #9aa2b1; }

.main {
    flex: 1;
    padding: 24px 32px;
    min-width: 0;
    overflow-x: auto;
}

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

.breadcrumb { margin-bottom: 8px; font-size: 13px; }

/* ---------- Login page ---------- */

.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #1f2430;
}

.login-box {
    background: #fff;
    padding: 32px;
    border-radius: 10px;
    width: 300px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,.3);
}

.login-box h1 { text-align: center; }

/* ---------- Forms & buttons ---------- */

label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: #444;
}

input[type="text"], input[type="password"], input[type="email"],
input[type="date"], input[type="number"], textarea, select {
    font-family: inherit;
    font-size: 14px;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    width: 100%;
}

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

button, .btn {
    font-family: inherit;
    font-size: 14px;
    padding: 8px 14px;
    border-radius: 6px;
    border: 1px solid transparent;
    background: #2563eb;
    color: #fff;
    cursor: pointer;
}

button:hover, .btn:hover { background: #1d4ed8; }

button.secondary, .btn.secondary {
    background: #fff;
    border-color: #d1d5db;
    color: #2b2f36;
}

button.secondary:hover, .btn.secondary:hover { background: #f3f4f6; }

button.danger, .btn.danger { background: #dc2626; }
button.danger:hover { background: #b91c1c; }

button.small, .btn.small { padding: 4px 7px; font-size: 12px; }

.form-row { display: flex; gap: 12px; }
.form-row > * { flex: 1; }

.inline-form { display: flex; gap: 8px; align-items: flex-end; }

/* ---------- Cards grid (clients / boards listing) ---------- */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.tile {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    display: block;
    color: inherit;
}

.tile:hover { border-color: #2563eb; text-decoration: none; }

.tile h3 { margin-bottom: 4px; }

/* ---------- Data tables (clients list, table view of cards) ---------- */

table.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

table.data-table th, table.data-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #eef0f2;
}

table.data-table th {
    background: #f9fafb;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    color: #6b7280;
}

table.data-table th a { color: #6b7280; }

table.data-table tr:last-child td { border-bottom: none; }
table.data-table tr:hover { background: #f9fafb; }
table.data-table td.overdue { color: #b91c1c; font-weight: 600; }

/* ---------- Kanban board ---------- */

.board-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.view-toggle a {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid #d1d5db;
    color: #2b2f36;
}

.view-toggle a:first-child { border-radius: 6px 0 0 6px; }
.view-toggle a:last-child { border-radius: 0 6px 6px 0; border-left: none; }
.view-toggle a.active { background: #2563eb; color: #fff; border-color: #2563eb; }

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

.list-column {
    background: #ebecf0;
    border-radius: 8px;
    width: 270px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 160px);
}

.list-column.drag-over { outline: 2px dashed #2563eb; outline-offset: -2px;}

.list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    font-weight: 600;
    gap: 6px;
}

.list-header input.list-name-input {
    border: none;
    background: transparent;
    font-weight: 600;
    font-size: 14px;
    padding: 4px;
    width: 100%;
}

.list-flags { font-size: 11px; color: #6b7280; padding: 0 12px 6px; }
.list-flags span { margin-right: 8px; }

.list-menu { position: relative; flex-shrink: 0; }

.list-menu-btn {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 15px;
    padding: 2px 6px;
    line-height: 1;
}

.list-menu-btn:hover { background: rgba(0,0,0,.08); border-radius: 4px; }

.list-menu-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
    min-width: 170px;
    z-index: 10;
    padding: 4px 0;
}

.list-menu-dropdown a {
    display: block;
    padding: 8px 12px;
    font-size: 13px;
    color: #2b2f36;
    white-space: nowrap;
}

.list-menu-dropdown a:hover { background: #f3f4f6; text-decoration: none; }
.list-menu-dropdown a.danger-link { color: #dc2626; }

.list-cards {
    flex: 1;
    overflow-y: auto;
    padding: 0 8px;
    min-height: 20px;
}

.list-add-card {
    padding: 8px 12px;
}

.card {
    background: #fff;
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,.15);
    cursor: grab;
    border-left: 4px solid transparent;
}

.card:active { cursor: grabbing; }
.card.dragging { opacity: 0.4; }
.card.done { border-left-color: #16a34a; }
.card.overdue { border-left-color: #dc2626; }
.card.from-client { border-left-color: #f59e0b; }

.card-title { font-size: 14px; margin-bottom: 6px; }

.card-progress-preview {
    font-size: 12px;
    color: #6b7280;
    margin: -2px 0 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-labels { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }

.label-chip {
    display: inline-block;
    font-size: 11px;
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #6b7280;
}

.card-meta .due.overdue { color: #dc2626; font-weight: 600; }

.card-score {
    color: #f59e0b;
    font-weight: 600;
}

/* ---------- Modal (card detail) ---------- */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 16px;
    overflow-y: auto;
    z-index: 100;
}

.modal-backdrop.hidden { display: none; }

.modal {
    background: #fff;
    border-radius: 10px;
    width: 100%;
    max-width: 560px;
    padding: 24px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.modal-close {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 20px;
    padding: 0 4px;
}

.modal-close:hover { background: none; color: #2b2f36; }

.modal section { margin-bottom: 18px; }
.modal section h4 { margin: 0 0 8px; font-size: 14px; color: #6b7280; }

/* Checklist */

.checklist-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.checklist-item.checked span { text-decoration: line-through; color: #9ca3af; }

.checklist-progress {
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    margin-bottom: 8px;
    overflow: hidden;
}

.checklist-progress-bar {
    height: 100%;
    background: #16a34a;
}

/* Label picker */

.label-picker { display: flex; flex-wrap: wrap; gap: 6px; }

.label-option {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 12px;
    cursor: pointer;
    border: 2px solid transparent;
}

.label-option.selected { border-color: #2b2f36; }

/* ---------- Overview dashboard ---------- */

.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.widget {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 18px;
    margin-bottom: 20px;
}

.due-list { list-style: none; margin: 0; padding: 0; }
.due-list li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f1f2f4;
}
.due-list li:last-child { border-bottom: none; }

.score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
    font-size: 22px;
    font-weight: 700;
}

.level-bar {
    height: 10px;
    background: #e5e7eb;
    border-radius: 5px;
    overflow: hidden;
    margin: 8px 0;
}

.level-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #7c3aed);
}

.notes-list { list-style: none; margin: 0; padding: 0; }
.notes-list li {
    padding: 10px 0;
    border-bottom: 1px solid #f1f2f4;
    display: flex;
    justify-content: space-between;
    gap: 8px;
}
.notes-list li:last-child { border-bottom: none; }

/* ---------- Notes (Keep-style grid on notes.php) ---------- */

.note-composer {
    max-width: 560px;
    margin: 0 auto 28px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

.note-composer-placeholder {
    border: none;
    width: 100%;
    font-size: 14px;
    padding: 4px 0;
    background: transparent;
}

.note-composer.expanded .note-composer-placeholder { display: none; }

.note-composer-fields { display: none; }
.note-composer.expanded .note-composer-fields { display: block; }

.note-composer-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.notes-section-label {
    font-size: 12px;
    text-transform: uppercase;
    color: #6b7280;
    font-weight: 600;
    margin: 24px 0 10px;
}

.notes-grid {
    column-width: 240px;
    column-gap: 16px;
}

.note-card {
    display: inline-block;
    width: 100%;
    break-inside: avoid;
    margin-bottom: 16px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    padding: 12px 14px;
    vertical-align: top;
}

.note-title-input {
    border: none;
    background: transparent;
    font-weight: 600;
    font-size: 15px;
    width: 100%;
    padding: 0 0 6px;
}

.note-content-input {
    border: none;
    background: transparent;
    width: 100%;
    resize: vertical;
    min-height: 50px;
    font-family: inherit;
    font-size: 14px;
    padding: 0;
}

.note-checklist { margin-bottom: 4px; }
.note-checklist .checklist-item { padding: 2px 0; }

.note-new-item-input {
    border: none;
    background: transparent;
    width: 100%;
    font-size: 13px;
    padding: 4px 0;
    color: #6b7280;
}

.note-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-top: 8px;
    opacity: 0;
    transition: opacity .15s;
}

.note-card:hover .note-toolbar,
.note-card:focus-within .note-toolbar,
.note-toolbar.force-visible { opacity: 1; }

.note-toolbar button:not(.note-color-swatch) {
    background: none;
    border: none;
    padding: 5px 7px;
    font-size: 14px;
    border-radius: 4px;
    color: #6b7280;
    cursor: pointer;
}

.note-toolbar button:not(.note-color-swatch):hover { background: rgba(0,0,0,.06); }
.note-toolbar button.active { color: #2563eb; }

.note-color-picker { position: relative; }

.note-color-options {
    position: absolute;
    bottom: 100%;
    left: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 6px;
    display: flex;
    gap: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
    z-index: 10;
}

.note-color-swatch {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,.15);
    cursor: pointer;
    padding: 0;
}

.note-color-swatch.selected { outline: 2px solid #2563eb; outline-offset: 1px; }

.note-color-default { background: #fff; }
.note-color-red { background: #fbd8d8; }
.note-color-orange { background: #fde3ca; }
.note-color-yellow { background: #fbf1b0; }
.note-color-green { background: #d4f3d0; }
.note-color-teal { background: #c8f0e8; }
.note-color-blue { background: #cfe8fb; }
.note-color-purple { background: #e3d6f7; }
.note-color-pink { background: #fbd9ec; }
.note-color-gray { background: #e8eaed; }

/* ---------- Share page (public) ---------- */

.share-header {
    background: #1f2430;
    color: #fff;
    padding: 24px 32px;
}

.share-body { padding: 24px 32px 80px; }

.share-bottom-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #1f2430;
    padding: 14px 32px;
    text-align: center;
}

.share-bottom-bar a {
    color: #fff;
    font-weight: 600;
}

.share-body .list-column {
	max-height: unset;
}

/* ---------- Utility ---------- */

.flex { display: flex; }
.gap-8 { gap: 8px; }
.mt-16 { margin-top: 16px; }
.text-right { text-align: right; }
.hidden { display: none !important; }
.icon-a { height: 14px; fill: var(--accent-a); opacity: 0.7; }
.icon-b { height: 12px; fill: currentColor; transform: translateY(1px); margin-right: 4px; }
