:root {
    --app-md-bg: #f6f8fb;
    --app-md-surface: #ffffff;
    --app-md-surface-soft: #f8fafc;
    --app-md-border: #d8e2ee;
    --app-md-row-border: #c6d3e1;
    --app-md-column-border: #d6e2ee;
    --app-md-text: #162231;
    --app-md-muted: #64748b;
    --app-md-primary: #12845f;
    --app-md-primary-dark: #0f6f52;
    --app-md-primary-soft: #e7f7ef;
    --app-md-danger: #b42318;
    --app-md-danger-soft: #fff1f0;
    --app-md-warning: #b45309;
    --app-md-warning-soft: #fff7ed;
    --app-md-info: #2563eb;
    --app-md-info-soft: #eff6ff;
    --app-md-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
    --app-md-radius: 8px;
}

.app-md-shell {
    background: var(--app-md-bg);
    color: var(--app-md-text);
}

.app-md-shell .main-content {
    background: var(--app-md-bg);
}

.app-md-shell .main-content > .page-header,
.app-md-shell .main-content .container > .section.active > .section-header,
.app-md-shell .main-content .dashboard-header,
.app-md-shell .main-content .settings-header,
.app-md-shell .main-content .module-header,
.app-md-shell .main-content .calendar-header,
.app-md-shell .main-content .webshop-header,
.app-md-shell .main-content .marketing-header,
.app-md-shell .main-content .process-header,
.app-md-shell .main-content .cashflow-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 1rem !important;
    margin: 1rem !important;
    padding: 1rem 1.15rem !important;
    background: var(--app-md-surface) !important;
    border: 1px solid var(--app-md-border) !important;
    border-radius: var(--app-md-radius) !important;
    box-shadow: var(--app-md-shadow) !important;
}

.app-md-shell .main-content > .page-header .page-header-right,
.app-md-shell .main-content .section-header .section-actions,
.app-md-shell .main-content .header-actions,
.app-md-shell .main-content .toolbar-actions,
.app-md-shell .main-content .actions-bar {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex-wrap: wrap !important;
    gap: 0.55rem !important;
}

.app-md-shell .main-content > .page-header h1,
.app-md-shell .main-content .section-header h2,
.app-md-shell .main-content .dashboard-header h1,
.app-md-shell .main-content .settings-header h1,
.app-md-shell .main-content .module-header h1,
.app-md-shell .main-content .calendar-header h1,
.app-md-shell .main-content .webshop-header h1,
.app-md-shell .main-content .marketing-header h1,
.app-md-shell .main-content .process-header h1,
.app-md-shell .main-content .cashflow-header h1 {
    margin: 0 !important;
    color: var(--app-md-text) !important;
    font-size: clamp(1.45rem, 2vw, 2rem) !important;
    line-height: 1.12 !important;
    letter-spacing: 0 !important;
    font-weight: 850 !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.65rem !important;
}

.app-md-shell .main-content > .page-header h1 i,
.app-md-shell .main-content .section-header h2 i,
.app-md-shell .main-content .dashboard-header h1 i,
.app-md-shell .main-content .settings-header h1 i,
.app-md-shell .main-content .module-header h1 i {
    display: inline-grid !important;
    place-items: center !important;
    width: 2.4rem !important;
    height: 2.4rem !important;
    color: var(--app-md-primary) !important;
    background: var(--app-md-primary-soft) !important;
    border: 1px solid #b7f0cd !important;
    border-radius: 8px !important;
}

.app-md-shell .main-content .page-description,
.app-md-shell .main-content .section-subtitle,
.app-md-shell .main-content .header-description,
.app-md-shell .main-content .text-muted {
    color: var(--app-md-muted) !important;
}

.app-md-shell .main-content .page-description,
.app-md-shell .main-content .section-subtitle,
.app-md-shell .main-content .header-description {
    margin: 0.35rem 0 0 !important;
    font-size: 0.95rem !important;
    line-height: 1.35 !important;
}

