:root {
    --sidebar: #1e293b;
    --sidebar-2: #334155;
    --accent: #e31c23;
    --accent-2: #fbb03b;
    --bg: #f3f5f9;
    --card: #ffffff;
    --text: #122033;
    --muted: #6b7a90;
    --radius: 16px;
}

* { box-sizing: border-box; }

body.app-body,
body.auth-body {
    font-family: "Manrope", system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
}

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

.app-sidebar {
    width: 236px;
    background: #1e293b;
    color: #e8eef8;
    display: flex;
    flex-direction: column;
    padding: 18px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 28px;
}

.sidebar-brand .logo-jt {
    width: 128px;
    height: auto;
    display: block;
}

.sidebar-brand small {
    color: #b8b8b8;
    letter-spacing: .12em;
    text-transform: uppercase;
    font-size: .72rem;
    font-weight: 700;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }

.sidebar-nav a {
    color: #c5d0e2;
    text-decoration: none;
    padding: 7px 10px;
    border-radius: 10px;
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: .82rem;
    font-weight: 500;
    line-height: 1.25;
}

.sidebar-nav a i { font-size: .92rem; }

.sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.sidebar-nav a.active {
    background: var(--sidebar-2);
    color: #fff;
}

.sidebar-nav a.nav-chamados {
    margin-top: 8px;
    background: var(--accent-2);
    color: #1a2433;
    font-weight: 700;
}

.sidebar-nav a.nav-chamados:hover,
.sidebar-nav a.nav-chamados:focus-visible {
    background: #ffc24d;
    color: #122033;
}

.sidebar-footer { border-top: 1px solid rgba(255,255,255,.08); padding-top: 12px; }

.sidebar-user {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
    color: inherit;
    text-decoration: none;
    border-radius: 12px;
    padding: 6px;
    margin-left: -6px;
    margin-right: -6px;
    font-size: .82rem;
}

a.sidebar-user:hover,
a.sidebar-user.active {
    background: rgba(255,255,255,.06);
    color: #fff;
}

.sidebar-user small { display: block; color: #93a4bf; }

.profile-meta dt {
    color: #64748b;
    font-weight: 500;
}

.profile-meta dd {
    margin-bottom: .65rem;
}
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--sidebar-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.btn-logout {
    background: transparent;
    border: 1px solid rgba(255,255,255,.14);
    color: #d7e2f3;
    border-radius: 12px;
    font-size: .8rem;
    padding: 6px 10px;
}

.btn-logout:hover { background: rgba(255,255,255,.06); color: #fff; }

.sidebar-diges {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.sidebar-diges span {
    font-size: .68rem;
    color: #8a8a8a;
    letter-spacing: .04em;
}

.sidebar-diges img {
    height: 22px;
    width: auto;
    display: block;
    border-radius: 4px;
}

.app-main { flex: 1; min-width: 0; }

.app-topbar {
    padding: 28px 36px 8px;
}

.app-topbar h1 {
    font-size: 1.6rem;
    font-weight: 800;
    margin: 0;
}

.app-content { padding: 16px 36px 40px; }

.soft-card {
    border: 0;
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(16, 32, 64, .06);
}

.page-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 20px;
}

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    border-radius: 12px;
    font-weight: 600;
}

.btn-primary:hover,
.btn-primary:focus {
    background: #c4181e;
    border-color: #c4181e;
}

.btn-outline-secondary { border-radius: 12px; }

.form-control, .form-select {
    border-radius: 12px;
    padding: 10px 14px;
    border-color: #d9e1ec;
}

.table thead th {
    color: var(--muted);
    font-weight: 600;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom-color: #eef2f7;
}

.badge-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 700;
}

