/* ===== LOGIN DASHBOARD ===== */
.login-screen-dashboard {
    background: url('https://images.unsplash.com/photo-1586528116311-ad8dd3c8310d?w=1920&q=80') center/cover no-repeat fixed;
    position: relative;
}

.login-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(27,42,74,0.85) 0%, rgba(15,26,48,0.92) 100%);
    z-index: 1;
}

.login-card-dashboard {
    position: relative;
    z-index: 2;
    max-width: 440px !important;
    padding: 0 !important;
    border-radius: 16px !important;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.05) !important;
    border: none !important;
    backdrop-filter: blur(10px);
    background: rgba(255,255,255,0.97) !important;
}

.login-card-top {
    background: #fff;
    padding: 48px 40px 36px;
    text-align: center;
}

.login-card-top .login-logo {
    width: 240px;
    margin-bottom: 0;
}

.login-card-body {
    padding: 32px 40px 28px;
    text-align: center;
}

.login-card-body h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #C9A84C;
    margin-bottom: 6px;
}

.login-subtitle {
    font-size: 0.85rem !important;
    color: #888 !important;
    margin-bottom: 20px !important;
}

.login-divider {
    width: 50px;
    height: 3px;
    background: #EFC030;
    border-radius: 2px;
    margin: 0 auto 20px;
}

.login-instruction {
    font-size: 0.88rem !important;
    color: #555 !important;
    margin-bottom: 24px !important;
    line-height: 1.5;
}

.login-card-dashboard .btn-google-dev {
    max-width: 100% !important;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    border: 2px solid #e0e0e0;
    transition: all 0.2s;
}

.login-card-dashboard .btn-google-dev:hover {
    border-color: #C9A84C;
    background: #f8f9fa;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.login-card-footer {
    background: #f8f9fa;
    padding: 14px 40px;
    text-align: center;
    border-top: 1px solid #eee;
}

.login-card-footer span {
    font-size: 0.72rem;
    color: #aaa;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-weight: 500;
}

/* ===== DASHBOARD LAYOUT (top nav) ===== */
.app-dashboard {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg);
}

.dash-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
    height: 56px;
    background: #fff;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.dash-header-left {
    flex-shrink: 0;
}

.dash-logo {
    height: 32px;
    object-fit: contain;
}

.dash-nav {
    display: flex;
    gap: 4px;
    flex: 1;
    justify-content: center;
}

.dash-tab {
    padding: 8px 20px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #666;
    font-size: 0.85rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.dash-tab:hover {
    background: #f5f5f5;
    color: #333;
}

.dash-tab.active {
    background: #1B2A4A;
    color: #EFC030;
    font-weight: 600;
}

.dash-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.user-name-top {
    color: #888;
    font-size: 0.8rem;
}

.btn-logout-top {
    padding: 6px 14px;
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 6px;
    color: #666;
    font-size: 0.78rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout-top:hover {
    background: #f5f5f5;
    color: #333;
    border-color: #bbb;
}

/* ===== ACTIONS BAR ===== */
.dash-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background: #fff;
    border-bottom: 1px solid #eee;
}

/* ===== MAIN CONTENT ===== */
.dash-main {
    flex: 1;
    overflow: hidden;
}

/* ===== TOP BAR ACTIONS ===== */
.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-box input {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-family: inherit;
    width: 240px;
    outline: none;
    transition: border-color 0.2s;
}

.search-box input:focus {
    border-color: var(--accent);
}

.filter-group select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    background: var(--white);
    cursor: pointer;
}

.btn-refresh {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 7px 12px;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--text-light);
    transition: all 0.2s;
}

.btn-refresh:hover {
    background: var(--bg);
    color: var(--primary);
}

/* ===== LOADING / EMPTY ===== */
.loading-state,
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: var(--text-light);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state h3 {
    color: var(--text);
    margin-bottom: 8px;
}

/* ===== CONTENT AREA (grid + detail) ===== */
.content-area {
    display: flex;
    height: calc(100vh - var(--topbar-height));
    overflow: hidden;
    position: relative;
}

/* ===== CARDS GRID ===== */
.cards-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
    padding: 20px;
    overflow-y: auto;
    align-content: start;
}

.card {
    background: var(--white);
    border: 1px solid #eee;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    transform: translateY(-1px);
}

.card.active {
    box-shadow: 0 0 0 2px var(--accent);
}

.card-inner {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
}

/* --- HEADER: avatar + info + badge --- */
.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-avatar {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    letter-spacing: 0.5px;
    overflow: hidden !important;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.45);
    position: relative;
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
}

.card-header-info {
    flex: 1;
    min-width: 0;
}