.app-md-shell .main-content .container,
.app-md-shell .main-content .dashboard-container,
.app-md-shell .main-content .settings-container,
.app-md-shell .main-content .calendar-container,
.app-md-shell .main-content .webshop-container,
.app-md-shell .main-content .marketing-container,
.app-md-shell .main-content .cashflow-container,
.app-md-shell .main-content .content-container {
    width: 100% !important;
    max-width: none !important;
    padding: 0 1rem 1.25rem !important;
    margin: 0 !important;
}

.app-md-shell .main-content .filters-bar:not([style*="display: none"]),
.app-md-shell .main-content .filters-container:not([style*="display: none"]),
.app-md-shell .main-content .filters-row:not([style*="display: none"]),
.app-md-shell .main-content .filter-bar:not([style*="display: none"]),
.app-md-shell .main-content .filters-section:not([style*="display: none"]),
.app-md-shell .main-content .filter-section:not([style*="display: none"]),
.app-md-shell .main-content .toolbar:not([style*="display: none"]),
.app-md-shell .main-content .search-filter-bar:not([style*="display: none"]),
.app-md-shell .main-content .table-toolbar:not([style*="display: none"]) {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 0.65rem !important;
    margin: 0 !important;
    padding: 0.85rem 1rem !important;
    background: var(--app-md-surface) !important;
    border: 1px solid var(--app-md-border) !important;
    border-radius: var(--app-md-radius) var(--app-md-radius) 0 0 !important;
    box-shadow: var(--app-md-shadow) !important;
}

.app-md-shell .main-content .search-box,
.app-md-shell .main-content .filter-group,
.app-md-shell .main-content .filter-field,
.app-md-shell .main-content .filters-row > * {
    min-width: 180px !important;
    flex: 1 1 220px !important;
}

.app-md-shell .main-content input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
.app-md-shell .main-content .filter-input,
.app-md-shell .main-content select,
.app-md-shell .main-content .filter-select,
.app-md-shell .main-content textarea,
.app-md-shell .modal input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
.app-md-shell .modal select,
.app-md-shell .modal textarea,
.app-md-shell .modal-overlay input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
.app-md-shell .modal-overlay select,
.app-md-shell .modal-overlay textarea {
    width: 100%;
    min-height: 42px !important;
    padding: 0.55rem 0.7rem !important;
    color: var(--app-md-text) !important;
    background: #fff !important;
    border: 1px solid var(--app-md-border) !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    font-size: 0.94rem !important;
    line-height: 1.35 !important;
}

.app-md-shell .main-content textarea,
.app-md-shell .modal textarea,
.app-md-shell .modal-overlay textarea {
    min-height: 92px !important;
}

.app-md-shell .modal .otp-digit,
.app-md-shell .modal-overlay .otp-digit,
.app-md-shell .login-overlay .otp-digit-login {
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    height: 50px !important;
    min-height: 50px !important;
    flex: 0 0 40px !important;
    padding: 0 !important;
    text-align: center !important;
    font-size: 1.4rem !important;
    font-variant-numeric: tabular-nums !important;
}

.app-md-shell .main-content input:focus,
.app-md-shell .main-content select:focus,
.app-md-shell .main-content textarea:focus,
.app-md-shell .modal input:focus,
.app-md-shell .modal select:focus,
.app-md-shell .modal textarea:focus,
.app-md-shell .modal-overlay input:focus,
.app-md-shell .modal-overlay select:focus,
.app-md-shell .modal-overlay textarea:focus {
    outline: 2px solid rgba(18, 132, 95, 0.18) !important;
    border-color: var(--app-md-primary) !important;
}

.app-md-shell .btn,
.app-md-shell button.btn,
.app-md-shell .btn-primary,
.app-md-shell .btn-secondary,
.app-md-shell .btn-success,
.app-md-shell .btn-danger,
.app-md-shell .btn-warning,
.app-md-shell .btn-info {
    min-height: 40px !important;
    padding: 0.55rem 0.9rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.45rem !important;
    border-radius: 8px !important;
    border: 1px solid var(--app-md-border) !important;
    font-weight: 750 !important;
    line-height: 1.1 !important;
    text-decoration: none !important;
    cursor: pointer !important;
    box-shadow: none !important;
    transform: none !important;
    white-space: nowrap !important;
}