.badge-status.ativo { background: #e6f8f2; color: #0f766e; }
.badge-status.inativo { background: #fde8e8; color: #b91c1c; }
.badge-status.impressa { background: #e6f8f2; color: #0f766e; }
.badge-status.nao-impressa,
.badge-status.pendente { background: #eef2f7; color: #64748b; }
.badge-status.ok { background: #e6f8f2; color: #0f766e; }
.badge-status.ignorado { background: #eef2f7; color: #64748b; }
.badge-status.erro { background: #fde8e8; color: #b91c1c; }
.badge-status.bling-aberto { background: #e0f2fe; color: #0369a1; }
.badge-status.bling-andamento { background: #fef3c7; color: #b45309; }

.user-actions {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.user-actions form { display: inline; }

#tabela-remessas,
#tabela-romaneios,
#tabela-romaneio-itens,
#tabela-pedidos,
#tabela-usuarios,
#tabela-bling-eventos { width: 100% !important; font-size: .78rem; }
#tabela-remessas thead th,
#tabela-romaneios thead th,
#tabela-romaneio-itens thead th,
#tabela-pedidos thead th,
#tabela-usuarios thead th,
#tabela-bling-eventos thead th { font-size: .68rem; padding: .45rem .5rem; }
#tabela-remessas tbody td,
#tabela-romaneios tbody td,
#tabela-romaneio-itens tbody td,
#tabela-pedidos tbody td,
#tabela-usuarios tbody td,
#tabela-bling-eventos tbody td { padding: .4rem .5rem; }
#tabela-remessas .badge-status,
#tabela-romaneios .badge-status,
#tabela-romaneio-itens .badge-status,
#tabela-pedidos .badge-status,
#tabela-usuarios .badge-status,
#tabela-bling-eventos .badge-status { font-size: .68rem; padding: 3px 8px; }

#tabela-pedidos .pedidos-check-col,
#tabela-remessas .remessas-check-col { width: 2.8rem; }
#tabela-pedidos .form-check-input,
#tabela-remessas .form-check-input {
    width: 1.35rem;
    height: 1.35rem;
    margin-top: 0;
    cursor: pointer;
}
.dt-container .dt-search input,
.dt-container .dt-length select {
    border-radius: 12px;
    border-color: #d9e1ec;
}

.stat-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    gap: 14px;
    align-items: center;
    box-shadow: 0 10px 30px rgba(16, 32, 64, .06);
}

.stat-card small { color: var(--muted); display: block; }
.stat-card strong { font-size: 1.6rem; }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e8f0fe;
    color: var(--accent);
    font-size: 1.3rem;
}

.stat-icon.teal { background: #e7f8f4; color: #0f766e; }
.stat-icon.blue { background: #e8f0fe; color: #2563eb; }
.stat-icon.amber { background: #fff7e6; color: #b45309; }

.form-hint { color: var(--muted); font-size: .9rem; }

.empty-state .empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 1.6rem;
}

.auth-split {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    min-height: 100vh;
}

.auth-panel {
    background: #1e293b;
    color: #fff;
    display: flex;
    align-items: center;
    padding: 64px;
}

.auth-panel-inner { max-width: 460px; }

.logo-jt-auth {
    width: 168px;
    height: auto;
    display: block;
    margin-bottom: 8px;
}

.auth-panel h2 { font-weight: 800; margin-top: 10px; letter-spacing: .08em; text-transform: uppercase; font-size: 1.15rem; color: #d0d0d0; }
.auth-panel p { color: #c9d7ea; max-width: 420px; }

.auth-points { list-style: none; padding: 0; margin-top: 28px; }
.auth-points li { margin-bottom: 10px; color: #dce6f5; display: flex; gap: 8px; }

.auth-diges {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.auth-diges span {
    font-size: .75rem;
    color: #9a9a9a;
}

.auth-diges img {
    height: 45px;
    width: auto;
    display: block;
    border-radius: 6px;
}

.auth-form-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .08);
}

.auth-card-brand {
    background: #1e293b;
    padding: 22px 28px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
}

.auth-card-brand .logo-jt-auth {
    width: 128px;
    margin-bottom: 0;
}

.auth-card-brand small {
    color: #b8b8b8;
    letter-spacing: .12em;
    text-transform: uppercase;
    font-size: .72rem;
    font-weight: 700;
}

.auth-card-body {
    padding: 28px 36px 32px;
}

.auth-card h1 { font-weight: 800; }

.auth-card-body .auth-diges {
    margin-top: 24px;
    align-items: center;
}

.auth-card-body .auth-diges span {
    font-size: .7rem;
}

@media (max-width: 900px) {
    .app-shell { flex-direction: column; }
    .app-sidebar { width: 100%; height: auto; position: relative; }
    .auth-split { grid-template-columns: 1fr; }
    .auth-panel { min-height: 280px; padding: 36px; }
    .app-content, .app-topbar { padding-left: 20px; padding-right: 20px; }
}