.card-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: #222;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-subtitle {
    font-size: 0.72rem;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-empresa {
    padding: 3px 9px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.3px;
    white-space: nowrap;
    flex-shrink: 0;
    align-self: flex-start;
}

/* --- BODY: grid 2x2 --- */
.card-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 20px;
}

.card-body-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.card-body-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #bbb;
    font-weight: 500;
}

.card-body-value {
    font-size: 0.82rem;
    color: #333;
    font-weight: 500;
}

/* --- FOOTER --- */
.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.card-chatwoot {
    color: #1f93ff;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
}

.card-chatwoot:hover {
    text-decoration: underline;
}

.card-status {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    padding: 4px 10px;
    border-radius: 12px;
    white-space: nowrap;
}

.card-status.aprovado-badge {
    background: #e8f5e9;
    color: #2e7d32;
}

.card-status.pendente-badge {
    background: #fef3e2;
    color: #b45309;
}

.card-status.incompleto-badge {
    background: #fce4ec;
    color: #c62828;
}

.card-time {
    font-size: 0.72rem;
    color: #888;
    display: flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
}

/* ===== SEÇÃO APROVADOS ===== */
.aprovados-section {
    padding: 20px;
}

.aprovados-header {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.aprovados-header .search-box {
    flex: 1;
    min-width: 200px;
}

.aprovados-header .search-box input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.aprovados-header .search-box input:focus {
    border-color: #2e7d32;
}

.aprovado-card {
    opacity: 0.85;
    transition: opacity 0.2s;
}

.aprovado-card:hover {
    opacity: 1;
}

.aprovado-badge-lg {
    background: #e8f5e9;
    color: #2e7d32;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 10px 20px;
    border-radius: 8px;
    text-align: center;
    width: 100%;
    display: block;
}

/* ===== DETAIL PANEL (overlay, não comprime os cards) ===== */
.detail-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 520px;
    background: var(--white);
    border-left: 1px solid #eee;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 150;
    box-shadow: -4px 0 24px rgba(0,0,0,0.08);
}

.detail-panel.fullscreen {
    width: 100%;
    z-index: 200;
    border: none;
    box-shadow: none;
}

.detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--white);
}

.detail-name {
    flex: 1;
    min-width: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    overflow-wrap: anywhere;
}

.detail-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    align-self: center;
}

.btn-icon {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.82rem;
    cursor: pointer;
    color: var(--text-light);
    transition: all 0.2s;
    font-family: inherit;
}

.btn-icon:hover {
    background: var(--bg);
    color: var(--primary);
    border-color: var(--primary);
}

/* ===== DETAIL BODY ===== */
.detail-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.detail-field {
    margin-bottom: 20px;
}

.detail-label {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-bottom: 4px;
    text-transform: capitalize;
}

.detail-value {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
    word-break: break-word;
}

.detail-value a {
    color: var(--accent);
    text-decoration: none;
}

.detail-value a:hover {
    text-decoration: underline;
}

.detail-value.file-link {
    color: var(--primary-light);
    font-size: 0.88rem;
}

.detail-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 0 8px;
    margin-top: 12px;
    border-bottom: 2px solid var(--accent);
    margin-bottom: 16px;
}

/* ===== DETAIL FOOTER ===== */
.detail-footer {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    background: var(--white);
}

.btn-chatwoot {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #1f93ff;
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
    letter-spacing: 0.3px;
}

.btn-chatwoot:hover {
    background: #1a7de0;
}

.btn-aprovar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--success);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    letter-spacing: 0.3px;
}

.btn-aprovar:hover {
    background: #388e3c;
}

.btn-aprovar.approved {
    background: var(--border);
    color: var(--text-light);
    cursor: default;
}

/* ===== MODAL ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
}

.modal-content {
    background: var(--white);
    border-radius: 12px;
    width: 90%;
    max-width: 640px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 1.05rem;
    color: var(--primary);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

.btn-cancel {
    padding: 10px 24px;
    background: var(--white);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel:hover {
    background: var(--bg);
}

.btn-save {
    padding: 10px 24px;
    background: var(--accent);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-save:hover {
    background: var(--accent-hover);
}

.edit-field {
    margin-bottom: 16px;
}

.edit-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 6px;
}

.edit-field input,
.edit-field select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.88rem;
    font-family: inherit;
    outline: none;
}

.edit-field input:focus,
.edit-field select:focus {
    border-color: var(--accent);
}

/* ===== INLINE EDIT ===== */
.editable-field .detail-value {
    cursor: pointer;
    padding: 4px 8px;
    margin: -4px -8px;
    border-radius: 4px;
    transition: background 0.15s;
}

.editable-field .detail-value:hover {
    background: #f5f5f0;
}