.app-md-shell .btn-primary,
.app-md-shell .btn-success {
    color: #fff !important;
    background: var(--app-md-primary) !important;
    border-color: var(--app-md-primary) !important;
}

.app-md-shell .btn-primary:hover,
.app-md-shell .btn-success:hover {
    background: var(--app-md-primary-dark) !important;
    border-color: var(--app-md-primary-dark) !important;
}

.app-md-shell .btn-secondary,
.app-md-shell .btn-light,
.app-md-shell .btn-outline-secondary {
    color: var(--app-md-text) !important;
    background: #fff !important;
}

.app-md-shell .btn-danger,
.app-md-shell .btn-outline-danger {
    color: var(--app-md-danger) !important;
    background: var(--app-md-danger-soft) !important;
    border-color: #fecaca !important;
}

.app-md-shell .btn-warning {
    color: var(--app-md-warning) !important;
    background: var(--app-md-warning-soft) !important;
    border-color: #fed7aa !important;
}

.app-md-shell .btn-info {
    color: #0f4f8f !important;
    background: var(--app-md-info-soft) !important;
    border-color: #bfdbfe !important;
}

.app-md-shell .btn-sm,
.app-md-shell .action-btn,
.app-md-shell .icon-btn,
.app-md-shell .table-action-btn {
    min-width: 36px !important;
    min-height: 36px !important;
    padding: 0.45rem !important;
}

.app-md-shell .summary-cards-container:not([style*="display: none"]),
.app-md-shell .stats-grid,
.app-md-shell .dashboard-stats,
.app-md-shell .cards-grid,
.app-md-shell .kpi-grid,
.app-md-shell .stat-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)) !important;
    gap: 0.75rem !important;
    margin: 0 0 1rem !important;
}

.app-md-shell .summary-card,
.app-md-shell .stat-card,
.app-md-shell .stats-card,
.app-md-shell .dashboard-card,
.app-md-shell .info-card,
.app-md-shell .card,
.app-md-shell .settings-card,
.app-md-shell .chart-card,
.app-md-shell .table-card,
.app-md-shell .module-card,
.app-md-shell .feature-card,
.app-md-shell .form-card,
.app-md-shell .detail-card,
.app-md-shell .panel,
.app-md-shell .surface {
    background: var(--app-md-surface) !important;
    border: 1px solid var(--app-md-border) !important;
    border-radius: var(--app-md-radius) !important;
    box-shadow: var(--app-md-shadow) !important;
}

.app-md-shell .summary-card::before,
.app-md-shell .stat-card::before,
.app-md-shell .stats-card::before,
.app-md-shell .dashboard-card::before,
.app-md-shell .info-card::before,
.app-md-shell .card::before {
    display: none !important;
}

.app-md-shell .summary-card,
.app-md-shell .stat-card,
.app-md-shell .stats-card,
.app-md-shell .dashboard-card,
.app-md-shell .info-card {
    padding: 0.9rem 1rem !important;
    min-height: auto !important;
}

.app-md-shell .summary-card-title,
.app-md-shell .stat-label,
.app-md-shell .kpi-label,
.app-md-shell .metric-label {
    color: var(--app-md-muted) !important;
    font-size: 0.8rem !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0 !important;
}

.app-md-shell .summary-card-value,
.app-md-shell .stat-value,
.app-md-shell .kpi-value,
.app-md-shell .metric-value {
    color: var(--app-md-text) !important;
    font-size: clamp(1.25rem, 2vw, 1.8rem) !important;
    line-height: 1.15 !important;
    font-weight: 850 !important;
}

