/* ============================================================
   NOTAS FÁCIL - Sistema de Design v2.0 (LIGHT)
   DataWater
   ============================================================ */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Cores - Marca DataWater */
    --color-brand: #2E8FCB;
    --color-brand-light: #4FA8DC;
    --color-brand-dark: #1B6BA0;
    --color-brand-soft: #E8F3FB;

    /* Cores - Semânticas */
    --color-success: #1FAE7E;
    --color-success-soft: #E5F8F0;
    --color-warning: #E89A3E;
    --color-warning-soft: #FDF1E2;
    --color-danger: #D9544E;
    --color-danger-soft: #FBE9E8;

    /* Cores - Fundo (LIGHT) */
    --bg-base: #F4F7FB;
    --bg-elevated: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-input: #FFFFFF;
    --bg-subtle: #F8FAFD;
    --bg-gradient: linear-gradient(180deg, #F4F8FC 0%, #FFFFFF 100%);

    /* Cores - Borda */
    --border-subtle: #E6EBF2;
    --border-default: #D0D8E2;
    --border-strong: #B5C0CD;
    --border-brand: #2E8FCB;

    /* Cores - Texto */
    --text-primary: #1A2333;
    --text-secondary: #4F5B6E;
    --text-muted: #8492A6;
    --text-on-brand: #FFFFFF;

    /* Espaçamento */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 999px;

    /* Sombras - light theme = sombras suaves de azul */
    --shadow-sm: 0 1px 2px rgba(46, 80, 130, 0.06);
    --shadow-md: 0 4px 16px rgba(46, 80, 130, 0.08);
    --shadow-lg: 0 12px 32px rgba(46, 80, 130, 0.12);
    --shadow-brand: 0 4px 16px rgba(46, 143, 203, 0.25);

    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', system-ui, sans-serif;
    --font-size-xs: 11px;
    --font-size-sm: 13px;
    --font-size-md: 15px;
    --font-size-lg: 18px;
    --font-size-xl: 24px;
    --font-size-2xl: 32px;

    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
}

html, body {
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: var(--font-size-md);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

.app-container {
    max-width: 480px;
    margin: 0 auto;
    padding: var(--space-5) var(--space-4) var(--space-7);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ----- Tipografia ----- */
h1 {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
    letter-spacing: -0.02em;
}

h2 {
    font-size: var(--font-size-md);
    font-weight: 400;
    color: var(--text-secondary);
    margin-bottom: var(--space-5);
}

h3 {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-secondary);
    margin: var(--space-5) 0 var(--space-3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

p { color: var(--text-secondary); }

a {
    color: var(--color-brand);
    text-decoration: none;
    transition: color var(--transition-fast);
    font-weight: 500;
}

a:hover { color: var(--color-brand-dark); }

/* ----- Botões ----- */
button, .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    width: 100%;
    min-height: 48px;
    padding: var(--space-3) var(--space-4);
    background: var(--color-brand);
    color: var(--text-on-brand);
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: var(--font-size-md);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    box-shadow: var(--shadow-brand);
}

button:hover, .btn:hover {
    background: var(--color-brand-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(46, 143, 203, 0.35);
}

button:active, .btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn--secondary, button.secondary, button.logout-btn, button.btn--secondary {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border-default);
    box-shadow: var(--shadow-sm);
}

.btn--secondary:hover, button.secondary:hover, button.logout-btn:hover, button.btn--secondary:hover {
    background: var(--bg-subtle);
    border-color: var(--border-strong);
    color: var(--text-primary);
    box-shadow: var(--shadow-md);
}

.btn--danger {
    background: var(--color-danger-soft);
    color: var(--color-danger);
    border: 1px solid var(--color-danger);
    box-shadow: none;
}

.btn--danger:hover {
    background: var(--color-danger);
    color: white;
}

/* ----- Inputs ----- */
label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
    margin-top: var(--space-4);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"] {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: var(--font-size-md);
    transition: all var(--transition-fast);
}

input:focus {
    outline: none;
    border-color: var(--color-brand);
    box-shadow: 0 0 0 3px rgba(46, 143, 203, 0.15);
}

input::placeholder { color: var(--text-muted); }

/* ----- Flash messages ----- */
.flash {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-4);
    font-size: var(--font-size-sm);
    border: 1px solid;
}

.flash--success {
    background: var(--color-success-soft);
    border-color: var(--color-success);
    color: var(--color-success);
}

.flash--error {
    background: var(--color-danger-soft);
    border-color: var(--color-danger);
    color: var(--color-danger);
}

/* ----- Link row ----- */
.link-row {
    text-align: center;
    margin-top: var(--space-4);
    font-size: var(--font-size-sm);
}

/* ----- Footer ----- */
.app-footer {
    margin-top: auto;
    padding-top: var(--space-6);
    text-align: center;
}

