/* ============================================================
   Catalogs Chamados — design system
   Aplica os tokens e componentes do mockup "Catalogs Chamados"
   sobre as classes já usadas pelo app (sem mudar a marcação).
   ============================================================ */
:root {
    --cat-orange: #f58634;
    --cat-orange-600: #e47628;
    --cat-orange-700: #c65e18;
    --cat-orange-100: #fde3cf;
    --cat-orange-50: #fff4ea;
    --cat-ink: #606062;
    --cat-ink-900: #2c2c2e;
    --cat-ink-700: #4a4a4c;
    --cat-paper: #fafafa;
    --cat-surface-alt: #f4f4f5;
    --cat-border: #e4e4e7;
    --cat-border-strong: #c9c9cf;
    --cat-muted: #8a8a8e;
    --cat-muted-2: #a3a3a8;
    --cat-success: #3fae6a;
    --cat-warning: #f5b634;
    --cat-danger: #d84848;
    --cat-info: #3a7bd5;
    --font: 'Nunito Sans', system-ui, -apple-system, sans-serif;
    --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    --sh1: 0 1px 2px rgba(44,44,46,.06), 0 1px 1px rgba(44,44,46,.04);
    --sh2: 0 4px 12px rgba(44,44,46,.08), 0 2px 4px rgba(44,44,46,.04);
    --sh3: 0 24px 60px rgba(31,31,33,.28), 0 8px 20px rgba(31,31,33,.14);

    /* aliases legados usados no app */
    --brand: var(--cat-orange);
    --brand-dark: var(--cat-orange-700);
    --ink: var(--cat-ink-900);
    --muted: var(--cat-muted);
    --border: var(--cat-border);
    --bg: #eef0f4;
    --card: #ffffff;
}

html, body { font-family: var(--font); }
body { background: var(--cat-paper); color: var(--cat-ink); }

/* ---------- Shell / nav ---------- */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.app-header {
    display: flex; align-items: center; gap: 1.4rem;
    padding: 0 1.75rem; height: 62px;
    background: #fff; border-bottom: 1px solid var(--cat-border);
    position: sticky; top: 0; z-index: 10;
}
.app-header .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.app-header .brand img { height: 24px; display: block; }
.brand-tag { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--cat-muted); border-left: 1px solid var(--cat-border); padding-left: 10px; }

.app-nav { display: flex; gap: 4px; margin-right: auto; }
.app-nav .nav-item {
    padding: 8px 15px; border-radius: 8px; color: var(--cat-ink);
    text-decoration: none; font-weight: 700; font-size: 13.5px;
}
.app-nav .nav-item:hover { background: var(--cat-surface-alt); }
.app-nav .nav-item.active { background: var(--cat-orange-50); color: var(--cat-orange-700); }