.app-md-shell .customer-table-container,
.app-md-shell .table-container,
.app-md-shell .table-responsive,
.app-md-shell .import-scroll-container,
.app-md-shell .source-table-wrap,
.app-md-shell .webshop-table-container,
.app-md-shell .marketing-table-container,
.app-md-shell .preview-table-container,
.app-md-shell .csv-preview-table,
.app-md-shell .login-logs-table-container,
.app-md-shell .rate-limited-table-container,
.app-md-shell .calendar-table-container,
.app-md-shell .table-body,
.app-md-shell .settings-table-wrap,
.app-md-shell .data-table-wrap,
.app-md-shell .cf-table-wrap {
    width: 100% !important;
    max-width: 100% !important;
    max-height: none !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
    background: var(--app-md-surface) !important;
    border: 1px solid var(--app-md-border) !important;
    border-radius: var(--app-md-radius) !important;
    box-shadow: var(--app-md-shadow) !important;
}

.app-md-shell .filters-bar + .customer-table-container,
.app-md-shell .filters-container + .customer-table-container,
.app-md-shell .filters-row + .customer-table-container,
.app-md-shell .filters-bar + .table-container,
.app-md-shell .filters-container + .table-container,
.app-md-shell .filters-bar + .table-responsive,
.app-md-shell .filters-container + .table-responsive,
.app-md-shell .filter-bar + .customer-table-container,
.app-md-shell .filter-section + .customer-table-container {
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
    border-top: 0 !important;
}

.app-md-shell .main-content table,
.app-md-shell .modal table,
.app-md-shell .modal-overlay table {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    table-layout: fixed !important;
    background: #fff !important;
}

.app-md-shell .main-content table.customer-table,
.app-md-shell .main-content table.data-table,
.app-md-shell .main-content table.settings-table,
.app-md-shell .main-content table.import-table,
.app-md-shell .main-content table.tr-table,
.app-md-shell .main-content table.lead-table,
.app-md-shell .main-content table.source-table,
.app-md-shell .main-content table.templates-table,
.app-md-shell .main-content table.travel-entries-table,
.app-md-shell .main-content table.table,
.app-md-shell .modal table.customer-table,
.app-md-shell .modal table.data-table,
.app-md-shell .modal table.settings-table,
.app-md-shell .modal table.import-table,
.app-md-shell .modal table.tr-table,
.app-md-shell .modal table.lead-table,
.app-md-shell .modal table.source-table,
.app-md-shell .modal table.templates-table,
.app-md-shell .modal table.travel-entries-table,
.app-md-shell .modal table.table,
.app-md-shell .modal-overlay table.customer-table,
.app-md-shell .modal-overlay table.data-table,
.app-md-shell .modal-overlay table.settings-table,
.app-md-shell .modal-overlay table.import-table,
.app-md-shell .modal-overlay table.tr-table,
.app-md-shell .modal-overlay table.lead-table,
.app-md-shell .modal-overlay table.source-table,
.app-md-shell .modal-overlay table.templates-table,
.app-md-shell .modal-overlay table.travel-entries-table,
.app-md-shell .modal-overlay table.table {
    min-width: 0 !important;
}

.app-md-shell .main-content table th,
.app-md-shell .main-content table td,
.app-md-shell .modal table th,
.app-md-shell .modal table td,
.app-md-shell .modal-overlay table th,
.app-md-shell .modal-overlay table td {
    min-width: 0 !important;
    padding: 0.7rem 0.7rem !important;
    color: var(--app-md-text) !important;
    border-right: 1px solid var(--app-md-column-border) !important;
    border-bottom: 1px solid var(--app-md-row-border) !important;
    vertical-align: middle !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
    line-height: 1.35 !important;
}

.app-md-shell .main-content table th:last-child,
.app-md-shell .main-content table td:last-child,
.app-md-shell .modal table th:last-child,
.app-md-shell .modal table td:last-child,
.app-md-shell .modal-overlay table th:last-child,
.app-md-shell .modal-overlay table td:last-child {
    border-right: 0 !important;
}

.app-md-shell .main-content table thead th,
.app-md-shell .modal table thead th,
.app-md-shell .modal-overlay table thead th {
    background: #edf3f8 !important;
    color: #415066 !important;
    font-size: 0.78rem !important;
    font-weight: 850 !important;
    text-transform: uppercase !important;
    letter-spacing: 0 !important;
    white-space: normal !important;
}