.app-footer__logo {
    height: 20px;
    width: auto;
    opacity: 0.4;
    margin-bottom: var(--space-2);
}

.app-footer__text {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

/* ============================================================
   AUTH (login / cadastro) — Layout 2 colunas com foto
   ============================================================ */

.auth-layout {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: var(--bg-elevated);
    display: flex;
    flex-direction: column;
}

@media (min-width: 900px) {
    .auth-layout {
        flex-direction: row;
        max-width: 100%;
    }
}

/* Lado esquerdo: foto de fundo */
.auth-hero {
    position: relative;
    background-image:
        linear-gradient(135deg, rgba(27, 107, 160, 0.55), rgba(46, 143, 203, 0.20)),
        url('/static/login.png');
    background-size: cover;
    background-position: center;
    min-height: 240px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: var(--space-5);
    color: white;
}

@media (min-width: 900px) {
    .auth-hero {
        flex: 1.2;
        min-height: 100vh;
        padding: var(--space-7);
    }
}

.auth-hero__brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}

.auth-hero__brand img {
    height: 36px;
    width: auto;
    background: white;
    padding: 6px 12px;
    border-radius: var(--radius-md);
}

.auth-hero__brand-text {
    font-size: var(--font-size-lg);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.auth-hero__title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: white;
    margin-bottom: var(--space-2);
    letter-spacing: -0.02em;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.auth-hero__subtitle {
    font-size: var(--font-size-md);
    color: rgba(255,255,255,0.9);
    margin: 0;
    max-width: 420px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

@media (max-width: 899px) {
    .auth-hero {
        min-height: 200px;
    }
    .auth-hero__title { font-size: var(--font-size-xl); }
    .auth-hero__subtitle { font-size: var(--font-size-sm); }
}

/* Lado direito: formulário */
.auth-form-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--space-6) var(--space-5);
    background: var(--bg-elevated);
}

@media (min-width: 900px) {
    .auth-form-area {
        flex: 1;
        padding: var(--space-7);
        max-width: 480px;
    }
}

.auth-form-wrapper {
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
}

.auth-form-wrapper h1 {
    font-size: var(--font-size-xl);
    margin-bottom: var(--space-1);
}

.auth-form-wrapper p {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-5);
}

/* Footer dentro da auth */
.auth-footer {
    text-align: center;
    margin-top: var(--space-6);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border-subtle);
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.auth-footer img {
    height: 16px;
    width: auto;
    opacity: 0.5;
    vertical-align: middle;
    margin-right: 6px;
}

/* ============================================================
   DASHBOARD - Greeting, Stat, Nav cards, Recent items
   ============================================================ */

.greeting {
    margin-bottom: var(--space-5);
}

.greeting__name {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: var(--space-1);
}

.greeting__subtitle {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

/* Stat card */
.stat-card {
    background: linear-gradient(135deg, var(--color-brand-soft), var(--bg-elevated));
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    margin-bottom: var(--space-5);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    box-shadow: var(--shadow-sm);
}

.stat-card__icon {
    font-size: 28px;
    flex-shrink: 0;
}

.stat-card__label {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    flex: 1;
}

.stat-card__value {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--color-brand);
}

/* Nav grid (cards 2 colunas) */
.nav-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
    margin-top: var(--space-3);
}

.nav-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
    padding: var(--space-4);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: inherit;
    transition: all var(--transition-fast);
    min-height: 110px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.nav-card:hover {
    border-color: var(--border-brand);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: inherit;
}

.nav-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
    background: var(--card-color, var(--color-brand));
    opacity: 0.10;
    border-radius: 0 var(--radius-lg) 0 100%;
}

.nav-card__icon {
    font-size: 28px;
    line-height: 1;
    z-index: 1;
}

.nav-card__title {
    font-size: var(--font-size-md);
    font-weight: 600;
    color: var(--text-primary);
}

.nav-card__subtitle {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin: 0;
}

.nav-card--featured {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    background: linear-gradient(135deg, var(--color-brand-soft) 0%, var(--bg-elevated) 100%);
    border: 1px solid rgba(46, 143, 203, 0.4);
    min-height: 80px;
}

.nav-card--featured .nav-card__icon { font-size: 32px; }
.nav-card--featured::before { display: none; }

/* Recent items (últimas notas) */
.recent-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-top: var(--space-3);
}

.recent-item {
    display: block;
    text-decoration: none;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.recent-item:hover {
    border-color: var(--border-brand);
    transform: translateX(2px);
    color: inherit;
}

.recent-item__header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-2);
}

.recent-item__title {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.recent-item__value {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-brand);
    flex-shrink: 0;
}

.recent-item__date {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-top: 2px;
}