.user-box { display: flex; align-items: center; gap: 12px; }
.user-meta { display: flex; flex-direction: column; line-height: 1.2; text-align: right; }
.user-name { font-weight: 800; font-size: 13.5px; color: var(--cat-ink-900); }
.user-role { font-size: 11px; color: var(--cat-muted); }
.btn-logout {
    border: 1px solid var(--cat-border); background: #fff; color: var(--cat-ink-700);
    padding: 8px 14px; border-radius: 8px; font-weight: 800; font-size: 12.5px;
    font-family: var(--font); cursor: pointer;
}
.btn-logout:hover { background: #fbe0e0; border-color: #f0b4b4; color: #9c2a2a; }

.app-main { padding: 26px 40px 60px; max-width: 1280px; width: 100%; margin: 0 auto; }
.redirecting { padding: 3rem; text-align: center; color: var(--cat-muted); }

/* ---------- Headings / breadcrumbs ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; gap: 1rem; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; font-weight: 800; color: var(--cat-ink-900); margin: 0; letter-spacing: .01em; }
.crumbs { font-size: 12.5px; color: var(--cat-muted); margin-bottom: 12px; font-weight: 600; }
.crumbs a { color: var(--cat-orange); text-decoration: none; font-weight: 700; }

/* ---------- Cards / tiles ---------- */
.card { background: #fff; border: 1px solid var(--cat-border); border-radius: 12px; padding: 22px 24px; box-shadow: var(--sh1); }
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.tile { background: #fff; border: 1px solid var(--cat-border); border-radius: 12px; padding: 22px; box-shadow: var(--sh1); transition: .15s; display: block; }
.tile:hover { border-color: var(--cat-orange); box-shadow: var(--sh2); transform: translateY(-1px); }
.tile-link { text-decoration: none; color: inherit; display: block; }
.tile h3 { margin: 0 0 4px; font-size: 16.5px; font-weight: 800; color: var(--cat-ink-900); }
.tile .sub { color: var(--cat-orange); font-size: 13px; font-weight: 700; }
.tile-actions { display: flex; gap: 8px; margin-top: 14px; border-top: 1px solid var(--cat-surface-alt); padding-top: 14px; }

/* ---------- Buttons ---------- */
.btn { font-family: var(--font); font-weight: 800; font-size: 12.5px; letter-spacing: .03em; padding: 10px 18px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.btn-primary { background: var(--cat-orange); color: #fff; box-shadow: var(--sh1); }
.btn-primary:hover { background: var(--cat-orange-600); }
.btn-ghost { background: #fff; color: var(--cat-ink-700); border-color: var(--cat-border); }
.btn-ghost:hover { background: var(--cat-surface-alt); }
.btn-danger { background: var(--cat-danger); color: #fff; }
.btn-danger:hover { background: #c23c3c; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ---------- Forms ---------- */
.form-row { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.form-row label { font-weight: 800; font-size: 12px; color: var(--cat-ink-700); letter-spacing: .02em; }
.form-row input, .form-row select, .form-row textarea {
    border: 1px solid var(--cat-border); border-radius: 9px; padding: 11px 13px;
    font-size: 14px; font-family: var(--font); color: var(--cat-ink-900); background: #fff;
}
.form-row input::placeholder, .form-row textarea::placeholder { color: var(--cat-muted-2); }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
    outline: none; border-color: var(--cat-orange); box-shadow: 0 0 0 3px rgba(245,134,52,.18);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 28px; }

/* ---------- Alerts ---------- */
.alert { padding: 11px 14px; border-radius: 9px; font-size: 13px; margin-bottom: 14px; font-weight: 600; }
.alert-error { background: #fbe0e0; color: #9c2a2a; border: 1px solid #f0b4b4; }
.alert-ok { background: #e3f5ea; color: #1f7a44; border: 1px solid #a7dcbc; }

/* ---------- Tags / badges ---------- */
.badge { display: inline-flex; align-items: center; justify-content: center; padding: 4px 10px; border-radius: 999px; font-size: 10.5px; font-weight: 800; line-height: 1; letter-spacing: .03em; text-transform: uppercase; }
/* tipo */
.badge-type-feature { background: #eef3fc; color: #2b5aa8; }
.badge-type-bug { background: #fbe0e0; color: #9c2a2a; }
/* prioridade: 0 baixa · 1 média · 2 alta · 3 crítica */
.badge-prio-0 { background: var(--cat-surface-alt); color: var(--cat-ink); }
.badge-prio-1 { background: var(--cat-orange-50); color: var(--cat-orange-700); }
.badge-prio-2 { background: #fbe0e0; color: #9c2a2a; }
.badge-prio-3 { background: #d84848; color: #fff; }
/* status pill (spill) */
.badge-status { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; background: var(--cat-surface-alt); color: var(--cat-ink-900); font-size: 10.5px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; }
.badge-mine { background: #e3f5ea; color: #1f7a44; margin-left: .4rem; }
.pill-count { font-size: 11px; color: var(--cat-muted); margin-left: .4rem; font-family: var(--mono); font-weight: 700; }
.cell-sub { font-weight: 800; font-size: 13px; color: var(--cat-ink-900); }
.cell-sub2 { font-size: 12px; color: var(--cat-muted); }

/* status dots (usados no cabeçalho dos grupos e no kanban) */
.status-dot { width: 8px; height: 8px; border-radius: 999px; flex-shrink: 0; display: inline-block; }
.sd-0 { background: #a3a3a8; } .sd-1 { background: #f58634; } .sd-2 { background: #f5b634; }
.sd-3 { background: #3a7bd5; } .sd-4 { background: #c65e18; } .sd-5 { background: #f5b634; }
.sd-6 { background: #d84848; } .sd-7 { background: #3a7bd5; } .sd-8 { background: #3a7bd5; }
.sd-9 { background: #3fae6a; } .sd-10 { background: #2a8f56; }

/* ---------- Tables ---------- */
.tbl { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; }
.tbl th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--cat-muted); padding: 11px 18px; font-weight: 800; background: var(--cat-paper); border-bottom: 1px solid var(--cat-border); }
.tbl td { padding: 14px 18px; border-bottom: 1px solid var(--cat-surface-alt); font-size: 13.5px; vertical-align: middle; color: var(--cat-ink-700); }
.tbl tr:last-child td { border-bottom: none; }
.tbl td strong { color: var(--cat-ink-900); font-weight: 800; }
.tbl tr.clickable:hover td { background: var(--cat-orange-50); cursor: pointer; }

/* ---------- Status groups ---------- */
.status-groups { display: flex; flex-direction: column; gap: 16px; }
.status-group { background: #fff; border: 1px solid var(--cat-border); border-radius: 12px; box-shadow: var(--sh1); overflow: hidden; }
.status-group-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; cursor: pointer; user-select: none; }
.status-group-head:hover { background: var(--cat-paper); }
.status-group-head .chevron { color: var(--cat-muted); font-size: 11px; width: 12px; }
.status-group-head .group-count { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--cat-muted); background: var(--cat-surface-alt); border-radius: 999px; padding: 2px 10px; font-weight: 700; }
.status-group .tbl { border-radius: 0; border-top: 1px solid var(--cat-border); }
.group-empty { padding: 14px 18px; color: var(--cat-muted-2); font-size: 12.5px; border-top: 1px solid var(--cat-border); }

/* ---------- View toggle (seg) ---------- */
.view-toggle { display: inline-flex; background: #fff; border: 1px solid var(--cat-border); border-radius: 9px; overflow: hidden; }
.toggle-btn { border: 0; background: #fff; color: var(--cat-ink); padding: 9px 16px; font-weight: 800; font-size: 12.5px; font-family: var(--font); cursor: pointer; }
.toggle-btn.active { background: var(--cat-orange); color: #fff; }

/* ---------- Kanban ---------- */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 14px; align-items: flex-start; }
.kanban-col { flex: 0 0 250px; width: 250px; background: var(--cat-surface-alt); border: 0; border-radius: 12px; padding: 10px; display: flex; flex-direction: column; max-height: calc(100vh - 240px); }
.kanban-col.drag-over { background: var(--cat-orange-50); outline: 2px dashed var(--cat-orange); }
.kanban-col-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 8px; font-weight: 800; font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--cat-ink-900); border-bottom: 0; }
.kanban-col-head .count { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--cat-muted); font-weight: 700; background: transparent; border: 0; padding: 0; }
.kanban-col-body { padding: 6px 0 0; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; min-height: 40px; }
.kanban-card { background: #fff; border: 1px solid var(--cat-border); border-radius: 10px; padding: 13px; box-shadow: var(--sh1); transition: .12s; }
.kanban-card.draggable { cursor: grab; }
.kanban-card.draggable:active { cursor: grabbing; }
.kanban-card:hover { border-color: var(--cat-orange); box-shadow: var(--sh2); }
.kanban-card-title { font-weight: 800; font-size: 13px; color: var(--cat-ink-900); margin-bottom: 8px; line-height: 1.3; }
.kanban-card-badges { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 8px; }
.kanban-card-meta { display: flex; justify-content: space-between; gap: .5rem; font-size: 11px; color: var(--cat-muted); border-top: 1px solid var(--cat-surface-alt); padding-top: 8px; }

/* ---------- Task detail / description ---------- */
.description :first-child { margin-top: 0; }
.description h1, .description h2, .description h3, .description h4 { color: var(--cat-ink-900); }
.description p, .description li { color: var(--cat-ink-700); line-height: 1.6; }

/* ---------- Comments (chat) ---------- */
.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 900px) { .two-cols, .form-grid { grid-template-columns: 1fr; } }
.comment-panel { background: #fff; border: 1px solid var(--cat-border); border-radius: 12px; box-shadow: var(--sh1); padding: 20px; display: flex; flex-direction: column; }
.comment-panel h3 { font-size: 15px; font-weight: 800; color: var(--cat-ink-900); margin: 0 0 4px; }
.comment-panel .desc { font-size: 12px; color: var(--cat-muted); margin: 0 0 14px; line-height: 1.4; }
.comment-list { max-height: 320px; overflow-y: auto; margin-bottom: 12px; }
.comment { border: 1px solid var(--cat-border); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; background: var(--cat-paper); }
.comment .head { display: flex; justify-content: space-between; font-size: 11px; color: var(--cat-muted); margin-bottom: 4px; }
.comment .author { font-weight: 800; color: var(--cat-ink-900); }
.read-only-note { background: var(--cat-surface-alt); border: 1px dashed var(--cat-border); border-radius: 9px; padding: 11px 13px; margin: 0; color: var(--cat-muted); font-style: italic; font-size: 12.5px; }

/* ---------- Attachments ---------- */
.attach-head { display: flex; align-items: center; justify-content: space-between; }
.attach-head h3 { margin: 0; font-size: 15px; font-weight: 800; color: var(--cat-ink-900); }
.attach-head label.btn { cursor: pointer; }
kbd { background: var(--cat-surface-alt); border: 1px solid var(--cat-border); border-radius: 5px; padding: 1px 6px; font-size: 11px; font-family: var(--mono); font-weight: 700; }
.attach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-top: 14px; }
.attach-item { border: 1px solid var(--cat-border); border-radius: 9px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.attach-thumb { width: 100%; height: 120px; object-fit: cover; cursor: pointer; display: block; background: var(--cat-surface-alt); }
.attach-file { height: 120px; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; background: linear-gradient(135deg, #f4f4f5, #e4e4e7); color: var(--cat-muted-2); cursor: pointer; }
.attach-meta { padding: .5rem .6rem .2rem; display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.attach-name { font-weight: 700; font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--cat-ink-900); }
.attach-sub { font-size: .72rem; color: var(--cat-muted); }
.attach-actions { display: flex; gap: .3rem; padding: .4rem .6rem .6rem; }

/* ---------- Login ---------- */
.login-card { background: #fff; border-radius: 16px; padding: 38px; width: 100%; max-width: 420px; box-shadow: 0 30px 70px rgba(0,0,0,.4); }
.login-card .lbrand { display: flex; align-items: center; gap: 11px; margin-bottom: 6px; }
.login-card .lbrand img { height: 26px; }
.login-card h1 { font-size: 1.4rem; margin: 0 0 .25rem; color: var(--cat-ink-900); }
.login-card .muted { color: var(--cat-muted); font-size: 13.5px; margin-bottom: 26px; }
.login-card .btn-primary { width: 100%; padding: 13px; justify-content: center; margin-top: 6px; font-size: 14px; }
.hint { font-size: 12.5px; color: var(--cat-ink); margin-top: 24px; line-height: 1.7; border-top: 1px solid var(--cat-surface-alt); padding-top: 18px; }
.hint code { background: var(--cat-orange-50); color: var(--cat-orange-700); padding: 2px 7px; border-radius: 5px; font-family: var(--mono); font-size: 11.5px; font-weight: 700; }
