:root {
    --jr-blue: #2196f3;
    --jr-blue-dark: #1976d2;
    --jr-orange: #ff9800;
    --jr-orange-dark: #fb8c00;
    --jr-gray-btn: #607d8b;
    --jr-bg: #f3f6fa;
    --jr-border: #e7ebf0;
    --jr-text: #263238;
    --jr-muted: #6b7280;
    --jr-card-radius: 8px;
    --jr-shadow: 0 2px 7px rgba(0, 0, 0, .13);
    --jr-shadow-soft: 0 1px 4px rgba(0, 0, 0, .10);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body.jr-helpdesk-theme,
body {
    min-height: 100vh;
    background: var(--jr-bg);
    color: var(--jr-text);
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    font-size: 14px;
    padding-bottom: 54px;
}

/* TOPO IGUAL AO HELPDESK */
.app-navbar {
    background: #fff;
    border-bottom: 1px solid #dfe4ea;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
    min-height: 66px;
    z-index: 1030;
}
.app-navbar .container-fluid { min-height: 66px; }
.jr-brand { padding: 0; margin-right: 10px; display: flex; align-items: center; }
.jr-logo { width: 43px; height: 43px; display: block; object-fit: contain; }
.app-main-menu { align-items: center; gap: 8px; }
.app-navbar .nav-link {
    color: #2e343b;
    font-weight: 500;
    font-size: 14px;
    padding: 10px 8px !important;
    border-radius: 6px;
    transition: background .15s ease, color .15s ease;
    white-space: nowrap;
}
.app-navbar .nav-link:hover,
.app-navbar .nav-link.active {
    color: #0d6efd;
    background: #f1f7ff;
}
.nav-separator { color: #444; align-items: center; font-weight: 700; padding: 0 4px; }
.navbar-toggler { border: 0; box-shadow: none !important; }
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2833,37,41,.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}
.user-area { margin-left: 12px; }
.notification-bell {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    color: #344054;
    text-decoration: none;
    border-radius: 999px;
}
.notification-bell:hover { background: #f1f5f9; color: var(--jr-blue); }
.notification-badge {
    position: absolute;
    top: -2px;
    right: -5px;
    min-width: 20px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f0182d;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
}
.account-btn {
    border: 0;
    background: transparent;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #1f2937;
    font-size: 15px;
    border-radius: 7px;
    padding: 6px 8px;
}
.account-btn:hover,
.account-btn:focus { background: #f1f5f9; }
.account-logo { width: 28px; height: 28px; }
.dropdown-menu { border: 1px solid var(--jr-border); border-radius: 8px; }
.dropdown-item { font-size: 14px; padding: 9px 14px; }

/* CONTEÚDO */
.app-content {
    max-width: 1365px;
    margin: 0 auto;
    padding-top: 28px !important;
}
.page-heading {
    background: #fff;
    border: 1px solid var(--jr-border);
    border-radius: var(--jr-card-radius);
    box-shadow: var(--jr-shadow-soft);
    padding: 18px 22px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.page-heading h1 {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 3px;
}
.page-heading h1::before {
    content: "▣";
    color: #111827;
    font-size: 16px;
    margin-right: 8px;
    vertical-align: 1px;
}
.page-heading p { font-size: 13px; }

.card-soft,
.card {
    border: 1px solid var(--jr-border);
    border-radius: var(--jr-card-radius);
    box-shadow: var(--jr-shadow-soft);
    background: #fff;
}
.card-soft:hover { box-shadow: var(--jr-shadow); }
.card-body { padding: 18px 20px; }

.metric-card { overflow: hidden; position: relative; }
.metric-card::after {
    content: "";
    position: absolute;
    width: 95px;
    height: 95px;
    border-radius: 50%;
    right: -35px;
    top: -38px;
    background: rgba(33,150,243,.07);
}
.metric-icon {
    width: 43px;
    height: 43px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    font-size: 20px;
    background: #e8f3ff;
    color: var(--jr-blue);
    flex: 0 0 auto;
}
.metric-value { font-size: 27px; font-weight: 800; line-height: 1; color: #1f2937; }

/* BOTÕES iguais aos do Helpdesk */
.btn {
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    padding: 7px 13px;
    box-shadow: none !important;
}
.btn-primary {
    --bs-btn-bg: var(--jr-blue);
    --bs-btn-border-color: var(--jr-blue);
    --bs-btn-hover-bg: var(--jr-blue-dark);
    --bs-btn-hover-border-color: var(--jr-blue-dark);
    --bs-btn-active-bg: var(--jr-blue-dark);
    --bs-btn-active-border-color: var(--jr-blue-dark);
}
.btn-warning,
.btn-outline-warning:hover {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--jr-orange);
    --bs-btn-border-color: var(--jr-orange);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--jr-orange-dark);
    --bs-btn-hover-border-color: var(--jr-orange-dark);
}
.btn-outline-primary { color: var(--jr-blue); border-color: var(--jr-blue); }
.btn-outline-primary:hover { color: #fff; background: var(--jr-blue); border-color: var(--jr-blue); }
.btn-outline-secondary { color: #fff; background: var(--jr-gray-btn); border-color: var(--jr-gray-btn); }
.btn-outline-secondary:hover { color: #fff; background: #546e7a; border-color: #546e7a; }
.btn-light { background: #e5e7eb; border-color: #e5e7eb; color: #333; }

/* TABELAS estilo chamado */
.table-card { overflow: hidden; }
.table-card .card-body.border-bottom { background: #fff; border-bottom: 1px solid #e5e7eb !important; }
.table-card .table { margin-bottom: 0; }
.table-card thead th,
.table thead th {
    background: #f7f8fa;
    color: #54606c;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    border-bottom: 1px solid #e4e8ed;
    padding: 14px 12px;
    white-space: nowrap;
}
.table-card tbody td,
.table tbody td {
    vertical-align: middle;
    color: #374151;
    font-size: 13px;
    padding: 13px 12px;
    border-bottom: 1px solid #edf0f3;
}
.table tbody tr:hover { background: #fbfdff; }
.table-responsive { border-radius: 0 0 var(--jr-card-radius) var(--jr-card-radius); }

.thumb {
    width: 66px;
    height: 44px;
    border-radius: 6px;
    object-fit: cover;
    background: #e9ecef;
    border: 1px solid #dee2e6;
}
.thumb-placeholder {
    width: 66px;
    height: 44px;
    border-radius: 6px;
    display: grid;
    place-items: center;
    background: #eef6ff;
    color: var(--jr-blue);
    border: 1px solid #ddeeff;
}
.channel-color {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    display: inline-block;
    vertical-align: -2px;
    margin-right: 6px;
}
.badge {
    border-radius: 20px;
    padding: 6px 9px;
    font-weight: 700;
    font-size: 12px;
}
.text-bg-success { background-color: #31a24c !important; }
.text-bg-secondary { background-color: #78909c !important; }
.text-bg-warning { background-color: var(--jr-orange) !important; color: #fff !important; }

/* FORMULÁRIOS */
.form-label { font-weight: 600; color: #374151; font-size: 13px; margin-bottom: 6px; }
.form-control,
.form-select,
.input-group-text {
    border-radius: 8px;
    min-height: 42px;
    border-color: #d8dee6;
    font-size: 14px;
}
.form-control:focus,
.form-select:focus {
    border-color: var(--jr-blue);
    box-shadow: 0 0 0 .18rem rgba(33,150,243,.16);
}
textarea.form-control { min-height: 110px; }
.form-text { color: #7b8794; }
.form-check-input:checked { background-color: var(--jr-blue); border-color: var(--jr-blue); }

.modal-content {
    border: 0;
    border-radius: 10px;
    box-shadow: 0 20px 65px rgba(15,23,42,.20);
}
.modal-header { border-bottom: 1px solid var(--jr-border); }
.modal-footer { border-top: 1px solid var(--jr-border); }

.empty-state {
    text-align: center;
    padding: 54px 16px;
    color: #64748b;
}
.empty-state i {
    font-size: 42px;
    display: block;
    margin-bottom: 12px;
    color: #94a3b8;
}

.alert { border-radius: 8px; border: 0; }

/* Login e instalação no mesmo padrão limpo */
.login-page {
    min-height: 100vh;
    background: var(--jr-bg);
    padding-bottom: 0;
}
.login-card {
    max-width: 430px;
    width: 100%;
    border: 1px solid var(--jr-border);
    border-radius: 10px;
    box-shadow: var(--jr-shadow);
}
.login-logo { width: 70px; height: 70px; }
.login-card h1 { color: #1f2937; }

.app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #fff;
    border-top: 1px solid #d7dce2;
    text-align: center;
    padding: 12px 10px;
    color: #555;
    font-size: 13px;
    z-index: 1020;
    box-shadow: 0 -1px 3px rgba(0,0,0,.08);
}

@media (max-width: 991.98px) {
    .app-main-menu { align-items: stretch; gap: 2px; padding-top: 10px; }
    .nav-separator { display: none !important; }
    .user-area { margin-left: 0; padding: 10px 0; justify-content: space-between; }
    .account-btn { width: 100%; justify-content: flex-start; }
}

@media (max-width: 767.98px) {
    body { padding-bottom: 72px; }
    .app-content { padding-top: 18px !important; }
    .page-heading { flex-direction: column; align-items: stretch; padding: 16px; }
    .page-heading .btn { width: 100%; }
    .card-body { padding: 16px; }
    .app-footer { font-size: 12px; padding: 10px 8px; }
}

/* ===== JR Helpdesk visual atualizado com logo oficial ===== */
.jr-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
}
.account-logo-wrap {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #fff;
    flex: 0 0 auto;
}
.account-logo {
    width: 30px;
    height: 30px;
    object-fit: contain;
}
.account-name {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Login no mesmo estilo do Helpdesk enviado */
body.login-helpdesk {
    background: #f5f7fa;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-bottom: 0;
    font-family: "Segoe UI", Arial, sans-serif;
}
.login-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.helpdesk-login-card {
    background: #fff;
    padding: 40px 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
    border: 1px solid #eef1f5;
}
.helpdesk-login-card .logo img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin-bottom: 20px;
}
.helpdesk-login-card h2 {
    color: #2196f3;
    margin-bottom: 6px;
    font-weight: 700;
    font-size: 24px;
}
.login-subtitle {
    color: #6b7280;
    margin-bottom: 20px;
    font-size: 14px;
}
.helpdesk-login-card form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    text-align: left;
}
.login-input-wrap {
    position: relative;
}
.login-input-wrap i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #607d8b;
    font-size: 16px;
}
.login-input-wrap input,
.helpdesk-login-card input.form-control {
    width: 100%;
    padding: 11px 12px 11px 38px;
    border: 1px solid #cbd6e2;
    border-radius: 4px;
    font-size: 14px;
    min-height: 42px;
    background: #fff;
}
.helpdesk-login-card input.form-control {
    padding-left: 12px;
}
.login-input-wrap input:focus,
.helpdesk-login-card input.form-control:focus {
    outline: none;
    border-color: #2196f3;
    box-shadow: 0 0 0 .18rem rgba(33,150,243,.12);
}
.remember-line {
    font-size: 13px;
    color: #555;
    display: inline-flex;
    gap: 7px;
    align-items: center;
    cursor: pointer;
}
.helpdesk-login-card button,
.btn-login-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 6px;
    background: #ff7a59;
    color: white !important;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    text-decoration: none;
    min-height: 44px;
}
.helpdesk-login-card button:hover,
.btn-login-link:hover {
    background: #e06a45;
    color: #fff !important;
}
.login-footer {
    text-align: center;
    padding: 15px 10px;
    background: #f0f0f0;
    font-size: 14px;
    color: #555;
}
.helpdesk-login-card .alert,
.login-helpdesk .alert {
    padding: 10px 12px;
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 14px;
    text-align: left;
}
.login-helpdesk .alert-danger { background:#f8d7da; color:#721c24; }
.login-helpdesk .alert-success { background:#d1e7dd; color:#0f5132; }
.login-helpdesk .alert-info { background:#cff4fc; color:#055160; }
.install-card { max-width: 430px; }
.install-card .mb-3 { text-align: left; }
.install-card .form-text { font-size: 12px; }

/* Responsivo geral para mobile sem quebrar o visual do Helpdesk */
@media (max-width: 1199.98px) {
    .app-navbar .nav-link { font-size: 13px; padding-left: 6px !important; padding-right: 6px !important; }
    .account-name { max-width: 120px; }
}

@media (max-width: 991.98px) {
    .app-navbar { min-height: 58px; }
    .app-navbar .container-fluid { min-height: 58px; }
    .jr-logo { width: 42px; height: 42px; }
    .navbar-collapse {
        background: #fff;
        margin: 10px -12px 0;
        padding: 10px 12px 12px;
        border-top: 1px solid #edf0f3;
    }
    .app-main-menu .nav-link {
        display: flex;
        align-items: center;
        min-height: 40px;
        padding: 10px 12px !important;
        border-radius: 8px;
    }
    .user-area {
        border-top: 1px solid #edf0f3;
        margin-top: 8px;
        padding-top: 12px;
        gap: 8px !important;
    }
    .notification-bell { flex: 0 0 auto; }
    .account-dropdown { flex: 1; }
    .account-btn { min-height: 42px; }
    .dropdown-menu-end { right: auto; left: 0; }
}

@media (max-width: 767.98px) {
    body.jr-helpdesk-theme, body { font-size: 13px; }
    .app-content {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
    .page-heading {
        gap: 12px;
        margin-bottom: 14px;
    }
    .page-heading h1 { font-size: 18px; }
    .page-heading p { font-size: 12px; }
    .page-heading .d-flex { width: 100%; }
    .page-heading .btn { flex: 1 1 100%; }
    .metric-value { font-size: 23px; }
    .metric-icon { width: 38px; height: 38px; font-size: 18px; }
    .btn { min-height: 38px; }
    .modal-dialog { margin: 10px; }

    .table-mobile-card table,
    .table-mobile-card thead,
    .table-mobile-card tbody,
    .table-mobile-card th,
    .table-mobile-card td,
    .table-mobile-card tr {
        display: block;
        width: 100%;
    }
    .table-mobile-card thead { display: none; }
    .table-mobile-card tbody tr {
        background: #fff;
        border: 1px solid #e5e7eb;
        border-radius: 10px;
        margin: 12px;
        padding: 8px 10px;
        box-shadow: 0 1px 4px rgba(0,0,0,.07);
    }
    .table-mobile-card tbody td {
        border: 0 !important;
        padding: 8px 0 !important;
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        text-align: right;
        min-height: 34px;
        word-break: break-word;
    }
    .table-mobile-card tbody td::before {
        content: attr(data-label);
        flex: 0 0 42%;
        max-width: 42%;
        color: #6b7280;
        font-size: 11px;
        font-weight: 800;
        text-transform: uppercase;
        text-align: left;
    }
    .table-mobile-card tbody td:first-child {
        display: block;
        text-align: left;
        border-bottom: 1px solid #edf0f3 !important;
        margin-bottom: 6px;
        padding-bottom: 10px !important;
    }
    .table-mobile-card tbody td:first-child::before { display: none; }
    .table-mobile-card .d-flex.justify-content-end { justify-content: flex-start !important; flex-wrap: wrap; }
    .table-mobile-card .btn-sm { min-width: 39px; }
}

@media (max-width: 575.98px) {
    .login-container { padding: 16px; align-items: center; }
    .helpdesk-login-card { padding: 30px 20px; max-width: 100%; }
    .helpdesk-login-card .logo img { width: 105px; height: 105px; margin-bottom: 16px; }
    .helpdesk-login-card h2 { font-size: 22px; }
    .login-footer { font-size: 12px; padding: 12px 8px; }
    .account-name { max-width: 170px; }
    .card-body { padding: 14px; }
    .thumb, .thumb-placeholder { width: 58px; height: 40px; }
    .badge { font-size: 11px; padding: 5px 8px; }
    .app-footer { position: static; margin-top: 18px; }
    body.jr-helpdesk-theme, body { padding-bottom: 0; }
}


/* Aniversariantes */
.birthday-mini-preview{width:120px;height:68px;object-fit:cover;border-radius:10px;border:1px solid #e5e7eb;box-shadow:0 6px 18px rgba(15,23,42,.08)}
.birthday-preview-frame{position:relative;width:100%;aspect-ratio:16/9;border-radius:14px;overflow:hidden;border:1px solid #e5e7eb;background:#fff;box-shadow:0 10px 30px rgba(15,23,42,.08)}
.birthday-preview-frame img{width:100%;height:100%;object-fit:cover;display:block}
.birthday-preview-name{position:absolute;left:7.5%;top:63.8%;width:38%;text-align:center;color:#ff8500;font-weight:900;font-size:clamp(14px,2.4vw,34px);letter-spacing:.02em;line-height:1.1;text-transform:uppercase;text-shadow:0 2px 10px rgba(255,255,255,.85);background:rgba(255,255,255,.72);border-radius:10px;padding:.12em .35em}
@media (max-width: 767.98px){.birthday-mini-preview{width:96px;height:54px}.birthday-preview-name{font-size:clamp(10px,4.8vw,20px);left:6.5%;width:41%;top:63.5%}.page-heading .btn{width:100%}}
.chart-lite-legend{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin-top:8px;font-size:12px;color:#5b6472}.chart-lite-legend span{display:inline-flex;align-items:center;gap:5px}.chart-lite-legend b{display:inline-block;width:10px;height:10px;border-radius:50%}.empty-state.compact{padding:30px;text-align:center;color:#6b7280}
