@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Montserrat:wght@700;800&display=swap');

:root {
    --primary: #141416;
    --primary-light: #1F2227;
    --primary-dark: #0B0B0D;
    --accent: #FAC414;
    --accent-hover: #E0AC0B;
    --accent-light: #FFF3C4;
    --accent-dark: #8A6A00;
    --bg-page: #F2F3F5;
    --surface: #ffffff;
    --text-main: #141416;
    --text-muted: #5C616B;
    --text-light: #9AA0AA;
    --border: #E2E4E8;
    --border-focus: #FAC414;
    --danger: #e11d48;
    --danger-light: #ffe4e6;
    --success: #059669;
    --success-light: #ecfdf5;
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 10px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 25px -3px rgba(0,0,0,0.12);
    --safe-bottom: env(safe-area-inset-bottom, 16px);
}

/* Base reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

/* Visibility Utilities & Tab Control */
.hidden {
    display: none !important;
}

.tab-content {
    animation: fadeIn 0.2s ease-in-out;
}

.tab-content.hidden {
    display: none !important;
}

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
}

svg {
    max-width: 100%;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

input, textarea, button, select {
    font-family: inherit;
    font-size: inherit;
}

/* ==========================================
   LOGIN SCREEN (index.html)
   ========================================== */
.login-body {
    background-color: #101113;
    color: #F8F9FA;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow-x: hidden;
    padding: 16px;
}

.login-glow {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 380px;
    height: 380px;
    background: radial-gradient(circle, rgba(250, 196, 20, 0.15) 0%, rgba(20, 20, 22, 0) 70%);
    pointer-events: none;
    z-index: 0;
}

.login-header-tag {
    position: relative;
    z-index: 1;
    margin-top: 12px;
    padding: 6px 14px;
    background: rgba(31, 34, 39, 0.6);
    border: 1px solid rgba(58, 62, 70, 0.6);
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 8px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent);
}

