/* ===== Layout ===== */
.main-nav {
    background: var(--pico-card-background-color);
    border-bottom: 1px solid var(--pico-muted-border-color);
    padding: 0.5rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.main-nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0;
    padding: 0;
}

.main-nav a {
    text-decoration: none;
}

.user-badge {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}

/* ===== Login ===== */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.login-card {
    width: 100%;
    max-width: 420px;
}

/* ===== Flash Messages ===== */
.flash-message {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flash-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.flash-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.flash-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.flash-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

.close-flash {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    margin: 0;
    line-height: 1;
    color: inherit;
}

/* ===== Board ===== */
.board-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0 0.5rem;
}

.board-filters {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.board-filters select {
    margin: 0;
    padding: 0.4rem 0.6rem;
    min-width: 160px;
}

.board-filters .btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.user-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    font-size: 0.85rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.board-columns {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    min-height: 70vh;
    overflow-x: auto;
    padding-bottom: 1rem;
}

.column {
    flex: 1;
    min-width: 300px;
    max-width: 400px;
    background: var(--pico-card-background-color);
    border-radius: 8px;
    border: 1px solid var(--pico-muted-border-color);
    display: flex;
    flex-direction: column;
}

.column-header {
    padding: 0.75rem 1rem;
    font-weight: 700;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--pico-muted-border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--pico-card-sectioning-background-color);
    border-radius: 8px 8px 0 0;
}

.column-header .count {
    background: var(--pico-muted-border-color);
    border-radius: 10px;
    padding: 0.1rem 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.column-body {
    padding: 0.5rem;
    min-height: 100px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* ===== Cards ===== */
.job-card {
    background: #fff;
    border-radius: 6px;
    border: 1px solid var(--pico-muted-border-color);
    border-left: 4px solid #d1d5db;
    padding: 0.75rem;
    cursor: pointer;
    transition: box-shadow 0.15s;
    position: relative;
}

.job-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.job-card.sortable-ghost {
    opacity: 0.4;
}

.job-card.sortable-chosen {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.job-card .card-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
    color: var(--pico-color);
}

.job-card .card-meta {
    font-size: 0.78rem;
    color: var(--pico-muted-color);
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.8rem;
    align-items: center;
}

.drag-handle {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    cursor: grab;
    color: var(--pico-muted-color);
    font-size: 0.9rem;
    padding: 2px 4px;
    border-radius: 3px;
    user-select: none;
}

.drag-handle:hover {
    background: var(--pico-muted-border-color);
}

/* Classification badges */
.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}

.badge-critical { background: #DC2626; }
.badge-time_sensitive { background: #F97316; }
.badge-improvement { background: #3B82F6; }
.badge-suggestion { background: #6B7280; }

.badge-status {
    color: #fff;
    font-size: 0.72rem;
}

.badge-open { background: #10B981; }
.badge-in_progress { background: #3B82F6; }
.badge-review { background: #F59E0B; }
.badge-closed { background: #6B7280; }

/* Hours missing warning */
.hours-warning {
    border: 2px dashed #F59E0B !important;
    position: relative;
}

.hours-warning::after {
    content: "\26A0 Hours missing";
    position: absolute;
    top: 0.3rem;
    right: 0.3rem;
    font-size: 0.7rem;
    color: #D97706;
    font-weight: 600;
    background: #FEF3C7;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem;
    overflow-y: auto;
}

.modal-content {
    background: #fff;
    border-radius: 8px;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--pico-muted-border-color);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.3rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--pico-muted-color);
    padding: 0;
    line-height: 1;
}

.modal-body {
    padding: 1.5rem;
}

.modal-section {
    margin-bottom: 1.5rem;
}

.modal-section h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--pico-muted-border-color);
}

.modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    font-size: 0.88rem;
    margin-bottom: 1rem;
}

.modal-meta dt {
    font-weight: 600;
    color: var(--pico-muted-color);
    font-size: 0.78rem;
    text-transform: uppercase;
    margin-bottom: 0.1rem;
}

.modal-meta dd {
    margin: 0 0 0.5rem 0;
}

/* Admin controls in modal */
.admin-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.admin-controls label {
    margin-bottom: 0;
    font-size: 0.85rem;
}

.admin-controls select,
.admin-controls input {
    margin-bottom: 0;
    padding: 0.35rem 0.5rem;
    font-size: 0.85rem;
}

/* Description */
.job-description {
    white-space: pre-wrap;
    line-height: 1.6;
    font-size: 0.92rem;
}

/* ===== Notes ===== */
.notes-thread {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.note-item {
    display: flex;
    gap: 0.6rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--pico-muted-border-color);
}

.note-item:last-child {
    border-bottom: none;
}

.note-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
}

.note-body {
    flex: 1;
}

.note-header {
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
    margin-bottom: 0.2rem;
}

.note-author {
    font-weight: 600;
    font-size: 0.85rem;
}

.note-time {
    font-size: 0.75rem;
    color: var(--pico-muted-color);
}

.note-content {
    font-size: 0.88rem;
    white-space: pre-wrap;
}

.note-form textarea {
    min-height: 80px;
}

/* ===== Activity Log ===== */
.activity-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--pico-muted-color);
    padding: 0.5rem 0;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.activity-toggle .arrow {
    transition: transform 0.2s;
    font-size: 0.7rem;
}

.activity-toggle.open .arrow {
    transform: rotate(90deg);
}

.activity-list {
    font-size: 0.82rem;
}

.activity-item {
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--pico-muted-border-color);
    color: var(--pico-muted-color);
}

.activity-item:last-child {
    border-bottom: none;
}

/* ===== Attachments ===== */
.attachment-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.attachment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: #f8fafc;
    border-radius: 4px;
    font-size: 0.85rem;
}

.attachment-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.attachment-actions {
    display: flex;
    gap: 0.5rem;
}

.attachment-actions a,
.attachment-actions button {
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
}

.upload-zone {
    border: 2px dashed var(--pico-muted-border-color);
    border-radius: 6px;
    padding: 1.5rem;
    text-align: center;
    color: var(--pico-muted-color);
    transition: border-color 0.2s;
    margin-top: 0.5rem;
}

.upload-zone.dragover {
    border-color: #3B82F6;
    background: #eff6ff;
}

/* ===== Admin ===== */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.admin-table {
    width: 100%;
    font-size: 0.9rem;
}

.color-dot {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    vertical-align: middle;
}

.color-picker-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
    max-width: 240px;
}

.color-option {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s;
}

.color-option:hover,
.color-option.selected {
    border-color: #1e293b;
    transform: scale(1.15);
}

/* ===== Buttons ===== */
.btn-sm {
    padding: 0.3rem 0.7rem;
    font-size: 0.82rem;
}

.btn-danger {
    background: #DC2626;
    border-color: #DC2626;
    color: #fff;
}

.btn-danger:hover {
    background: #B91C1C;
    border-color: #B91C1C;
}

/* ===== Create Job Form ===== */
.create-job-form .helper-text {
    font-size: 0.8rem;
    color: var(--pico-muted-color);
    margin-top: -0.5rem;
    margin-bottom: 0.5rem;
    font-style: italic;
}

/* ===== Utilities ===== */
.text-muted { color: var(--pico-muted-color); }
.text-sm { font-size: 0.85rem; }
.mt-1 { margin-top: 0.5rem; }
.mb-0 { margin-bottom: 0; }

/* Sortable placeholder */
.sortable-placeholder {
    background: #f1f5f9;
    border: 2px dashed #cbd5e1;
    border-radius: 6px;
    min-height: 60px;
    margin-bottom: 0.5rem;
}