.app-md-shell .main-content table tbody tr:hover,
.app-md-shell .modal table tbody tr:hover,
.app-md-shell .modal-overlay table tbody tr:hover {
    background: #f4fbf7 !important;
}

.app-md-shell .main-content table tbody td,
.app-md-shell .modal table tbody td,
.app-md-shell .modal-overlay table tbody td {
    font-size: 0.92rem !important;
    border-bottom: 1px solid var(--app-md-row-border) !important;
    min-width: 0;
    overflow-wrap: anywhere !important;
    white-space: normal;
}

.app-md-shell .main-content table td:nth-last-child(1),
.app-md-shell .main-content table th:nth-last-child(1),
.app-md-shell .modal table td:nth-last-child(1),
.app-md-shell .modal table th:nth-last-child(1),
.app-md-shell .modal-overlay table td:nth-last-child(1),
.app-md-shell .modal-overlay table th:nth-last-child(1) {
    text-align: center !important;
}

.app-md-shell .main-content table td[data-label*="összeg" i],
.app-md-shell .main-content table td[data-label*="ár" i],
.app-md-shell .main-content table td[data-label*="db" i],
.app-md-shell .main-content table .amount,
.app-md-shell .main-content table .number,
.app-md-shell .main-content table .currency,
.app-md-shell .modal table .amount,
.app-md-shell .modal table .number,
.app-md-shell .modal table .currency,
.app-md-shell .modal-overlay table .amount,
.app-md-shell .modal-overlay table .number,
.app-md-shell .modal-overlay table .currency {
    text-align: right !important;
    white-space: nowrap !important;
    font-variant-numeric: tabular-nums !important;
}

.app-md-shell .table-actions,
.app-md-shell .row-actions,
.app-md-shell .actions,
.app-md-shell .action-buttons,
.app-md-shell .action-cell,
.app-md-shell .table-actions-cell,
.app-md-shell .button-group {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-wrap: nowrap !important;
    gap: 0.35rem !important;
    white-space: nowrap !important;
}

.app-md-shell .main-content [style*="border-left: 3px"],
.app-md-shell .main-content [style*="border-left:3px"],
.app-md-shell .main-content [style*="border-left: 4px"],
.app-md-shell .main-content [style*="border-left:4px"],
.app-md-shell .modal [style*="border-left: 3px"],
.app-md-shell .modal [style*="border-left:3px"],
.app-md-shell .modal [style*="border-left: 4px"],
.app-md-shell .modal [style*="border-left:4px"],
.app-md-shell .modal-overlay [style*="border-left: 3px"],
.app-md-shell .modal-overlay [style*="border-left:3px"],
.app-md-shell .modal-overlay [style*="border-left: 4px"],
.app-md-shell .modal-overlay [style*="border-left:4px"] {
    border-left: 1px solid var(--app-md-border) !important;
}

.app-md-shell .badge,
.app-md-shell .status-badge,
.app-md-shell .tag,
.app-md-shell .chip,
.app-md-shell .pill,
.app-md-shell .stat-badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    min-height: 24px !important;
    padding: 0.25rem 0.55rem !important;
    border-radius: 999px !important;
    border: 1px solid transparent !important;
    font-size: 0.78rem !important;
    font-weight: 800 !important;
    line-height: 1.1 !important;
    white-space: normal !important;
}

.app-md-shell .tabs,
.app-md-shell .tab-nav,
.app-md-shell .tab-bar,
.app-md-shell .settings-tabs,
.app-md-shell .panel-tabs,
.app-md-shell .nav-tabs {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 0.35rem !important;
    padding: 0.45rem !important;
    background: var(--app-md-surface-soft) !important;
    border: 1px solid var(--app-md-border) !important;
    border-radius: var(--app-md-radius) !important;
}

