/*
 * Extensie pentru wwwroot/modern.css.
 * Păstrează layout-ul și comportamentul existent; schimbă numai limbajul vizual
 * și completează stările Bootstrap/Syncfusion care nu erau acoperite uniform.
 */

html,
body {
    background-color: var(--invoice-theme-canvas);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--invoice-theme-text);
    font-weight: 650;
    letter-spacing: -0.018em;
}

::selection {
    color: var(--invoice-theme-text);
    background: var(--invoice-theme-primary-soft);
}

.page-shell {
    gap: var(--invoice-theme-space-4);
}

.page-title {
    color: var(--invoice-theme-text);
    font-weight: 800;
    letter-spacing: -0.025em;
}

.page-subtitle,
.hint-text {
    color: var(--invoice-theme-text-muted-ui);
}

.content-card,
.toolbar-card,
.data-card-list-empty,
.mobile-pager {
    border-color: var(--invoice-theme-border);
    background: var(--invoice-theme-surface);
}

.content-card {
    border-radius: var(--invoice-theme-radius-md);
    box-shadow: var(--invoice-theme-shadow-sm);
}

.toolbar-card {
    border-radius: var(--invoice-theme-radius-md);
    box-shadow: var(--invoice-theme-shadow-xs);
}

.section-title {
    color: var(--invoice-theme-text-muted-ui);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.09em;
}

.status-badge,
.badge.rounded-pill {
    border-radius: var(--invoice-theme-radius-pill);
}

.status-badge {
    font-weight: 700;
}

/* Bootstrap buttons. */
.btn {
    min-height: 38px;
    border-radius: var(--invoice-theme-radius-sm);
    font-family: var(--invoice-theme-font-sans);
    font-weight: 650;
    box-shadow: var(--invoice-theme-shadow-xs);
    transition:
        color var(--invoice-theme-transition),
        background-color var(--invoice-theme-transition),
        border-color var(--invoice-theme-transition),
        box-shadow var(--invoice-theme-transition),
        transform var(--invoice-theme-transition);
}

.btn-sm {
    min-height: 32px;
}

.btn-lg {
    min-height: 46px;
}

.btn:hover:not(:disabled):not(.disabled) {
    transform: translateY(-1px);
    box-shadow: var(--invoice-theme-shadow-sm);
}

.btn:active:not(:disabled):not(.disabled) {
    transform: translateY(0);
}

.btn:focus-visible,
.btn-check:focus-visible + .btn {
    outline: 2px solid var(--invoice-theme-primary);
    outline-offset: 2px;
    box-shadow: var(--invoice-theme-focus-ring);
}

.btn-primary {
    color: #ffffff;
    border-color: var(--invoice-theme-primary);
    background: linear-gradient(135deg, var(--invoice-theme-primary), var(--invoice-theme-primary-dark));
    box-shadow: 0 7px 18px rgba(38, 53, 140, 0.20);
}

.btn-primary:hover,
.btn-primary:focus-visible {
    color: #ffffff;
    border-color: var(--invoice-theme-primary-dark);
    background: linear-gradient(135deg, #2d3fa0, var(--invoice-theme-primary-dark));
    box-shadow: 0 10px 24px rgba(38, 53, 140, 0.26);
}

.btn-secondary {
    color: #ffffff;
    border-color: var(--invoice-theme-text-muted);
    background: var(--invoice-theme-text-muted);
}

.btn-success {
    color: #ffffff;
    border-color: var(--invoice-theme-success);
    background: var(--invoice-theme-success);
}

.btn-danger {
    color: #ffffff;
    border-color: var(--invoice-theme-danger);
    background: var(--invoice-theme-danger);
}

.btn-warning {
    color: #ffffff;
    border-color: var(--invoice-theme-warning);
    background: var(--invoice-theme-warning);
}

.btn-info {
    color: #ffffff;
    border-color: var(--invoice-theme-info);
    background: var(--invoice-theme-info);
}

.btn-success:hover,
.btn-danger:hover,
.btn-warning:hover,
.btn-info:hover {
    color: #ffffff;
    filter: brightness(0.92);
}

.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-success,
.btn-outline-danger,
.btn-outline-warning,
.btn-outline-info,
.btn-outline-dark {
    background: rgba(255, 255, 255, 0.92);
}

.btn-outline-warning {
    color: var(--invoice-theme-warning);
    border-color: var(--invoice-theme-warning-border);
}

.btn-outline-warning:hover,
.btn-outline-warning:focus-visible {
    color: var(--invoice-theme-warning);
    border-color: var(--invoice-theme-warning);
    background: var(--invoice-theme-warning-soft);
}

.btn:disabled,
.btn.disabled,
fieldset:disabled .btn {
    cursor: not-allowed;
    opacity: 0.48;
    box-shadow: none;
    transform: none;
}

/* Navigation and menus. */
.app-topbar {
    border-bottom-color: var(--invoice-theme-border);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--invoice-theme-shadow-xs);
}

.app-topbar .navbar-brand {
    color: var(--invoice-theme-primary-dark);
    font-weight: 800;
}