/* Account section */
.account-section {
    margin-top: var(--space-7);
    padding-top: var(--space-5);
    border-top: 1px solid var(--border-subtle);
}

.account-section__email {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-bottom: var(--space-3);
    text-align: center;
}

.account-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
}

/* ============================================================
   LISTAGENS (notas, faturas)
   ============================================================ */

.list-header__count {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-top: var(--space-3);
}

.list-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    text-decoration: none;
    color: inherit;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.list-item:hover {
    border-color: var(--border-brand);
    transform: translateX(2px);
    box-shadow: var(--shadow-md);
    color: inherit;
}

.list-item__icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-brand-soft);
    border-radius: var(--radius-md);
    font-size: 22px;
    flex-shrink: 0;
}

.list-item__body { flex: 1; min-width: 0; }

.list-item__title {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

.list-item__subtitle {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-top: 2px;
}

.list-item__right { text-align: right; flex-shrink: 0; }

.list-item__value {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-brand);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: var(--space-6) var(--space-4);
    color: var(--text-muted);
}

.empty-state__icon {
    font-size: 48px;
    margin-bottom: var(--space-3);
    opacity: 0.5;
}

.empty-state__title {
    font-size: var(--font-size-md);
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
}

.empty-state__subtitle {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-4);
}

/* ============================================================
   ACTION BUTTONS GRANDES (Nova nota - Câmera/Galeria/QR)
   ============================================================ */

.action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
    margin: var(--space-4) 0 var(--space-3);
}

.action-btn-large {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-5) var(--space-3);
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    font-family: inherit;
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    min-height: 110px;
}

.action-btn-large:hover {
    border-color: var(--color-brand);
    background: var(--color-brand-soft);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: var(--text-primary);
}

.action-btn-large__icon {
    font-size: 36px;
    line-height: 1;
}

.action-btn-large__label {
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.action-btn-wide {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px dashed var(--border-default);
    border-radius: var(--radius-lg);
    font-family: inherit;
    font-size: var(--font-size-sm);
    cursor: not-allowed;
    transition: all var(--transition-fast);
    box-shadow: none;
    margin-top: var(--space-3);
}

.action-btn-wide__icon {
    font-size: 24px;
    opacity: 0.6;
}

.action-btn-wide__content {
    text-align: left;
    line-height: 1.2;
}

.action-btn-wide__title {
    font-weight: 600;
    color: var(--text-secondary);
}

.action-btn-wide__hint {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

/* Feature card light theme */
.feature-card {
    background: linear-gradient(135deg, var(--color-brand-soft) 0%, var(--bg-elevated) 100%);
    border: 1px solid rgba(46, 143, 203, 0.3);
    border-radius: var(--radius-xl);
    padding: var(--space-5);
    margin-bottom: var(--space-5);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.feature-card__badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-brand-dark);
    background: rgba(46, 143, 203, 0.15);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    margin-bottom: var(--space-3);
}

.feature-card__title {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.feature-card__subtitle {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin: 0;
}

/* Divider light */
.divider-or {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin: var(--space-6) 0;
    color: var(--text-muted);
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.divider-or::before,
.divider-or::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}

/* Loading card light */
.loading-card {
    background: var(--color-brand-soft);
    border: 1px solid rgba(46, 143, 203, 0.3);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    text-align: center;
    margin-top: var(--space-3);
}

.loading-card__title {
    color: var(--color-brand-dark);
    font-size: var(--font-size-sm);
    font-weight: 600;
    margin-bottom: 4px;
}

.loading-card__subtitle {
    color: var(--text-muted);
    font-size: var(--font-size-xs);
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(46, 143, 203, 0.3);
    border-top-color: var(--color-brand);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: var(--space-2);
    vertical-align: middle;
}

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

/* Photo preview light */
.photo-preview {
    margin-top: var(--space-4);
    padding: var(--space-3);
    background: var(--bg-subtle);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
}

.photo-preview__img {
    width: 100%;
    max-height: 280px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    background: white;
    display: block;
    border: 1px solid var(--border-subtle);
}

.photo-preview__info {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    text-align: center;
    margin-top: var(--space-2);
}

.photo-preview__remove {
    background: transparent;
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
    font-size: var(--font-size-xs);
    padding: 6px 12px;
    width: auto;
    min-height: 32px;
    display: block;
    margin: var(--space-2) auto 0;
    box-shadow: none;
}

.photo-preview__remove:hover {
    background: var(--bg-base);
    box-shadow: none;
}

/* ============================================================
   AJUSTES v2 — Cards mais definidos, foto compacta, modal
   ============================================================ */

/* Foto compacta */
.detail-image-compact {
    margin: var(--space-4) 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
    background: var(--bg-subtle);
    cursor: zoom-in;
    position: relative;
    transition: all var(--transition-fast);
}

.detail-image-compact:hover {
    border-color: var(--color-brand);
    box-shadow: var(--shadow-md);
}

.detail-image-compact img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.detail-image-compact__overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, transparent, rgba(0,0,0,0.6));
    padding: var(--space-3);
    color: white;
    font-size: var(--font-size-xs);
    text-align: center;
    font-weight: 500;
}

