/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg:           #0d0f17;
    --surface:      #141721;
    --surface-2:    #1c2030;
    --surface-3:    #242840;
    --border:       #2a2f45;
    --border-light: #353b55;
    --text:         #e2e8f0;
    --text-muted:   #8892aa;
    --text-dim:     #5a6280;

    --todo:    #6366f1;
    --doing:   #f59e0b;
    --done:    #22c55e;
    --verified:#f6c90e;

    --todo-bg:     rgba(99, 102, 241, 0.08);
    --doing-bg:    rgba(245, 158, 11,  0.08);
    --done-bg:     rgba(34,  197, 94,  0.08);
    --verified-bg: rgba(246, 201, 14,  0.08);

    --danger:  #ef4444;
    --primary: #6366f1;

    --radius:    10px;
    --radius-sm: 6px;
    --shadow:    0 4px 20px rgba(0,0,0,.4);
    --shadow-sm: 0 2px 8px  rgba(0,0,0,.3);

    --transition: 150ms ease;
}

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

code {
    background: var(--surface-3);
    border-radius: 4px;
    padding: 1px 5px;
    font-family: 'Cascadia Code', 'Fira Code', monospace;
    font-size: 0.85em;
    color: var(--todo);
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(99,102,241,.15) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(246,201,14,.08) 0%, transparent 50%),
        var(--bg);
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow), 0 0 60px rgba(99,102,241,.1);
}

.login-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
}

.login-brand {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text);
    margin-bottom: 6px;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 28px;
}

.login-error {
    background: rgba(239,68,68,.12);
    border: 1px solid rgba(239,68,68,.3);
    border-radius: var(--radius-sm);
    color: #fca5a5;
    padding: 10px 14px;
    font-size: 0.875rem;
    margin-bottom: 20px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.form-group input {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.95rem;
    padding: 11px 14px;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input::placeholder {
    color: var(--text-dim);
}

.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,.2);
}

.login-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 12px;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    margin-top: 4px;
}

.login-btn:hover {
    background: #4f51e0;
    box-shadow: 0 4px 16px rgba(99,102,241,.4);
    transform: translateY(-1px);
}

.login-btn:active {
    transform: translateY(0);
}

.login-hint {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 0.8rem;
}

/* ============================================================
   APP HEADER
   ============================================================ */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 60px;
    background: rgba(13,15,23,.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo {
    flex-shrink: 0;
}

.header-brand {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.boss-badge {
    background: linear-gradient(135deg, #f6c90e, #f59e0b);
    color: #0d0f17;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 20px;
    box-shadow: 0 0 14px rgba(246,201,14,.4);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-details {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.logout-btn {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    padding: 6px 14px;
    text-decoration: none;
    transition: all var(--transition);
}

.logout-btn:hover {
    border-color: var(--border-light);
    color: var(--text);
    background: var(--surface-3);
}

/* ============================================================
   STATS BAR
   ============================================================ */
.stats-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 28px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    color: var(--text);
    transition: color var(--transition);
}

.stat-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
}

.stat-todo    { color: var(--todo); }
.stat-doing   { color: var(--doing); }
.stat-done    { color: var(--done); }
.stat-percent { color: var(--verified); }

.stat-divider {
    width: 1px;
    height: 32px;
    background: var(--border);
}

/* ============================================================
   BOARD
   ============================================================ */
.board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 20px 20px 40px;
    min-height: calc(100vh - 60px - 73px);
    align-items: start;
}

@media (max-width: 1100px) {
    .board { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .board { grid-template-columns: 1fr; }
}

/* ============================================================
   COLUMN
   ============================================================ */
.column {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    min-height: 200px;
    transition: border-color var(--transition);
    position: relative;
}

.column.drag-over {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary), 0 0 20px rgba(99,102,241,.15);
}

.column-verified {
    border-color: rgba(246,201,14,.2);
}

.column-verified.drag-over {
    border-color: var(--verified);
    box-shadow: 0 0 0 1px var(--verified), 0 0 24px rgba(246,201,14,.2);
}

/* Column header */
.column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
}

.column-header-todo     { background: var(--todo-bg); }
.column-header-doing    { background: var(--doing-bg); }
.column-header-done     { background: var(--done-bg); }
.column-header-verified { background: var(--verified-bg); }

.column-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.column-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot-todo     { background: var(--todo); box-shadow: 0 0 6px var(--todo); }
.dot-doing    { background: var(--doing); box-shadow: 0 0 6px var(--doing); }
.dot-done     { background: var(--done); box-shadow: 0 0 6px var(--done); }
.dot-verified { background: var(--verified); box-shadow: 0 0 8px var(--verified); }

.column-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text);
}

