/* ===== Kanban — estilos ===== */

:root {
    --bg: #f1f3f8;
    --surface: #ffffff;
    --border: #e3e7ef;
    --text: #1f2430;
    --text-soft: #6b7280;
    --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 12px rgba(16, 24, 40, .06);
    --radius: 10px;

    --c-slate: #64748b;
    --c-blue:  #3b82f6;
    --c-purple:#8b5cf6;
    --c-green: #22c55e;
    --c-amber: #f59e0b;
    --c-red:   #ef4444;

    --col-todo:  #64748b;
    --col-doing: #3b82f6;
    --col-done:  #22c55e;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ===== Cabeçalho ===== */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

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

.topbar__logo { font-size: 26px; }

.topbar h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -.02em;
}

.topbar__actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.topbar__total {
    font-size: 13px;
    color: var(--text-soft);
}

.topbar__actions a.btn {
    text-decoration: none;
}

/* ===== Botões ===== */

.btn {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: filter .15s, transform .05s;
}

.btn:hover { filter: brightness(.97); }
.btn:active { transform: translateY(1px); }

.btn--primary {
    background: var(--c-blue);
    border-color: var(--c-blue);
    color: #fff;
}

.btn--danger {
    background: var(--c-red);
    border-color: var(--c-red);
    color: #fff;
}

/* ===== Quadro ===== */

.board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 24px;
    align-items: start;
    max-width: 1400px;
    margin: 0 auto;
}

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

.column {
    background: #e9edf4;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    min-height: 200px;
}

.column__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 3px solid var(--col-todo);
}

.column__header--todo  { border-bottom-color: var(--col-todo); }
.column__header--doing { border-bottom-color: var(--col-doing); }
.column__header--done  { border-bottom-color: var(--col-done); }

.column__header h2 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.column__count {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 700;
    border-radius: 999px;
    padding: 2px 10px;
    min-width: 26px;
    text-align: center;
}

.column__cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    flex: 1;
    transition: background .15s;
}

.column__cards.is-over {
    background: rgba(59, 130, 246, .08);
    border-radius: 8px;
}

.column__add {
    margin: 0 12px 12px;
    padding: 8px;
    border: 1px dashed #c3cbd9;
    background: transparent;
    color: var(--text-soft);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.column__add:hover {
    background: var(--surface);
    color: var(--text);
}

/* ===== Cartões ===== */

.card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--c-slate);
    border-radius: 8px;
    padding: 10px 12px;
    box-shadow: var(--shadow);
    cursor: grab;
    transition: box-shadow .15s, transform .15s, opacity .15s;
}

.card:hover { box-shadow: 0 2px 4px rgba(16,24,40,.08), 0 8px 20px rgba(16,24,40,.10); }
.card:active { cursor: grabbing; }

.card.is-dragging {
    opacity: .4;
    transform: rotate(1.5deg);
}

.card--slate  { border-left-color: var(--c-slate); }
.card--blue   { border-left-color: var(--c-blue); }
.card--purple { border-left-color: var(--c-purple); }
.card--green  { border-left-color: var(--c-green); }
.card--amber  { border-left-color: var(--c-amber); }
.card--red    { border-left-color: var(--c-red); }

.card__body { padding-right: 46px; }

.card__title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.card__desc {
    margin: 6px 0 0;
    font-size: 13px;
    color: var(--text-soft);
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card__actions {
    position: absolute;
    top: 6px;
    right: 6px;
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity .15s;
}

.card:hover .card__actions,
.card:focus-within .card__actions { opacity: 1; }

.icon-btn {
    border: none;
    background: transparent;
    font-size: 13px;
    padding: 4px 5px;
    border-radius: 6px;
    cursor: pointer;
    line-height: 1;
}

.icon-btn:hover { background: var(--bg); }

/* Indicador de posição durante o arrasto */
.card.drop-before::before,
.card.drop-after::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--c-blue);
    border-radius: 3px;
}

.card.drop-before::before { top: -7px; }
.card.drop-after::after  { bottom: -7px; }

/* ===== Modal ===== */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 100;
}

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

.modal {
    background: var(--surface);
    border-radius: 14px;
    padding: 22px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, .3);
    animation: pop .18s ease-out;
}

@keyframes pop {
    from { transform: scale(.96) translateY(6px); opacity: 0; }
    to   { transform: none; opacity: 1; }
}

.modal__title {
    margin: 0 0 16px;
    font-size: 18px;
}

.field {
    display: block;
    margin-bottom: 14px;
}

.field > span {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-soft);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.field input[type="text"],
.field textarea,
.field select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 11px;
    font: inherit;
    font-size: 14px;
    background: var(--surface);
    color: var(--text);
    resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
    outline: 2px solid rgba(59, 130, 246, .4);
    border-color: var(--c-blue);
}

.color-picker {
    display: flex;
    gap: 8px;
}

.swatch {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform .1s;
}

.swatch:hover { transform: scale(1.12); }

.swatch.is-active {
    border-color: var(--text);
    box-shadow: 0 0 0 2px var(--surface) inset;
}

.swatch--slate  { background: var(--c-slate); }
.swatch--blue   { background: var(--c-blue); }
.swatch--purple { background: var(--c-purple); }
.swatch--green  { background: var(--c-green); }
.swatch--amber  { background: var(--c-amber); }
.swatch--red    { background: var(--c-red); }

.modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

/* ===== Toast ===== */

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2430;
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: var(--shadow);
    z-index: 200;
    animation: pop .18s ease-out;
}

.toast[hidden] { display: none; }

/* ===== Página de localização ===== */

.loc-main {
    max-width: 560px;
    margin: 0 auto;
    padding: 24px;
}

.loc-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
}

.loc-card__icon { font-size: 32px; }

.loc-card h2 {
    margin: 8px 0 4px;
    font-size: 18px;
}

.loc-card__text {
    margin: 0 0 18px;
    font-size: 13px;
    color: var(--text-soft);
    line-height: 1.5;
}

.loc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.loc-field--wide { grid-column: 1 / -1; }

.loc-field {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
}

.loc-field > span {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 4px;
}

.loc-field strong {
    font-size: 16px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.loc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.loc-actions a.btn { text-decoration: none; }

/* Bloqueio total até a permissão ser concedida */

.loc-block {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 300;
}

.loc-block[hidden] { display: none; }

.loc-block__panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, .3);
    padding: 28px;
    width: 100%;
    max-width: 420px;
    text-align: center;
    animation: pop .18s ease-out;
}

.loc-block__icon { font-size: 40px; }

.loc-block__panel h2 {
    margin: 12px 0 6px;
    font-size: 20px;
}

.loc-block__text {
    margin: 0 0 18px;
    font-size: 14px;
    color: var(--text-soft);
    line-height: 1.5;
}

.loc-block__panel .btn { width: 100%; }
.loc-block__panel .btn:disabled { opacity: .6; cursor: wait; }

.loc-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-soft);
    margin-bottom: 14px;
}

.loc-status[hidden] { display: none; }

.loc-error {
    margin: 0 0 14px;
    font-size: 13px;
    color: var(--c-red);
    line-height: 1.5;
}

.loc-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid var(--border);
    border-top-color: var(--c-blue);
    border-radius: 50%;
    animation: loc-spin .7s linear infinite;
    flex: none;
}

@keyframes loc-spin {
    to { transform: rotate(360deg); }
}