/* Modal de imagem (full screen) */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 1000;
    padding: var(--space-4);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.image-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.image-modal__close {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    width: 44px;
    height: 44px;
    min-height: 44px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    margin: 0;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-modal__close:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.5);
    box-shadow: none;
}

.image-modal__img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.image-modal__caption {
    color: white;
    font-size: var(--font-size-sm);
    text-align: center;
    margin-top: var(--space-4);
    opacity: 0.7;
}

/* Section divider (-- INFORMAÇÕES --) */
.section-divider {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin: var(--space-5) 0 var(--space-3);
    color: var(--text-muted);
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.section-divider::before,
.section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}

/* Detail page wrapper - mais compacto */
.detail-header__date {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-top: 2px;
}

.detail-meta-footer {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    text-align: center;
    margin-top: var(--space-4);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border-subtle);
}

/* Group cards - cards das fases de conciliação */
.group-section {
    margin-top: var(--space-5);
}

.group-section__header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
    font-size: var(--font-size-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.group-section__count {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Transação na conciliação - card */
.concil-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    margin-bottom: var(--space-2);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.concil-card--success {
    border-color: rgba(31, 174, 126, 0.3);
    background: linear-gradient(135deg, var(--color-success-soft), var(--bg-card));
}

.concil-card--muted {
    opacity: 0.7;
}

.concil-card__head {
    display: flex;
    justify-content: space-between;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.concil-card__title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
}

.concil-card__value {
    font-weight: 700;
    color: var(--text-primary);
    flex-shrink: 0;
    font-size: var(--font-size-sm);
}

.concil-card__value--credit {
    color: var(--color-success);
}

.concil-card__date {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

/* Candidata (sugestão de nota) */
.candidate {
    background: var(--bg-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    margin-top: var(--space-2);
}

.candidate--alta {
    border-color: rgba(31, 174, 126, 0.4);
    background: var(--color-success-soft);
}

.candidate--media {
    border-color: rgba(232, 154, 62, 0.4);
    background: var(--color-warning-soft);
}

.candidate__head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.candidate__info strong {
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    display: block;
}

.candidate__info-sub {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    margin-top: 2px;
}

.candidate__badge {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-weight: 700;
    flex-shrink: 0;
}

.candidate__badge--alta {
    background: var(--color-success);
    color: white;
}

.candidate__badge--media {
    background: var(--color-warning);
    color: white;
}

.candidate__criterios {
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: var(--space-2);
}

.action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
    margin-top: var(--space-3);
}

.action-row--three {
    grid-template-columns: 1fr 1fr;
}

.action-row > * {
    margin: 0;
    min-height: 40px;
}

.btn-mini {
    font-size: var(--font-size-xs) !important;
    padding: 8px !important;
    min-height: 36px !important;
    box-shadow: none !important;
}

/* ============================================================
   DETAIL v3 — Limpo, sem ícones, foco no conteúdo
   ============================================================ */

.detail-v3-hero {
    margin-bottom: var(--space-5);
}

.detail-v3-hero__title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: var(--space-3);
    letter-spacing: -0.02em;
}

.detail-v3-hero__value {
    font-size: 40px;
    font-weight: 800;
    color: var(--color-brand);
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: var(--space-2);
    font-variant-numeric: tabular-nums;
}

.detail-v3-hero__date {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    font-weight: 500;
}

/* Info table: label esquerda, value direita, linhas separadas */
.info-table {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin: var(--space-3) 0;
}

.info-table__row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-subtle);
}

.info-table__row:last-child {
    border-bottom: none;
}

.info-table__row:nth-child(even) {
    background: var(--bg-subtle);
}

.info-table__label {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    font-weight: 500;
    flex-shrink: 0;
    min-width: 90px;
}

.info-table__value {
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    text-align: right;
    font-weight: 600;
    word-break: break-word;
    flex: 1;
}

.info-table__value a {
    color: var(--color-brand);
}

/* ============================================================
   ITENS DA NOTA
   ============================================================ */

.itens-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin: var(--space-3) 0;
}

.item-card {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.item-card__icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-brand-soft);
    border-radius: var(--radius-md);
    font-size: 18px;
    flex-shrink: 0;
}

.item-card__body {
    flex: 1;
    min-width: 0;
}

.item-card__desc {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-word;
}

.item-card__qty {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-top: 2px;
}

.item-card__total {
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--color-brand);
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}