.verified-crown {
    font-size: 0.9rem;
    color: var(--verified);
    filter: drop-shadow(0 0 4px var(--verified));
}

.column-count {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    background: var(--surface-3);
    color: var(--text-muted);
    min-width: 24px;
    text-align: center;
}

/* ============================================================
   CARDS CONTAINER
   ============================================================ */
.cards-container {
    flex: 1;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 60px;
}

/* Drop placeholder shown while dragging over */
.drop-placeholder {
    height: 66px;
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    opacity: 0.5;
    pointer-events: none;
    transition: opacity var(--transition);
    flex-shrink: 0;
}

.column.drag-over .drop-placeholder {
    border-color: var(--primary);
    opacity: 1;
}

.column-verified.drag-over .drop-placeholder {
    border-color: var(--verified);
}

/* ============================================================
   TASK CARD
   ============================================================ */
.card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    cursor: grab;
    position: relative;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition), opacity var(--transition);
    user-select: none;
}

.card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.card:active {
    cursor: grabbing;
}

.card.dragging {
    opacity: 0.3;
    transform: scale(0.97);
}

/* Verified column cards get gold accent */
.card.card-verified {
    border-left: 3px solid var(--verified);
    background: rgba(246,201,14,.05);
    box-shadow: 0 0 12px rgba(246,201,14,.08);
}

.card.card-verified:hover {
    box-shadow: 0 2px 12px rgba(246,201,14,.2);
    border-color: rgba(246,201,14,.4);
}

.card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.card-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    line-height: 1.4;
    word-break: break-word;
    flex: 1;
    outline: none;
}

.card-name.editing {
    background: var(--surface-3);
    border-radius: 4px;
    padding: 2px 6px;
    border: 1px solid var(--primary);
    box-shadow: 0 0 0 2px rgba(99,102,241,.2);
    cursor: text;
    user-select: text;
}

.card-delete {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    border: none;
    background: transparent;
    color: var(--text-dim);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition), background var(--transition), color var(--transition);
}

.card:hover .card-delete {
    opacity: 1;
}

.card-delete:hover {
    background: rgba(239,68,68,.15);
    color: var(--danger);
}

.card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    gap: 6px;
}

.card-creator {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.card-date {
    font-size: 0.68rem;
    color: var(--text-dim);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Own-task indicator dot */
.card-owner-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
    opacity: 0.7;
    margin-left: auto;
}

/* ============================================================
   ADD TASK AREA
   ============================================================ */
.add-task-area {
    display: flex;
    gap: 6px;
    padding: 10px;
    border-top: 1px solid var(--border);
}

.add-task-input {
    flex: 1;
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.85rem;
    padding: 8px 10px;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.add-task-input::placeholder {
    color: var(--text-dim);
}

.add-task-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99,102,241,.15);
}

.add-task-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 8px 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--transition), transform var(--transition);
    flex-shrink: 0;
}

.add-task-btn:hover {
    background: #4f51e0;
    transform: translateY(-1px);
}

.add-task-btn:active {
    transform: translateY(0);
}

/* Verified locked message for employees */
.verified-locked {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-dim);
    font-style: italic;
}

/* ============================================================
   DRAG GHOST
   ============================================================ */
.drag-ghost {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.85;
    transform: rotate(2deg) scale(1.03);
    box-shadow: 0 8px 30px rgba(0,0,0,.5), 0 0 0 2px var(--primary);
    border-radius: var(--radius-sm);
    background: var(--surface-3);
    padding: 10px 12px;
    min-width: 180px;
    max-width: 260px;
    font-size: 0.9rem;
    color: var(--text);
    display: none;
}

.drag-ghost.visible {
    display: block;
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: var(--surface-3);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    font-size: 0.85rem;
    color: var(--text);
    box-shadow: var(--shadow);
    animation: toast-in 250ms ease forwards;
    max-width: 280px;
}

.toast.toast-error {
    border-color: rgba(239,68,68,.4);
    background: rgba(239,68,68,.12);
    color: #fca5a5;
}

.toast.toast-success {
    border-color: rgba(34,197,94,.3);
}

.toast.toast-out {
    animation: toast-out 250ms ease forwards;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes toast-out {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(6px); }
}

/* ============================================================
   CARD ENTRANCE ANIMATION
   ============================================================ */
@keyframes card-in {
    from { opacity: 0; transform: translateY(-8px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.card-enter {
    animation: card-in 200ms ease forwards;
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }
