/* Custom overrides to match Receita Federal PGMEI with 100% precision */

header.row {
    padding: 1px 15px 1px 15px !important;
    margin-bottom: 1px !important;
    background-color: #eee;
    border-top: 3px solid #62cb31;
    background-image: url("img/bkg_header_entes.png") !important;
    background-repeat: no-repeat !important;
    background-position: right top !important;
}

header h3 {
    margin-top: 15px;
    margin-bottom: 5px;
}

header h3 span.label-success {
    background-color: #5cb85c;
    font-size: 16px;
    padding: 4px 8px;
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

header h3 span.label-success img {
    height: 18px;
    width: auto;
}

header h4.text-success {
    color: #3c763d;
    font-size: 14px;
    margin-top: 5px;
    margin-bottom: 15px;
    font-weight: 500;
}

/* Navbar */
.navbar-default {
    background-color: #f8f8f8;
    border-color: #e7e7e7;
    border-radius: 0;
    margin-bottom: 15px;
}

.navbar-default .navbar-nav > li > a {
    color: #555;
    font-weight: 500;
    font-size: 13px;
    padding-top: 12px;
    padding-bottom: 12px;
}

.navbar-default .navbar-nav > .active > a,
.navbar-default .navbar-nav > .active > a:focus,
.navbar-default .navbar-nav > .active > a:hover {
    color: #333;
    background-color: #e7e7e7;
}

.navbar-nav .glyphicon {
    margin-right: 4px;
}

/* Tabela de Apuração */
#tabela-apuracao th {
    vertical-align: middle !important;
    text-align: center;
    font-size: 12px;
    font-weight: bold;
    color: #0a4c62;
    padding: 6px 4px !important;
}

#tabela-apuracao td {
    vertical-align: middle !important;
    font-size: 12.5px;
    padding: 6px 8px !important;
}

#tabela-apuracao thead tr:first-child th {
    background-color: #e8e8e8;
}

#tabela-apuracao thead tr:nth-child(2) th {
    background-color: #f5f8f4;
}

/* Dropdown */
.dropdown-menu.show {
    display: block !important;
}

/* Contribuinte Bar */
.user-info-well {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 8px 15px;
    font-size: 12.5px;
    margin-bottom: 15px;
    color: #333;
}

/* Notice Card on Home/Inicio */
.notice-panel {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
    padding: 35px 45px;
    margin: 25px auto;
    max-width: 900px;
    line-height: 1.8;
    color: #333;
    font-size: 13.5px;
}

.notice-panel p {
    margin-bottom: 12px;
}

/* Loading Overlay */
.loading-box {
    text-align: center;
    padding: 40px 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-width: 600px;
    margin: 30px auto;
}

.loading-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid #e2e8f0;
    border-top-color: #5cb85c;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 15px;
}

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

/* Modais */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    overflow-x: hidden;
    overflow-y: auto;
}

.modal-overlay.show {
    display: flex;
}

.modal-content-box {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    border: 1px solid rgba(0,0,0,0.2);
    width: 90%;
    max-width: 650px;
    margin: 20px;
    position: relative;
    outline: 0;
}

.modal-header-official {
    padding: 12px 15px;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header-official h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #3c763d;
}

.modal-body-official {
    padding: 20px;
}

.modal-footer-official {
    padding: 12px 15px;
    text-align: right;
    border-top: 1px solid #e5e5e5;
    background-color: #f7f9fa;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
}

/* DAS Slip */
.das-slip {
    background: #fdfdfd;
    border: 2px dashed #999;
    padding: 18px;
    font-family: Arial, sans-serif;
    color: #222;
}

.das-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid #eee;
    font-size: 12px;
}

.das-barcode-box {
    background: #eee;
    padding: 8px 10px;
    font-family: monospace;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 1px;
    margin-top: 12px;
    text-align: center;
    border: 1px solid #ccc;
}

/* Datepicker Popup Exato do Print */
#datepicker-popup {
    background: #ffffff !important;
    background-color: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    padding: 6px;
    width: 220px;
    position: absolute;
    top: auto !important;
    bottom: calc(100% + 8px) !important;
    left: 0;
    z-index: 1050;
    box-shadow: 0 4px 16px rgba(0,0,0,0.22);
}

#datepicker-popup:before {
    content: '';
    display: inline-block;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 7px solid rgba(0, 0, 0, 0.25);
    position: absolute;
    bottom: -7px;
    left: 20px;
}

#datepicker-popup:after {
    content: '';
    display: inline-block;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #ffffff;
    position: absolute;
    bottom: -6px;
    left: 21px;
}

#datepicker-popup table {
    margin: 0;
    width: 100%;
    user-select: none;
}

#datepicker-popup th, #datepicker-popup td {
    width: 28px;
    height: 26px;
    text-align: center;
    font-size: 12px;
    padding: 2px !important;
}

#datepicker-popup th.dow {
    font-weight: bold;
    color: #333;
    border-bottom: 1px solid #ddd;
    font-size: 11px;
}

#datepicker-popup td.day {
    cursor: pointer;
    border-radius: 4px;
}

#datepicker-popup td.day:hover {
    background-color: #eee;
}

#datepicker-popup td.day.old, #datepicker-popup td.day.new {
    color: #999;
}

#datepicker-popup td.day.active {
    background-color: #337ab7 !important;
    color: #fff !important;
    font-weight: bold;
}

#datepicker-popup th.datepicker-switch {
    font-weight: bold;
    color: #337ab7;
    cursor: pointer;
}

#datepicker-popup th.prev, #datepicker-popup th.next {
    cursor: pointer;
    font-size: 16px;
    color: #337ab7;
}

#datepicker-popup th.prev:hover, #datepicker-popup th.next:hover, #datepicker-popup th.datepicker-switch:hover {
    background-color: #eee;
}