.app-topbar .nav-link:focus-visible,
.app-topbar .dropdown-item:focus-visible,
.manage-nav-link:focus-visible,
.quick-link-card:focus-visible {
    outline: 2px solid var(--invoice-theme-primary);
    outline-offset: 2px;
}

.app-topbar .nav-link.active,
.manage-nav-link.active {
    color: var(--invoice-theme-primary);
    background: var(--invoice-theme-primary-soft);
}

.dropdown-menu {
    border-color: var(--invoice-theme-border);
    border-radius: var(--invoice-theme-radius-md);
    background: var(--invoice-theme-surface);
    box-shadow: var(--invoice-theme-shadow-lg);
}

.dropdown-item:hover,
.dropdown-item:focus {
    color: var(--invoice-theme-text);
    background: var(--invoice-theme-surface-muted);
}

/* Bootstrap forms and validation. */
.form-control,
.form-select,
.input-group-text {
    min-height: 40px;
    border-color: var(--invoice-theme-border-strong);
    border-radius: var(--invoice-theme-radius-sm);
    color: var(--invoice-theme-text);
    background-color: var(--invoice-theme-surface);
}

.form-control-sm,
.form-select-sm {
    min-height: 32px;
}

.form-control::placeholder {
    color: var(--invoice-theme-text-muted-ui);
    opacity: 1;
}

.form-control:hover:not(:disabled):not([readonly]),
.form-select:hover:not(:disabled) {
    border-color: var(--invoice-theme-text-muted);
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: var(--invoice-theme-primary);
    box-shadow: var(--invoice-theme-focus-ring);
}

.form-control:disabled,
.form-control[readonly],
.form-select:disabled,
.form-check-input:disabled {
    color: var(--invoice-theme-text-muted-ui);
    border-color: var(--invoice-theme-border);
    background-color: var(--invoice-theme-surface-muted);
    opacity: 0.72;
    cursor: not-allowed;
}

.form-check-input {
    border-color: var(--invoice-theme-border-strong);
}

.form-check-input:checked {
    border-color: var(--invoice-theme-primary);
    background-color: var(--invoice-theme-primary);
}

.form-floating > label,
.form-label {
    color: var(--invoice-theme-text-secondary);
    font-weight: 600;
}