.app-md-shell .tab-button,
.app-md-shell .tab-btn,
.app-md-shell .tab,
.app-md-shell .settings-tab,
.app-md-shell .panel-tab,
.app-md-shell .nav-tab {
    min-height: 38px !important;
    padding: 0.5rem 0.75rem !important;
    color: var(--app-md-muted) !important;
    background: transparent !important;
    border: 1px solid transparent !important;
    border-radius: 7px !important;
    font-weight: 800 !important;
}

.app-md-shell .tab-button.active,
.app-md-shell .tab-btn.active,
.app-md-shell .tab.active,
.app-md-shell .settings-tab.active,
.app-md-shell .panel-tab.active,
.app-md-shell .nav-tab.active {
    color: var(--app-md-primary) !important;
    background: var(--app-md-primary-soft) !important;
    border-color: #b7f0cd !important;
}

.app-md-shell .pagination:not([style*="display: none"]),
.app-md-shell .pagination-container:not([style*="display: none"]),
.app-md-shell .pagination-controls:not([style*="display: none"]) {
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 0.4rem !important;
    padding: 0.85rem 1rem !important;
    background: var(--app-md-surface) !important;
    border: 1px solid var(--app-md-border) !important;
    border-top: 0 !important;
    border-radius: 0 0 var(--app-md-radius) var(--app-md-radius) !important;
}

.app-md-shell .form-row:not([style*="display: none"]),
.app-md-shell .form-grid:not([style*="display: none"]),
.app-md-shell .modal .form-row:not([style*="display: none"]),
.app-md-shell .modal-overlay .form-row:not([style*="display: none"]),
.app-md-shell .modal .form-grid:not([style*="display: none"]),
.app-md-shell .modal-overlay .form-grid:not([style*="display: none"]) {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
    gap: 0.75rem !important;
}

.app-md-shell .form-group:not([style*="display: none"]),
.app-md-shell .field-group:not([style*="display: none"]),
.app-md-shell .modal .form-group:not([style*="display: none"]),
.app-md-shell .modal-overlay .form-group:not([style*="display: none"]) {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.35rem !important;
    margin: 0 0 0.75rem !important;
}

.app-md-shell .form-group label,
.app-md-shell .field-group label,
.app-md-shell .modal label,
.app-md-shell .modal-overlay label {
    color: #4b5b70 !important;
    font-size: 0.8rem !important;
    font-weight: 850 !important;
    text-transform: uppercase !important;
    letter-spacing: 0 !important;
}

.app-md-shell .form-actions,
.app-md-shell .modal-actions,
.app-md-shell .modal .modal-footer,
.app-md-shell .modal-overlay .modal-footer {
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 0.55rem !important;
}

.app-md-shell .modal,
.app-md-shell .modal-overlay {
    z-index: 5200 !important;
}

.app-md-shell .modal.active,
.app-md-shell .modal.show,
.app-md-shell .modal[style*="display: flex"],
.app-md-shell .modal[style*="display: block"],
.app-md-shell .modal-overlay.active,
.app-md-shell .modal-overlay.show,
.app-md-shell .modal-overlay[style*="display: flex"],
.app-md-shell .modal-overlay[style*="display: block"] {
    position: fixed !important;
    inset: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 1.25rem !important;
    background: rgba(15, 23, 42, 0.58) !important;
    overflow: auto !important;
}

.app-md-shell .modal.active .modal-content,
.app-md-shell .modal.show .modal-content,
.app-md-shell .modal[style*="display: flex"] .modal-content,
.app-md-shell .modal[style*="display: block"] .modal-content,
.app-md-shell .modal-overlay.active .modal-content,
.app-md-shell .modal-overlay.show .modal-content,
.app-md-shell .modal-overlay[style*="display: flex"] .modal-content,
.app-md-shell .modal-overlay[style*="display: block"] .modal-content {
    width: min(980px, calc(100vw - 2.5rem)) !important;
    max-height: calc(100vh - 2.5rem) !important;
    display: flex !important;
    flex-direction: column !important;
    background: #fff !important;
    border: 1px solid var(--app-md-border) !important;
    border-radius: 10px !important;
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.24) !important;
    overflow: hidden !important;
}