.edit-hint {
    opacity: 0;
    font-size: 0.75rem;
    color: var(--text-light);
    transition: opacity 0.15s;
}

.editable-field .detail-value:hover .edit-hint {
    opacity: 1;
}

.inline-edit {
    display: flex;
    align-items: center;
    gap: 6px;
}

.inline-edit input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    background: #fffdf5;
}

.inline-edit-actions {
    display: flex;
    gap: 4px;
}

.btn-inline-save,
.btn-inline-cancel {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--white);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.btn-inline-save {
    color: var(--success);
    border-color: var(--success);
}

.btn-inline-save:hover {
    background: var(--success);
    color: var(--white);
}

.btn-inline-cancel {
    color: var(--error);
    border-color: var(--error);
}

.btn-inline-cancel:hover {
    background: var(--error);
    color: var(--white);
}

/* ===== FILE FIELDS IN DETAIL ===== */
.detail-file {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.file-link-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: #f0f4ff;
    border-radius: 6px;
    color: var(--primary) !important;
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: none !important;
    transition: background 0.15s;
}

.file-link-item:hover {
    background: #dce4f5;
}

.no-file {
    color: var(--text-light);
    font-style: italic;
    font-size: 0.85rem;
}

.file-reupload {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-reupload {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    background: var(--white);
    border: 1px dashed var(--accent);
    border-radius: 6px;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-reupload:hover {
    background: #fffdf5;
    border-style: solid;
}

.reupload-input {
    display: none;
}

.reupload-status {
    font-size: 0.78rem;
    font-weight: 600;
}

.reupload-status.uploading {
    color: var(--accent);
}

.reupload-status.success {
    color: var(--success);
}

.reupload-status.error {
    color: var(--error);
}

/* ===== LINKS SECTION ===== */
.links-section {
    padding: 40px;
    overflow-y: auto;
    height: calc(100vh - var(--topbar-height));
}

.links-header {
    margin-bottom: 28px;
}

.links-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #222;
    margin-bottom: 4px;
}

.links-header p {
    font-size: 0.85rem;
    color: #999;
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.empresa-card {
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #eee;
    background: #fff;
}

.empresa-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.empresa-card-bar {
    height: 5px;
}

.empresa-card-body {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.empresa-card-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    flex-shrink: 0;
}

.empresa-card-info {
    flex: 1;
}

.empresa-card-info h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #222;
    margin: 0 0 2px;
}

.empresa-card-info span {
    font-size: 0.75rem;
    color: #999;
}

.empresa-card-copy {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.empresa-card:hover .empresa-card-copy {
    background: #222;
    color: #fff;
    border-color: #222;
}

.empresa-card-bib:hover .empresa-card-copy {
    background: #D4A574 !important;
    border-color: #D4A574 !important;
}

.copy-feedback-float {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 24px;
    background: #222;
    color: #fff;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 999;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .detail-panel {
        width: 420px;
    }

    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .app-dashboard,
    .dash-main {
        overflow-x: hidden;
    }

    .dash-header {
        height: auto;
        padding: 10px 12px;
        gap: 8px;
        flex-wrap: wrap;
    }

    .dash-header-left {
        display: none;
    }

    .dash-header-right {
        margin-left: auto;
    }

    .user-name-top {
        display: none;
    }

    .dash-nav {
        order: 3;
        flex: 0 0 100%;
        justify-content: flex-start;
        gap: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 2px;
    }

    .dash-nav::-webkit-scrollbar {
        display: none;
    }

    .dash-tab {
        flex: 0 0 auto;
        padding: 8px 14px;
    }

    .dash-actions {
        padding: 10px 12px;
        gap: 10px;
        flex-wrap: wrap;
    }

    .dash-actions .search-box {
        flex: 1 1 100%;
        min-width: 0;
    }

    .dash-actions .search-box input {
        width: 100%;
        min-width: 0;
    }

    .dash-actions .filter-group {
        flex: 1;
        min-width: 0;
    }

    .dash-actions .filter-group select {
        width: 100%;
    }

    .top-bar-actions {
        gap: 8px;
    }

    .search-box input {
        width: 140px;
    }

    .detail-panel {
        width: 100%;
    }

    .detail-footer {
        padding: 12px;
        gap: 8px;
    }

    .btn-chatwoot,
    .btn-aprovar {
        flex: 1 1 0;
        min-width: 0;
        justify-content: center;
        gap: 6px;
        padding: 8px 10px;
        border-radius: 10px;
        font-size: 0.76rem;
        font-weight: 600;
        letter-spacing: 0.15px;
        line-height: 1.1;
        white-space: nowrap;
    }

    .cards-grid {
        grid-template-columns: 1fr;
        padding: 16px;
    }
}