.input-group > :not(:first-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.input-group > :not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.progress {
    height: 10px;
    border-radius: var(--invoice-theme-radius-pill);
    background: var(--invoice-theme-surface-muted);
    box-shadow: inset 0 0 0 1px var(--invoice-theme-border);
}

.progress-bar {
    border-radius: inherit;
}

/* Bootstrap tables, cards and alerts. */
.table {
    --bs-table-color: var(--invoice-theme-text-secondary);
    --bs-table-bg: var(--invoice-theme-surface);
    --bs-table-border-color: var(--invoice-theme-border);
    --bs-table-striped-bg: var(--invoice-theme-surface-soft);
    --bs-table-striped-color: var(--invoice-theme-text-secondary);
    --bs-table-hover-bg: var(--invoice-theme-primary-soft);
    --bs-table-hover-color: var(--invoice-theme-text);
    margin-bottom: 0;
    font-variant-numeric: tabular-nums;
}

.table > thead > tr > th {
    padding-top: 10px;
    padding-bottom: 10px;
    border-bottom-color: var(--invoice-theme-border-strong);
    color: var(--invoice-theme-text-secondary);
    background: var(--invoice-theme-surface-muted);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

.table > tbody > tr > td {
    padding-top: 10px;
    padding-bottom: 10px;
    vertical-align: middle;
}

.table-responsive {
    border-radius: var(--invoice-theme-radius-md);
}

.card {
    border-color: var(--invoice-theme-border);
    border-radius: var(--invoice-theme-radius-md);
    background: var(--invoice-theme-surface);
    box-shadow: var(--invoice-theme-shadow-sm);
}

.card-header,
.card-footer {
    border-color: var(--invoice-theme-border);
    background: var(--invoice-theme-surface-muted);
}

.alert {
    border-radius: var(--invoice-theme-radius-md);
    box-shadow: var(--invoice-theme-shadow-xs);
}

.alert-warning {
    color: var(--invoice-theme-warning-text);
    border-color: var(--invoice-theme-warning-border);
    background: var(--invoice-theme-warning-soft);
}

.alert-info {
    color: var(--invoice-theme-info);
    border-color: var(--invoice-theme-info-border);
    background: var(--invoice-theme-info-soft);
}

/* Syncfusion Fluent2 overrides. */
.e-control,
.e-btn,
.e-css {
    font-family: var(--invoice-theme-font-sans);
}

.e-btn {
    border-radius: var(--invoice-theme-radius-sm);
    font-weight: 650;
}

.e-btn:focus-visible,
.e-input-group:focus-within,
.e-float-input:focus-within {
    outline: 2px solid var(--invoice-theme-primary);
    outline-offset: 1px;
}

.e-input-group,
.e-input-group.e-control-wrapper,
.e-float-input,
.e-float-input.e-control-wrapper {
    border-radius: var(--invoice-theme-radius-sm);
}

.e-float-input.e-input-focus,
.e-input-group.e-input-focus {
    border-color: var(--invoice-theme-primary);
    box-shadow: var(--invoice-theme-focus-ring);
}

.e-input-group.e-disabled,
.e-float-input.e-disabled,
.e-control.e-disabled {
    color: var(--invoice-theme-text-muted);
    background: var(--invoice-theme-surface-muted);
    opacity: 0.65;
}

.e-popup,
.e-ddl.e-popup,
.e-datepicker.e-popup-wrapper,
.e-daterangepicker.e-popup {
    border-color: var(--invoice-theme-border);
    border-radius: var(--invoice-theme-radius-md);
    box-shadow: var(--invoice-theme-shadow-lg);
}

.e-grid {
    border-color: var(--invoice-theme-border);
    border-radius: var(--invoice-theme-radius-md);
    background: var(--invoice-theme-surface);
    box-shadow: var(--invoice-theme-shadow-sm);
}

.e-grid .e-gridheader,
.e-grid .e-headercell,
.e-grid .e-headercelldiv {
    color: var(--invoice-theme-text-secondary);
    background: var(--invoice-theme-surface-muted);
}

.e-grid .e-headercell,
.e-grid .e-headercelldiv {
    font-weight: 800;
    letter-spacing: 0.02em;
}

.e-grid .e-rowcell {
    border-color: #edf0f4;
    color: var(--invoice-theme-text-secondary);
}

.e-grid .e-row:hover .e-rowcell,
.e-grid .e-row.e-selectionbackground .e-rowcell {
    color: var(--invoice-theme-text);
    background: var(--invoice-theme-primary-soft);
}

.e-pager .e-currentitem,
.e-pager .e-currentitem:hover {
    background: var(--invoice-theme-primary);
}

.e-tab .e-tab-header .e-toolbar-item.e-active .e-tab-text {
    color: var(--invoice-theme-primary);
}

.e-tab .e-tab-header .e-indicator {
    background: linear-gradient(90deg, var(--invoice-theme-primary), var(--invoice-theme-accent));
}

.e-dialog,
.modern-dialog.e-dialog,
.app-modal-panel,
.auth-card {
    border-color: var(--invoice-theme-border);
    border-radius: var(--invoice-theme-radius-lg);
    background: var(--invoice-theme-surface);
    box-shadow: var(--invoice-theme-shadow-lg);
}

.e-dlg-overlay,
.app-modal-backdrop {
    background: rgba(23, 32, 51, 0.45);
}

.e-toast-container .e-toast {
    border-radius: var(--invoice-theme-radius-md);
    box-shadow: var(--invoice-theme-shadow-lg);
}

.e-spinner-pane.e-spin-overlay {
    background: rgba(23, 32, 51, 0.28);
}

.e-spinner-pane.e-spin-overlay .e-spinner-inner {
    border-color: var(--invoice-theme-border);
    border-radius: var(--invoice-theme-radius-lg);
    box-shadow: var(--invoice-theme-shadow-lg);
}

.e-spinner-pane .e-spin-fabric .e-path-circle,
.e-spinner-pane .e-spin-fluent .e-path-circle,
.e-spinner-pane .e-spin-fluent2 .e-path-circle {
    stroke: rgba(38, 53, 140, 0.15);
}

/* Cardurile responsive și filtrele existente. */
.data-card {
    border-color: var(--invoice-theme-border);
    border-left-color: var(--invoice-theme-border-strong);
    border-radius: var(--invoice-theme-radius-md);
    background: var(--invoice-theme-surface);
    box-shadow: var(--invoice-theme-shadow-xs);
    transition: border-color var(--invoice-theme-transition), box-shadow var(--invoice-theme-transition);
}

.data-card:hover {
    border-color: rgba(38, 53, 140, 0.28);
    box-shadow: var(--invoice-theme-shadow-sm);
}

.data-chip,
.mobile-pager-btn,
.filter-toggle,
.e-dropdown-btn.action-export {
    border-color: var(--invoice-theme-border-strong);
    border-radius: var(--invoice-theme-radius-sm);
    background: var(--invoice-theme-surface);
    box-shadow: var(--invoice-theme-shadow-xs);
}

.data-chip {
    border-radius: var(--invoice-theme-radius-pill);
}

.data-chip:hover,
.data-chip:focus-visible,
.mobile-pager-btn:hover:not(:disabled),
.filter-toggle:hover,
.e-dropdown-btn.action-export:hover {
    color: var(--invoice-theme-primary);
    border-color: rgba(38, 53, 140, 0.38);
    background: var(--invoice-theme-primary-soft);
}

.quick-link-card:hover {
    border-color: rgba(38, 53, 140, 0.38);
    box-shadow: var(--invoice-theme-shadow-md);
}

.quick-link-card i,
.app-modal-title i,
.auth-card svg {
    color: var(--invoice-theme-primary);
    fill: var(--invoice-theme-primary);
}

@media (max-width: 575.98px) {
    .content-card {
        padding: 16px;
    }

    .auth-card {
        padding: 30px 22px 26px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .btn,
    .data-card,
    .quick-link-card,
    .app-modal-panel,
    .container-confirm {
        animation: none;
        transition: none;
    }
}