.app-md-shell .modal.active .modal-content.large,
.app-md-shell .modal.active .modal-content.modal-lg,
.app-md-shell .modal.active .modal-content.modal-large,
.app-md-shell .modal-overlay.active .modal-content.large,
.app-md-shell .modal-overlay.active .modal-content.modal-lg,
.app-md-shell .modal-overlay.active .modal-content.modal-large,
.app-md-shell .modal[style*="display: flex"] .modal-content.large,
.app-md-shell .modal[style*="display: block"] .modal-content.large {
    width: min(1180px, calc(100vw - 2.5rem)) !important;
}

.app-md-shell .modal .modal-header,
.app-md-shell .modal-overlay .modal-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 1rem !important;
    padding: 1rem 1.15rem !important;
    border-bottom: 1px solid var(--app-md-border) !important;
    background: #fff !important;
}

.app-md-shell .modal .modal-header h2,
.app-md-shell .modal .modal-header h3,
.app-md-shell .modal .modal-title,
.app-md-shell .modal-overlay .modal-header h2,
.app-md-shell .modal-overlay .modal-header h3,
.app-md-shell .modal-overlay .modal-title {
    margin: 0 !important;
    color: var(--app-md-text) !important;
    font-size: 1.35rem !important;
    line-height: 1.15 !important;
    font-weight: 850 !important;
}

.app-md-shell .modal .modal-close,
.app-md-shell .modal .close-modal,
.app-md-shell .modal .close-btn,
.app-md-shell .modal .btn-close,
.app-md-shell .modal-overlay .modal-close,
.app-md-shell .modal-overlay .close-modal,
.app-md-shell .modal-overlay .close-btn,
.app-md-shell .modal-overlay .btn-close {
    min-width: 42px !important;
    width: 42px !important;
    height: 42px !important;
    display: inline-grid !important;
    place-items: center !important;
    color: var(--app-md-muted) !important;
    background: #fff !important;
    border: 1px solid var(--app-md-border) !important;
    border-radius: 8px !important;
    font-size: 1.35rem !important;
    font-weight: 700 !important;
    cursor: pointer !important;
}

.app-md-shell .modal .modal-body,
.app-md-shell .modal-overlay .modal-body {
    padding: 1rem 1.15rem !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    flex: 1 1 auto !important;
}

.app-md-shell .modal .modal-footer,
.app-md-shell .modal-overlay .modal-footer {
    padding: 0.85rem 1.15rem !important;
    border-top: 1px solid var(--app-md-border) !important;
    background: #fff !important;
    flex: 0 0 auto !important;
}

.app-md-shell .modal.active .modal-content[style*="max-height"],
.app-md-shell .modal.show .modal-content[style*="max-height"],
.app-md-shell .modal[style*="display: flex"] .modal-content[style*="max-height"],
.app-md-shell .modal[style*="display: block"] .modal-content[style*="max-height"],
.app-md-shell .modal-overlay.active .modal-content[style*="max-height"],
.app-md-shell .modal-overlay.show .modal-content[style*="max-height"],
.app-md-shell .modal-overlay[style*="display: flex"] .modal-content[style*="max-height"],
.app-md-shell .modal-overlay[style*="display: block"] .modal-content[style*="max-height"] {
    max-height: none !important;
    overflow: visible !important;
}

.app-md-shell .modal.active .modal-content[style*="max-height"] .modal-body,
.app-md-shell .modal.show .modal-content[style*="max-height"] .modal-body,
.app-md-shell .modal[style*="display: flex"] .modal-content[style*="max-height"] .modal-body,
.app-md-shell .modal[style*="display: block"] .modal-content[style*="max-height"] .modal-body,
.app-md-shell .modal-overlay.active .modal-content[style*="max-height"] .modal-body,
.app-md-shell .modal-overlay.show .modal-content[style*="max-height"] .modal-body,
.app-md-shell .modal-overlay[style*="display: flex"] .modal-content[style*="max-height"] .modal-body,
.app-md-shell .modal-overlay[style*="display: block"] .modal-content[style*="max-height"] .modal-body {
    overflow: visible !important;
}