.login-main {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    margin: auto 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-card {
    background: rgba(20, 20, 22, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(58, 62, 70, 0.8);
    border-radius: var(--radius-xl);
    padding: 32px 24px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: #FAC414;
}

.login-logo {
    width: 104px;
    height: 104px;
    margin: 0 auto 18px auto;
    box-shadow: 0 8px 24px rgba(0,0,0,0.45);
}

.login-logo svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* O nome fica só para leitores de tela; a logo já mostra PJL */
.login-title {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.login-subtitle {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 16px;
}

.login-desc {
    font-size: 0.8rem;
    color: var(--text-light);
    line-height: 1.5;
    margin-bottom: 24px;
}

.btn-login-expand {
    width: 100%;
    background: linear-gradient(135deg, #FAC414, #E0AC0B);
    color: #0B0B0D;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(250, 196, 20, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.15s ease, filter 0.2s ease;
}

.btn-login-expand:active {
    transform: scale(0.97);
}

.btn-login-expand svg {
    width: 18px;
    height: 18px;
    transition: transform 0.2s;
}

.login-form-box {
    background: rgba(20, 20, 22, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(58, 62, 70, 0.9);
    border-radius: var(--radius-xl);
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    animation: fadeIn 0.25s ease-out;
}

.login-form-box.hidden {
    display: none !important;
}

.form-field {
    margin-bottom: 16px;
    text-align: left;
}

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    margin-bottom: 6px;
}

.form-input-text {
    width: 100%;
    height: 48px;
    background: #1F2227;
    border: 1px solid #3C4048;
    border-radius: var(--radius-md);
    padding: 0 14px;
    color: #ffffff;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input-text:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(250, 196, 20, 0.2);
}

.login-error-alert {
    background: rgba(225, 29, 72, 0.15);
    border: 1px solid var(--danger);
    color: #fecdd3;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    text-align: center;
}

.login-error-alert.hidden {
    display: none !important;
}

.btn-login-submit {
    width: 100%;
    height: 48px;
    background: var(--accent);
    color: #0B0B0D;
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(250, 196, 20, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.15s ease;
}

.btn-login-submit:active {
    transform: scale(0.97);
}

.login-footer {
    position: relative;
    z-index: 1;
    text-align: center;
    font-size: 0.72rem;
    color: #5C616B;
    padding: 12px 0;
    width: 100%;
    border-top: 1px solid #1F2227;
}

.login-footer a {
    color: var(--accent);
    text-decoration: none;
    margin: 0 4px;
}

/* ==========================================
   APP HEADER & NAVIGATION (app.html)
   ========================================== */
.app-top-nav {
    background: #141416;
    color: #ffffff;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid #1F2227;
    box-shadow: var(--shadow-md);
}

.app-nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-brand-badge {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    display: block;
}

.nav-brand-badge svg {
    width: 100%;
    height: 100%;
    display: block;
}

.nav-brand-title {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    line-height: 1;
}

.nav-brand-sub {
    font-size: 0.65rem;
    color: var(--accent);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.desktop-nav-tabs {
    display: flex;
    gap: 4px;
    background: #1F2227;
    padding: 4px;
    border-radius: var(--radius-md);
}

.nav-tab-btn {
    background: transparent;
    border: none;
    color: #9AA0AA;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.nav-tab-btn svg {
    width: 16px;
    height: 16px;
}

.nav-tab-btn.active {
    background: var(--accent);
    color: #0B0B0D;
    font-weight: 800;
}

.badge-counter {
    background: rgba(0,0,0,0.25);
    color: inherit;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 10px;
}

.btn-nav-exit {
    background: rgba(31, 34, 39, 0.8);
    border: 1px solid #3C4048;
    color: #CFD3DA;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-nav-exit svg {
    width: 16px;
    height: 16px;
}

.btn-nav-exit:hover {
    background: rgba(225, 29, 72, 0.2);
    border-color: var(--danger);
    color: #fecdd3;
}

/* ==========================================
   MOBILE BOTTOM NAVIGATION BAR
   ========================================== */
.mobile-bottom-nav {
    display: none;
}

@media screen and (max-width: 768px) {
    body {
        padding-bottom: calc(75px + var(--safe-bottom)) !important;
    }

    .desktop-nav-tabs {
        display: none !important;
    }

    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: calc(62px + var(--safe-bottom));
        padding-bottom: var(--safe-bottom);
        background: #141416;
        border-top: 1px solid #1F2227;
        z-index: 1000;
        justify-content: space-around;
        align-items: center;
        box-shadow: 0 -4px 15px rgba(0,0,0,0.25);
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: #9AA0AA;
        font-size: 0.7rem;
        font-weight: 600;
        padding: 6px 12px;
        background: transparent;
        border: none;
        cursor: pointer;
        position: relative;
        text-decoration: none;
    }

    .mobile-nav-item svg {
        width: 22px;
        height: 22px;
        margin-bottom: 2px;
    }

    .mobile-nav-item.active {
        color: var(--accent);
    }

    .mobile-nav-badge {
        position: absolute;
        top: 2px;
        right: 14px;
        background: var(--accent);
        color: #0B0B0D;
        font-size: 0.65rem;
        font-weight: 800;
        padding: 1px 5px;
        border-radius: 10px;
    }
}

/* ==========================================
   PAGE CONTAINER & PROPOSAL SHEET
   ========================================== */
.app-container {
    max-width: 1000px;
    margin: 16px auto;
    padding: 0 12px;
}

@media screen and (min-width: 769px) {
    .app-container {
        padding: 0 20px;
        margin: 24px auto;
    }
}

.proposal-paper {
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

@media screen and (min-width: 769px) {
    .proposal-paper {
        padding: 36px 44px;
        box-shadow: var(--shadow-lg);
        border-radius: var(--radius-xl);
    }
}

/* Edit Mode Banner */
.editing-banner {
    background: rgba(250, 196, 20, 0.12);
    border: 1px solid rgba(250, 196, 20, 0.4);
    color: #6B5000;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 700;
}

.editing-banner.hidden {
    display: none !important;
}

.btn-new-proposal {
    background: var(--accent);
    color: #0B0B0D;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
}

/* Proposal Header & Logo */
.proposal-header {
    text-align: center;
    padding-bottom: 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

#logo-img {
    max-width: 200px !important;
    max-height: 80px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    margin: 0 auto 10px auto !important;
    display: block !important;
}

#logo-img.hidden {
    display: none !important;
}

.proposal-title {
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: 0.15em;
    color: #141416;
    text-transform: uppercase;
}

.proposal-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-top: 2px;
}

/* ==========================================
   METADATA FORM FIELDS (Informações do Evento)
   ========================================== */
.metadata-card {
    background: #F8F9FA;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 20px;
}

.metadata-card-title {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.metadata-card-title svg {
    width: 16px;
    height: 16px;
    color: var(--accent);
}

.metadata-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media screen and (min-width: 769px) {
    .metadata-grid {
        grid-template-columns: 1fr 1fr;
        gap: 16px 24px;
    }
    .grid-col-full {
        grid-column: 1 / -1;
    }
}

.field-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

@media screen and (min-width: 769px) {
    .field-wrapper {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }
}

.field-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #3C4048;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

@media screen and (min-width: 769px) {
    .field-label {
        width: 140px;
        flex-shrink: 0;
        font-size: 0.85rem;
    }
}

.field-input {
    width: 100%;
    padding: 8px 12px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #141416;
    background: #ffffff;
    border: 1px solid #CFD3DA;
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.field-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(250, 196, 20, 0.15);
}

@media screen and (min-width: 769px) {
    .field-input {
        border: none;
        border-bottom: 1px solid #CFD3DA;
        border-radius: 0;
        background: transparent;
        padding: 4px 6px;
    }
    .field-input:focus {
        border-bottom-color: #141416;
        box-shadow: none;
    }
}

/* ==========================================
   ITEMS SECTION (Tabela Desktop / Cards Mobile)
   ========================================== */
.items-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.items-header-title {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.items-header-title svg {
    width: 16px;
    height: 16px;
    color: var(--accent);
}

.btn-add-item-mobile {
    background: #141416;
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 800;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

@media screen and (min-width: 769px) {
    .btn-add-item-mobile {
        display: none !important;
    }
}

/* Desktop Table Styles */
#items-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}

#items-table th {
    background: #F2F3F5;
    border: 1px solid #141416;
    padding: 8px 10px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

#items-table td {
    border: 1px solid #141416;
    padding: 6px 8px;
    font-size: 0.85rem;
}

/* Mobile Responsive Transformation */
@media screen and (max-width: 768px) {
    #items-table,
    #items-table tbody,
    #items-table tfoot {
        display: block;
        width: 100%;
    }

    #items-table thead {
        display: none !important;
    }

    #items-tbody tr {
        display: grid;
        grid-template-columns: 1fr 1fr 1.6fr;
        gap: 8px;
        background: #ffffff;
        border: 1px solid #CFD3DA !important;
        border-radius: var(--radius-md);
        padding: 12px;
        margin-bottom: 12px;
        box-shadow: var(--shadow-sm);
    }

    #items-tbody td {
        display: block;
        border: none !important;
        padding: 0 !important;
    }

    #items-tbody td.cell-header {
        grid-column: 1 / -1;
    }

    #items-tbody td.cell-desc {
        grid-column: 1 / -1;
    }

    #items-tbody td.cell-qtd {
        grid-column: 1 / 2;
    }

    #items-tbody td.cell-un {
        grid-column: 2 / 3;
    }

    #items-tbody td.cell-valor {
        grid-column: 3 / 4;
    }

    #items-tbody td.cell-total {
        grid-column: 1 / -1;
    }

    #items-tbody td.cell-action {
        display: none !important;
    }

    .mobile-card-top {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px dashed #E2E4E8;
        padding-bottom: 6px;
        margin-bottom: 4px;
    }

    .badge-item-num {
        background: #141416;
        color: #ffffff;
        font-size: 0.72rem;
        font-weight: 800;
        padding: 2px 8px;
        border-radius: 4px;
    }

    .btn-item-delete {
        background: #ffe4e6;
        color: #e11d48;
        border: none;
        border-radius: 6px;
        padding: 4px 8px;
        font-size: 0.75rem;
        font-weight: 700;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .btn-item-delete svg {
        width: 14px;
        height: 14px;
    }

    .item-label-mobile {
        font-size: 0.68rem;
        font-weight: 800;
        text-transform: uppercase;
        color: var(--text-muted);
        display: block;
        margin-bottom: 2px;
    }

    .mobile-input-box {
        width: 100%;
        background: #F8F9FA;
        border: 1px solid #CFD3DA;
        border-radius: 6px;
        padding: 8px;
        font-size: 0.9rem;
        outline: none;
    }

    .mobile-subtotal-box {
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: #F8F9FA;
        border: 1px solid #E2E4E8;
        border-radius: 6px;
        padding: 8px 12px;
        margin-top: 4px;
    }

    .mobile-subtotal-tag {
        font-size: 0.7rem;
        font-weight: 800;
        color: #5C616B;
        text-transform: uppercase;
    }

    #items-table tfoot tr {
        display: block;
        background: #FFF9E0;
        border: 2px solid #FFE58A !important;
        border-radius: var(--radius-md);
        padding: 12px;
        margin-top: 12px;
        text-align: center;
    }

    #items-table tfoot td {
        display: block;
        border: none !important;
        padding: 0 !important;
    }
}

