/* ── GOOGLE FONTS ── */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700;800&family=Open+Sans:wght@400;500;600&display=swap');

/* ── CSS VARIABLES ── */
:root {
    --gold: #FFD500;
    --dark-bg: #2b2b2d;
    --dark-bg2: #3f3f41;
    --dark-bg3: #4a4a4c;
    --text-dark: #3f3f41;
    --border: #e4e4e4;
    --body-font: 'Open Sans', sans-serif;
    --heading-font: 'Montserrat', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: var(--body-font);
    background: #f7f7f7;
    color: var(--text-dark);
    margin: 0;
    padding: 0;
}

/* ── LOGIN PAGE ── */
body.login-page {
    background: linear-gradient(135deg, #1a1a2e 0%, #2b2b2d 45%, #3f3f41 100%);
    min-height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* 8 animated golden bubbles */
.bk-bubbles {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bk-bubble {
    position: absolute;
    border-radius: 50%;
    opacity: 0.18;
    animation: bk-float linear infinite;
}

@keyframes bk-float {
    0%   { transform: translateY(110vh) scale(0.8); opacity: 0; }
    10%  { opacity: 0.18; }
    90%  { opacity: 0.18; }
    100% { transform: translateY(-15vh) scale(1.1); opacity: 0; }
}

.bk-b1 { width: 90px;  height: 90px;  background: #FFD500; left: 8%;  animation-duration: 14s; animation-delay: 0s; }
.bk-b2 { width: 55px;  height: 55px;  background: #FFD500; left: 75%; animation-duration: 11s; animation-delay: 2s; }
.bk-b3 { width: 130px; height: 130px; background: #b08000; left: 55%; animation-duration: 17s; animation-delay: 4s; }
.bk-b4 { width: 40px;  height: 40px;  background: #FFD500; left: 30%; animation-duration: 10s; animation-delay: 1s; }
.bk-b5 { width: 70px;  height: 70px;  background: #8a7000; left: 88%; animation-duration: 15s; animation-delay: 6s; }
.bk-b6 { width: 100px; height: 100px; background: #FFD500; left: 18%; animation-duration: 13s; animation-delay: 3s; }
.bk-b7 { width: 50px;  height: 50px;  background: #c09a00; left: 65%; animation-duration: 12s; animation-delay: 5s; }
.bk-b8 { width: 80px;  height: 80px;  background: #FFD500; left: 42%; animation-duration: 16s; animation-delay: 7s; }

/* Login card */
.login-wrapper {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 460px;
    padding: 0 1rem;
}

.login-logo-area {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-logo-area img {
    height: 80px;
    max-width: 240px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.login-welcome {
    font-family: var(--heading-font);
    font-weight: 800;
    font-size: 1.8rem;
    color: #ffffff;
    text-align: center;
    letter-spacing: 0.04em;
    text-shadow: 0 2px 14px rgba(0,0,0,0.5);
    margin-top: 0.6rem;
}

.login-card {
    background: rgba(22, 22, 40, 0.90);
    border-radius: 18px;
    border-top: 5px solid #FFD500;
    box-shadow: 0 20px 60px rgba(0,0,0,0.60);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 2rem 2.2rem;
    width: 100%;
}

.login-card-title {
    font-family: var(--heading-font);
    font-weight: 800;
    font-size: 1.3rem;
    color: #ffffff;
    text-align: center;
    margin-bottom: 0.2rem;
}

.login-card-sub {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.55);
    text-align: center;
    margin-bottom: 1.2rem;
}

.login-card label {
    display: block;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.login-card input[type="text"],
.login-card input[type="password"] {
    width: 100%;
    padding: 0.55rem 0.9rem;
    border-radius: 9px;
    border: 1.5px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.96);
    color: #1a1a2e;
    font-size: 0.93rem;
    margin-bottom: 1rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.login-card input:focus {
    border-color: #FFD500;
    box-shadow: 0 0 0 3px rgba(255,213,0,0.35);
}

.btn-login {
    display: block;
    width: 100%;
    padding: 0.7rem;
    background: linear-gradient(135deg, #FFD500 0%, #e6bf00 100%);
    color: #1a1a2e;
    border: none;
    border-radius: 9px;
    font-family: var(--heading-font);
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 0.04em;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(255,213,0,0.3);
    transition: transform 0.15s, box-shadow 0.15s;
    margin-top: 0.3rem;
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 22px rgba(255,213,0,0.45);
}

.btn-link-white {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 0.8rem;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    margin-top: 0.6rem;
    display: block;
    text-align: right;
    width: 100%;
}

.btn-link-white:hover { color: #fff; }

/* ── HEADER ── */
.bk-header {
    background: linear-gradient(135deg, #2b2b2d 0%, #3f3f41 60%, #4a4a4c 100%);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 2rem;
    height: 68px;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 2px 0 #FFD500, 0 4px 20px rgba(0,0,0,0.35);
}

.bk-header img {
    height: 36px;
    filter: brightness(0) invert(1);
}

.bk-hd {
    width: 1px;
    height: 28px;
    background: rgba(255,255,255,0.25);
    margin: 0 4px;
}

.bk-header-name {
    font-family: var(--heading-font);
    font-weight: 800;
    font-size: 1.15rem;
    color: #FFD500;
    letter-spacing: 0.08em;
}

.bk-header-sub {
    font-size: 0.62rem;
    color: #b0b0b2;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-top: 3px;
}

.bk-header-user {
    margin-left: auto;
    font-size: 0.78rem;
    color: #cccccc;
}

/* ── NAVBAR ── */
.bk-navbar {
    background: #ffffff;
    border: 1px solid #e4e4e4;
    border-top: 3px solid #FFD500;
    border-radius: 0 0 10px 10px;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 1.5rem;
    height: 48px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin-bottom: 1.8rem;
}

.bk-nav-link {
    font-family: var(--heading-font);
    font-weight: 600;
    font-size: 0.82rem;
    letter-spacing: 0.03em;
    color: #6b6b6d;
    padding: 6px 18px;
    border-radius: 6px;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.15s;
    border: none;
    background: none;
    cursor: pointer;
}

.bk-nav-link:hover {
    background: #f0f0f0;
    color: var(--text-dark);
}

.bk-nav-link.active {
    background: #3f3f41;
    color: #FFD500;
}

/* ── MAIN LAYOUT ── */
.bk-container {
    width: 100%;
    padding: 0 2rem 2rem;
}

/* ── SECTION TITLES ── */
.bk-title {
    font-family: var(--heading-font);
    font-weight: 700;
    font-size: 0.95rem;
    color: #3f3f41;
    border-bottom: 2px solid #FFD500;
    padding-bottom: 0.45rem;
    margin: 1.2rem 0 0.8rem 0;
}

/* ── FORM STYLES ── */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 0.3rem;
}

.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.88rem;
    font-family: var(--body-font);
    border: 1.5px solid #d0d0d2;
    border-radius: 7px;
    background: #fff;
    color: var(--text-dark);
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}

.form-control:focus {
    border-color: #FFD500;
    box-shadow: 0 0 0 3px rgba(255,213,0,0.25);
}

.form-control:disabled,
.form-control[readonly] {
    background: #f5f5f5;
    color: #888;
    cursor: not-allowed;
}

select.form-control {
    appearance: auto;
}

/* ── CUSTOM MULTI-SELECT DROPDOWN ── */
.custom-multiselect {
    position: relative;
    max-width: 480px;
}

.multiselect-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background: #fff;
    border: 2px solid #d0d0d2;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.88rem;
    color: #3f3f41;
    font-family: var(--body-font);
    text-align: left;
    transition: border-color 0.2s;
}

.multiselect-toggle:hover,
.multiselect-toggle:focus {
    border-color: #FFD500;
    outline: none;
}

.multiselect-arrow {
    font-size: 0.75rem;
    color: #888;
    transition: transform 0.2s;
}

.multiselect-toggle.open .multiselect-arrow {
    transform: rotate(180deg);
}

.multiselect-panel {
    position: absolute;
    z-index: 9999;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 2px solid #FFD500;
    border-radius: 8px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.15);
    max-height: 280px;
    overflow-y: auto;
}

.multiselect-option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.88rem;
    color: #3f3f41;
    transition: background 0.12s;
    margin: 0;
    font-weight: 400;
}

.multiselect-option:hover {
    background: #fffbe6;
}

.multiselect-option input[type=checkbox] {
    accent-color: #FFD500;
    width: 15px;
    height: 15px;
    cursor: pointer;
    flex-shrink: 0;
}

.multiselect-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.ms-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #FFD500;
    color: #2b2b2d;
    padding: 0.18rem 0.55rem;
    border-radius: 20px;
    font-size: 0.76rem;
    font-weight: 600;
    font-family: var(--body-font);
}

.ms-tag-x {
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.ms-tag-x:hover { opacity: 1; }

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* ── GRID ── */
.row { display: flex; flex-wrap: wrap; gap: 1rem; }
.col-1 { flex: 1; min-width: 120px; }
.col-2 { flex: 2; min-width: 200px; }
.col-3 { flex: 3; min-width: 250px; }
.col-4 { flex: 4; min-width: 300px; }

/* ── BUTTONS ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 1.2rem;
    font-family: var(--heading-font);
    font-weight: 700;
    font-size: 0.84rem;
    letter-spacing: 0.04em;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    min-height: 38px;
    transition: all 0.18s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #3f3f41 0%, #555557 100%);
    color: #FFD500;
    box-shadow: 0 3px 12px rgba(0,0,0,0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2a2a2c 0%, #3f3f41 100%);
    box-shadow: 0 5px 18px rgba(0,0,0,0.3);
    transform: translateY(-1px);
    color: #FFD500;
    text-decoration: none;
}

.btn-secondary {
    background: #f5f5f5;
    color: #3f3f41;
    border: 1.5px solid #d0d0d2;
}

.btn-secondary:hover {
    background: #3f3f41;
    color: #FFD500;
    border-color: #3f3f41;
}

.btn-danger {
    background: linear-gradient(135deg, #c62828 0%, #e53935 100%);
    color: #fff;
    box-shadow: 0 3px 12px rgba(198,40,40,0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #8d0000 0%, #c62828 100%);
    transform: translateY(-1px);
}

.btn-gold {
    background: linear-gradient(135deg, #FFD500 0%, #e6bf00 100%);
    color: #1a1a2e;
    box-shadow: 0 3px 12px rgba(255,213,0,0.3);
}

.btn-gold:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 18px rgba(255,213,0,0.45);
}

.btn-sm {
    padding: 0.3rem 0.8rem;
    font-size: 0.78rem;
    min-height: 30px;
}

.btn-block { width: 100%; }

/* ── ALERTS ── */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.88rem;
}

.alert-danger {
    background: #fce4ec;
    color: #c62828;
    border-left: 4px solid #c62828;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border-left: 4px solid #2e7d32;
}

.alert-warning {
    background: #fff8e1;
    color: #f57f17;
    border-left: 4px solid #FFD500;
}

.alert-info {
    background: #fff8e1;
    color: #5c4a00;
    border-left: 4px solid #FFD500;
}

/* ── CARD / FORM CONTAINER ── */
.bk-card {
    background: #fafafa;
    border: 1px solid #e4e4e4;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* ── TABLE ── */
.bk-table-wrap {
    border: 1px solid #e4e4e4;
    border-radius: 6px;
    overflow: auto;
    max-height: 500px;
}

.bk-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.bk-table th {
    background: #3f3f41;
    color: #FFD500;
    padding: 9px 10px;
    text-align: left;
    white-space: nowrap;
    font-size: 0.76rem;
    position: sticky;
    top: 0;
    z-index: 1;
    font-family: var(--heading-font);
}

.bk-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #ebebeb;
    color: #3f3f41;
    white-space: nowrap;
}

.bk-table tr:hover td { background: #fafafa; }

/* ── CHECKBOX ITEM ── */
.pkg-item {
    display: grid;
    grid-template-columns: 2fr 4fr 1fr;
    gap: 0.5rem;
    align-items: start;
    padding: 0.6rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.pkg-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: #3f3f41;
}

.pkg-checks { display: flex; flex-direction: column; gap: 0.2rem; }

.pkg-checks label {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    font-size: 0.82rem;
    cursor: pointer;
}

.pkg-checks input[type="checkbox"] {
    margin-top: 2px;
    accent-color: #FFD500;
    width: 14px;
    height: 14px;
}

/* ── EXPANDER / DETAILS ── */
details {
    border: 1px solid #e4e4e4;
    border-radius: 8px;
    margin-bottom: 0.8rem;
    overflow: hidden;
}

details summary {
    padding: 0.7rem 1rem;
    background: #fafafa;
    cursor: pointer;
    font-family: var(--heading-font);
    font-weight: 600;
    font-size: 0.88rem;
    color: #3f3f41;
    border-bottom: 1px solid #e4e4e4;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

details summary::-webkit-details-marker { display: none; }

details[open] summary {
    background: #3f3f41;
    color: #FFD500;
}

details .pkg-content {
    padding: 1rem;
}

/* ── DEPARTMENT EXPANDER HEADER ── */
.pkg-header {
    display: grid;
    grid-template-columns: 2fr 4fr 1fr;
    gap: 0.5rem;
    padding: 0.4rem 0 0.6rem;
    font-weight: 700;
    font-size: 0.8rem;
    color: #888;
    border-bottom: 2px solid #e4e4e4;
    margin-bottom: 0.4rem;
}

/* ── TOTAL DISPLAY ── */
.total-box {
    background: #3f3f41;
    color: #FFD500;
    border-radius: 8px;
    padding: 0.8rem 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--heading-font);
    font-weight: 700;
    margin-top: 1rem;
}

.total-box .total-label { font-size: 0.9rem; }
.total-box .total-value { font-size: 1.2rem; }
.total-box .total-extenso { font-size: 0.78rem; color: #ccc; margin-top: 4px; }

/* ── APPROVAL PAGE ── */
.aprv-card {
    max-width: 100%;
    margin: 0;
    background: #fff;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    min-height: 100vh;
}

.aprv-header {
    background: linear-gradient(135deg, #2b2b2d 0%, #3f3f41 100%);
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.aprv-header img {
    height: 50px;
    filter: brightness(0) invert(1);
}

.aprv-header h1 {
    color: #FFD500;
    font-family: var(--heading-font);
    font-size: 1.2rem;
    margin: 0;
}

.aprv-body { padding: 2rem; }

.aprv-status {
    padding: 1.2rem 1.5rem;
    border-radius: 0 12px 12px 0;
    margin: 1rem 0;
}

.aprv-status.aprovado {
    background: #e8f5e9;
    border-left: 5px solid #2e7d32;
    color: #2e7d32;
}

.aprv-status.reprovado {
    background: #fce4ec;
    border-left: 5px solid #c62828;
    color: #c62828;
}

/* ── PASSWORD CHANGE PAGE ── */
.chpwd-card {
    max-width: 480px;
    margin: 4rem auto;
    background: #fff;
    border-top: 5px solid #FFD500;
    border-radius: 8px;
    padding: 2rem 2.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

/* ── DIVIDER ── */
hr.bk-divider {
    border: none;
    border-top: 1px solid #e4e4e4;
    margin: 1.5rem 0;
}

/* ── BADGE ── */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.badge-master { background: #FFD500; color: #1a1a2e; }
.badge-user   { background: #e4e4e4; color: #555; }
.badge-active { background: #e8f5e9; color: #2e7d32; }
.badge-inactive { background: #fce4ec; color: #c62828; }

/* ── MODAL ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-box {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.modal-box h3 {
    font-family: var(--heading-font);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

/* ── SUMMARY TABLE ── */
.summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.summary-table th {
    background: #f0f0f0;
    padding: 6px 10px;
    text-align: left;
    font-weight: 700;
    color: #555;
}

.summary-table td { padding: 6px 10px; border-bottom: 1px solid #f0f0f0; }

/* ── APPROVAL STATUS DOTS ── */
.apr-dot {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 50%;
    margin-right: 5px;
}
.apr-dot.pendente { background: #f57f17; }
.apr-dot.aprovado { background: #2e7d32; }
.apr-dot.reprovado { background: #c62828; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .bk-header { padding: 0 1rem; }
    .bk-navbar { padding: 0 0.5rem; }
    .bk-container { padding: 0 0.8rem 2rem; }
    .row { flex-direction: column; }
    .pkg-item { grid-template-columns: 1fr; }
    .pkg-header { display: none; }
}