.app-md-shell .loading,
.app-md-shell .spinner,
.app-md-shell .loading-spinner {
    color: var(--app-md-primary) !important;
}

.app-md-shell .empty-state,
.app-md-shell .error-state,
.app-md-shell .loading-state {
    background: var(--app-md-surface) !important;
    border: 1px dashed var(--app-md-border) !important;
    border-radius: var(--app-md-radius) !important;
    color: var(--app-md-muted) !important;
    padding: 1.25rem !important;
    text-align: center !important;
}

.app-md-shell .login-overlay {
    background: rgba(15, 23, 42, 0.58) !important;
}

.app-md-shell .login-card {
    background: var(--app-md-surface) !important;
    border: 1px solid var(--app-md-border) !important;
    border-radius: 10px !important;
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.24) !important;
}

.app-md-shell .login-card h2 {
    color: var(--app-md-text) !important;
    font-weight: 850 !important;
    letter-spacing: 0 !important;
}

.app-md-shell .login-card .form-group label {
    color: #4b5b70 !important;
    font-size: 0.8rem !important;
    font-weight: 850 !important;
    text-transform: uppercase !important;
    letter-spacing: 0 !important;
}

.app-md-shell .login-card input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) {
    min-height: 42px !important;
    border: 1px solid var(--app-md-border) !important;
    border-radius: 8px !important;
}

@media (max-width: 900px) {
    .app-md-shell .main-content > .page-header,
    .app-md-shell .main-content .container > .section.active > .section-header,
    .app-md-shell .main-content .dashboard-header,
    .app-md-shell .main-content .settings-header,
    .app-md-shell .main-content .module-header {
        align-items: flex-start !important;
        flex-direction: column !important;
    }

    .app-md-shell .main-content > .page-header .page-header-right,
    .app-md-shell .main-content .section-header .section-actions,
    .app-md-shell .main-content .header-actions {
        width: 100% !important;
        justify-content: flex-start !important;
    }

    .app-md-shell .main-content .filters-bar,
    .app-md-shell .main-content .filter-bar,
    .app-md-shell .main-content .filter-section,
    .app-md-shell .main-content .toolbar {
        align-items: stretch !important;
    }

    .app-md-shell .main-content .filters-bar > *,
    .app-md-shell .main-content .filter-bar > *,
    .app-md-shell .main-content .filter-section > *,
    .app-md-shell .main-content .toolbar > * {
        flex: 1 1 100% !important;
        min-width: 0 !important;
    }

    .app-md-shell .main-content table th,
    .app-md-shell .main-content table td,
    .app-md-shell .modal table th,
    .app-md-shell .modal table td,
    .app-md-shell .modal-overlay table th,
    .app-md-shell .modal-overlay table td {
        padding: 0.5rem 0.42rem !important;
        font-size: 0.8rem !important;
    }

    .app-md-shell .modal.active,
    .app-md-shell .modal.show,
    .app-md-shell .modal[style*="display: flex"],
    .app-md-shell .modal[style*="display: block"],
    .app-md-shell .modal-overlay.active,
    .app-md-shell .modal-overlay.show,
    .app-md-shell .modal-overlay[style*="display: flex"],
    .app-md-shell .modal-overlay[style*="display: block"] {
        padding: 0.5rem !important;
    }

    .app-md-shell .modal.active .modal-content,
    .app-md-shell .modal.show .modal-content,
    .app-md-shell .modal[style*="display: flex"] .modal-content,
    .app-md-shell .modal[style*="display: block"] .modal-content,
    .app-md-shell .modal-overlay.active .modal-content,
    .app-md-shell .modal-overlay.show .modal-content,
    .app-md-shell .modal-overlay[style*="display: flex"] .modal-content,
    .app-md-shell .modal-overlay[style*="display: block"] .modal-content {
        width: calc(100vw - 1rem) !important;
        max-height: calc(100vh - 1rem) !important;
    }
}