.total-geral-badge {
    font-size: 1.25rem;
    font-weight: 900;
    color: #141416;
}

/* Desktop Add Line Button */
.btn-add-item-desktop {
    display: none;
}

@media screen and (min-width: 769px) {
    .btn-add-item-desktop {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        background: #141416;
        color: var(--accent);
        font-size: 0.82rem;
        font-weight: 700;
        padding: 8px 16px;
        border-radius: var(--radius-sm);
        border: none;
        cursor: pointer;
        margin-bottom: 24px;
        transition: background 0.2s;
    }
    .btn-add-item-desktop:hover {
        background: #1F2227;
    }
    .btn-add-item-desktop svg {
        width: 16px;
        height: 16px;
    }
    .mobile-card-top,
    .item-label-mobile,
    .mobile-subtotal-box {
        display: none !important;
    }
}

/* ==========================================
   TERMS, PAYMENT & EMISSION
   ========================================== */
.terms-card {
    background: #F8F9FA;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.terms-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

@media screen and (min-width: 769px) {
    .terms-row {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }
    .terms-label {
        width: 180px;
        flex-shrink: 0;
    }
}

.terms-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #3C4048;
    text-transform: uppercase;
}

.terms-input {
    width: 100%;
    padding: 8px 10px;
    font-size: 0.9rem;
    font-weight: 500;
    background: #ffffff;
    border: 1px solid #CFD3DA;
    border-radius: var(--radius-sm);
    outline: none;
}

@media screen and (min-width: 769px) {
    .terms-input {
        border: none;
        border-bottom: 1px solid #CFD3DA;
        border-radius: 0;
        background: transparent;
        padding: 4px 6px;
    }
}

.print-footer-text {
    font-size: 0.75rem;
    font-weight: 700;
    color: #4B515B;
    text-align: center;
    line-height: 1.6;
    border-top: 1px solid var(--border);
    padding-top: 16px;
    margin-top: 24px;
}

/* Desktop Bottom Actions */
.desktop-actions-bar {
    display: none;
}

@media screen and (min-width: 769px) {
    .desktop-actions-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: #F8F9FA;
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        padding: 14px 20px;
        margin-top: 24px;
    }
}

.btn-secondary-flat {
    background: transparent;
    border: none;
    color: #5C616B;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    transition: color 0.2s, background 0.2s;
}

.btn-secondary-flat:hover {
    color: var(--danger);
    background: #ffe4e6;
}

.btn-print-desktop {
    background: #3C4048;
    color: #ffffff;
    border: none;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.btn-print-desktop svg {
    width: 16px;
    height: 16px;
}

.btn-print-desktop:hover {
    background: #1F2227;
}

.btn-save-desktop {
    background: var(--accent);
    color: #0B0B0D;
    border: none;
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(250, 196, 20, 0.25);
    transition: transform 0.15s;
}

.btn-save-desktop svg {
    width: 16px;
    height: 16px;
}

.btn-save-desktop:active {
    transform: scale(0.97);
}

/* Mobile Action Dock */
.mobile-action-dock {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    margin-bottom: 20px;
}

@media screen and (min-width: 769px) {
    .mobile-action-dock {
        display: none !important;
    }
}

.btn-save-mobile {
    flex: 2;
    background: var(--accent);
    color: #0B0B0D;
    border: none;
    border-radius: var(--radius-md);
    padding: 13px;
    font-size: 0.88rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 4px 14px rgba(250, 196, 20, 0.3);
    cursor: pointer;
}

.btn-save-mobile svg {
    width: 18px;
    height: 18px;
}

.btn-print-mobile {
    flex: 1;
    background: #1F2227;
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    padding: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.btn-print-mobile svg {
    width: 18px;
    height: 18px;
}

.btn-clear-mobile {
    background: #E2E4E8;
    color: #4B515B;
    border: none;
    border-radius: var(--radius-md);
    padding: 13px 14px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

/* ==========================================
   TAB: EMITIDOS (Lista de Orçamentos)
   ========================================== */
.list-page-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

@media screen and (min-width: 769px) {
    .list-page-card {
        padding: 32px;
        border-radius: var(--radius-xl);
    }
}

.list-header-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

@media screen and (min-width: 769px) {
    .list-header-row {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.list-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #141416;
}

.list-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.search-input-box {
    position: relative;
    width: 100%;
}

@media screen and (min-width: 769px) {
    .search-input-box {
        width: 280px;
    }
}

.search-input {
    width: 100%;
    height: 42px;
    padding: 0 14px 0 38px;
    font-size: 0.85rem;
    background: #F8F9FA;
    border: 1px solid #CFD3DA;
    border-radius: var(--radius-md);
    outline: none;
}

.search-input:focus {
    border-color: var(--accent);
    background: #ffffff;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #9AA0AA;
    pointer-events: none;
}

/* Mobile Proposal Cards */
.cards-list-mobile {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

@media screen and (min-width: 769px) {
    .cards-list-mobile {
        display: none !important;
    }
}

.proposal-item-card {
    background: #ffffff;
    border: 1px solid #CFD3DA;
    border-radius: var(--radius-md);
    padding: 14px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.proposal-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    border-bottom: 1px solid #F2F3F5;
    padding-bottom: 8px;
}

.proposal-card-client {
    font-size: 0.95rem;
    font-weight: 800;
    color: #141416;
    line-height: 1.2;
}

.proposal-card-event {
    font-size: 0.78rem;
    color: #5C616B;
    margin-top: 2px;
}

.proposal-card-total {
    background: #FFF3C4;
    color: #6B5000;
    font-size: 0.85rem;
    font-weight: 900;
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap;
}

.notes-textarea {
    width: 100%;
    background: #F8F9FA;
    border: 1px solid #E2E4E8;
    border-radius: var(--radius-sm);
    padding: 8px;
    font-size: 0.78rem;
    color: #3C4048;
    outline: none;
    resize: none;
}

.notes-textarea:focus {
    background: #ffffff;
    border-color: var(--accent);
}

.proposal-card-actions {
    display: flex;
    gap: 8px;
    padding-top: 4px;
}

.btn-card-edit {
    flex: 1;
    background: #141416;
    color: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    padding: 9px;
    font-size: 0.78rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
}

.btn-card-edit svg {
    width: 14px;
    height: 14px;
}

.btn-card-delete {
    background: #ffe4e6;
    color: #e11d48;
    border: none;
    border-radius: var(--radius-sm);
    padding: 9px 14px;
    font-size: 0.78rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
}

.btn-card-delete svg {
    width: 14px;
    height: 14px;
}

/* Desktop List Table */
.desktop-list-table {
    display: none;
}

@media screen and (min-width: 769px) {
    .desktop-list-table {
        display: block;
        overflow-x: auto;
    }
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.history-table th {
    background: #F8F9FA;
    border: 1px solid var(--border);
    padding: 10px 12px;
    font-weight: 800;
    color: #4B515B;
    text-transform: uppercase;
    font-size: 0.75rem;
}

.history-table td {
    border: 1px solid var(--border);
    padding: 10px 12px;
}

/* Empty State */
.empty-state-box {
    text-align: center;
    padding: 36px 16px;
    color: var(--text-muted);
}

.empty-state-box.hidden {
    display: none !important;
}

.empty-state-icon {
    width: 56px !important;
    height: 56px !important;
    margin: 0 auto 12px auto;
    opacity: 0.45;
    color: #5C616B;
    display: block;
}

.empty-state-text {
    font-size: 0.88rem;
    font-weight: 600;
}

/* ==========================================
   TAB: CONFIGURAÇÕES
   ========================================== */
.config-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    max-width: 680px;
    margin: 0 auto;
}

@media screen and (min-width: 769px) {
    .config-card {
        padding: 32px;
        border-radius: var(--radius-xl);
    }
}

.logo-preview-box {
    margin-top: 10px;
    padding: 16px;
    background: #F8F9FA;
    border: 1px dashed #CFD3DA;
    border-radius: var(--radius-md);
    text-align: center;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-preview-img {
    max-width: 220px;
    max-height: 70px;
    object-fit: contain;
}

.logo-preview-img.hidden {
    display: none !important;
}

.toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #ffffff;
    border: 1px solid #E2E4E8;
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    cursor: pointer;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #CFD3DA;
    transition: .3s;
    border-radius: 24px;
}

.toggle-slider::before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

input:checked + .toggle-slider {
    background-color: var(--accent);
}

input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* ==========================================
   MODAL DE CONFIRMAÇÃO (Limpo e dimensionado)
   ========================================== */
#confirmModal {
    position: fixed;
    inset: 0;
    background: rgba(20, 20, 22, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 99999;
}

#confirmModal.hidden {
    display: none !important;
}

.modal-box {
    background: #ffffff;
    border-radius: var(--radius-xl);
    padding: 24px;
    max-width: 360px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    animation: fadeIn 0.2s ease-out;
}

.modal-icon-badge {
    width: 52px;
    height: 52px;
    background: #ffe4e6;
    color: #e11d48;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px auto;
}

.modal-icon-badge svg {
    width: 26px !important;
    height: 26px !important;
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #141416;
    margin-bottom: 6px;
}

.modal-msg {
    font-size: 0.85rem;
    color: #5C616B;
    line-height: 1.4;
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    gap: 10px;
}

.btn-modal-cancel {
    flex: 1;
    background: #F2F3F5;
    color: #4B515B;
    border: 1px solid #CFD3DA;
    border-radius: var(--radius-md);
    padding: 10px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
}

.btn-modal-confirm {
    flex: 1;
    background: #e11d48;
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    padding: 10px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
}

/* ==========================================
   TOAST NOTIFICATIONS
   ========================================== */
#toast-container {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 90%;
    max-width: 400px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    animation: toastSlide 0.25s ease-out;
}

.toast svg {
    width: 18px !important;
    height: 18px !important;
}

.toast-success { background: #064e3b; color: #ecfdf5; border: 1px solid #059669; }
.toast-error { background: #881337; color: #fff1f2; border: 1px solid #e11d48; }
.toast-info { background: #141416; color: #F8F9FA; border: 1px solid #3C4048; }

@keyframes toastSlide {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

/* ==========================================
   PRINT STYLES (@media print)
   ========================================== */
@media print {
    .no-print,
    .mobile-bottom-nav,
    .mobile-action-dock,
    .app-top-nav,
    .btn-add-item-mobile,
    .btn-add-item-desktop,
    .desktop-actions-bar,
    .mobile-card-top,
    .item-label-mobile,
    .mobile-subtotal-box,
    .btn-card-edit,
    .btn-card-delete,
    #toast-container,
    #confirmModal,
    .editing-banner {
        display: none !important;
    }

    body {
        background: #ffffff !important;
        color: #000000 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .app-container, .proposal-paper {
        max-width: 100% !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        border: none !important;
        box-shadow: none !important;
    }

    #items-table {
        display: table !important;
        width: 100% !important;
        border-collapse: collapse !important;
        border: 1px solid #000000 !important;
    }

    #items-table thead {
        display: table-header-group !important;
    }

    #items-table tbody {
        display: table-row-group !important;
    }

    #items-table tfoot {
        display: table-footer-group !important;
    }

    #items-table tr {
        display: table-row !important;
        border: 1px solid #000000 !important;
    }

    #items-table th, #items-table td {
        display: table-cell !important;
        border: 1px solid #000000 !important;
        padding: 4px 6px !important;
        background: transparent !important;
        color: #000000 !important;
    }

    .desktop-index {
        display: inline !important;
    }

    input, textarea {
        border: none !important;
        outline: none !important;
        background: transparent !important;
        resize: none !important;
        padding: 0 !important;
        box-shadow: none !important;
    }

    .total-geral-badge {
        background: #FFE58A !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}


/* ==========================================
   IDENTIDADE VISUAL PJL (nov/2026)
   Cores: preto #141416, amarelo #FAC414, grafite #3C4048, branco.
   Títulos em Montserrat; texto em Inter.
   ========================================== */
h1, h2, h3, .nav-brand-title, .login-subtitle {
    font-family: 'Montserrat', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
