/* Flowaxy UI — shared components (app + admin) */

/* Page shell */
.flowaxy-page,
.flowaxy-app .container,
.flowaxy-admin .container {
    max-width: 100%;
    padding: 0;
    width: 100%;
}

/* Page header / toolbar */
.flowaxy-page-header {
    align-items: center;
    margin-bottom: 0.75rem !important;
}

.flowaxy-page-header .h1,
.flowaxy-page-header .h4,
.flowaxy-page-header__title {
    font-size: var(--fx-font-lg);
    font-weight: 600;
    color: var(--fx-text);
    margin: 0;
}

.flowaxy-page-header__actions,
.flowaxy-page-header > [class*="col-lg-auto"] {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.flowaxy-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

/* Panels */
.flowaxy-panel,
.flowaxy-admin-panel {
    background: var(--fx-surface);
    border: 1px solid var(--fx-border);
    border-radius: var(--fx-radius);
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.flowaxy-panel__head,
.flowaxy-admin-panel__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--fx-border-light);
    background: var(--fx-surface-muted);
}

.flowaxy-panel__head h2,
.flowaxy-admin-panel__head h2,
.flowaxy-panel__head h3,
.flowaxy-admin-panel__head h3 {
    font-size: var(--fx-font-sm);
    font-weight: 600;
    color: var(--fx-text);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.flowaxy-panel__head a,
.flowaxy-admin-panel__head a {
    font-size: var(--fx-font-xs);
    color: var(--fx-primary);
    text-decoration: none;
}

.flowaxy-panel__head a:hover,
.flowaxy-admin-panel__head a:hover {
    text-decoration: underline;
}

.flowaxy-panel__body,
.flowaxy-admin-panel__body {
    padding: 0;
}

.flowaxy-panel__body--padded,
.flowaxy-admin-panel__body--padded {
    padding: 1rem;
}

.flowaxy-panel--flat .card,
.flowaxy-panel__body .table-custom-container {
    margin: 0;
    border: 0;
    border-radius: 0;
}

.flowaxy-panel__body .table-custom,
.flowaxy-admin-panel__body .table-custom {
    margin-bottom: 0;
}

/* Stat cards */
.flowaxy-stat-card,
.flowaxy-admin-stat {
    background: var(--fx-surface);
    border: 1px solid var(--fx-border);
    border-radius: var(--fx-radius);
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 72px;
    transition: border-color 0.15s ease;
}

.flowaxy-stat-card:hover,
.flowaxy-admin-stat:hover {
    border-color: #cbd5e1;
    text-decoration: none;
    color: inherit;
}

.flowaxy-stat-card__icon {
    width: 36px;
    height: 36px;
    border-radius: var(--fx-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.flowaxy-stat-card__label,
.flowaxy-admin-stat__label {
    font-size: var(--fx-font-xs);
    font-weight: 600;
    color: var(--fx-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.flowaxy-stat-card__value,
.flowaxy-admin-stat__value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--fx-text);
    line-height: 1.2;
}

/* Account navigation */
.flowaxy-account-nav {
    margin-bottom: 1rem;
}

.flowaxy-account-nav__mobile select {
    border-radius: var(--fx-radius);
    border-color: var(--fx-border);
    font-size: var(--fx-font-sm);
}

.flowaxy-account-nav__tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.25rem;
    background: var(--fx-surface-muted);
    border: 1px solid var(--fx-border);
    border-radius: var(--fx-radius);
}

.flowaxy-account-nav__tabs a {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    font-size: var(--fx-font-sm);
    font-weight: 500;
    color: var(--fx-text-muted);
    text-decoration: none;
    border-radius: var(--fx-radius);
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}

.flowaxy-account-nav__tabs a:hover {
    color: var(--fx-text);
    background: var(--fx-surface);
    text-decoration: none;
}

.flowaxy-account-nav__tabs a.active {
    color: var(--fx-text);
    background: transparent;
    font-weight: 600;
    box-shadow: inset 0 -2px 0 var(--fx-primary);
    border-radius: 0;
}

/* Account settings pages */
.flowaxy-account-page {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.flowaxy-account-form {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.flowaxy-account-grid {
    margin-left: -0.375rem;
    margin-right: -0.375rem;
}

.flowaxy-account-grid > [class*="col-"] {
    padding-left: 0.375rem;
    padding-right: 0.375rem;
}

.flowaxy-account-grid--inner {
    margin-bottom: -0.375rem;
}

.flowaxy-account-grid--inner > [class*="col-"] {
    margin-bottom: 0.375rem;
}

.flowaxy-account-page > .row {
    margin-bottom: 0;
}

.flowaxy-account-section {
    border: 1px solid var(--fx-border);
    border-radius: var(--fx-radius);
    box-shadow: none;
    margin-bottom: 0;
    background: var(--fx-surface);
    overflow: hidden;
}

.flowaxy-account-section .card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4375rem 0.875rem;
    min-height: 2rem;
    font-size: var(--fx-font-xs);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--fx-text-muted);
    background: var(--fx-surface);
    border-bottom: 1px solid var(--fx-border);
}

.flowaxy-account-section .card-header .fa-info-circle {
    font-size: 0.6875rem;
    opacity: 0.55;
}

.flowaxy-account-section-toggle {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.4375rem 0.875rem;
    min-height: 2rem;
    font-size: var(--fx-font-xs);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: var(--fx-surface);
    border: 0;
    border-bottom: 1px solid var(--fx-border);
    color: var(--fx-text-muted);
}

.flowaxy-account-section-toggle:hover,
.flowaxy-account-section-toggle:focus {
    background: var(--fx-surface-muted);
    color: var(--fx-text);
    text-decoration: none;
}

.flowaxy-account-section .card-body {
    padding: 0.875rem;
}

.flowaxy-account-page .form-group {
    margin-bottom: 0.5rem;
}

.flowaxy-account-page .form-group:last-child {
    margin-bottom: 0;
}

.flowaxy-account-page label {
    display: block;
    font-size: var(--fx-font-xs);
    font-weight: 500;
    color: var(--fx-text-muted);
    margin-bottom: 0.1875rem;
    line-height: 1.3;
}

.flowaxy-account-page .form-text {
    margin-top: 0.1875rem;
    font-size: 0.625rem;
    line-height: 1.35;
    color: var(--fx-text-subtle);
}

.flowaxy-account-page .form-control,
.flowaxy-account-page .custom-select {
    border-color: var(--fx-border);
    border-radius: var(--fx-radius);
    box-shadow: none;
}

.flowaxy-account-page .form-control:focus,
.flowaxy-account-page .custom-select:focus {
    border-color: var(--fx-primary);
    box-shadow: 0 0 0 2px var(--fx-focus-ring);
}

.flowaxy-account-page .form-control-sm,
.flowaxy-account-page .custom-select-sm {
    height: 2rem;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    font-size: var(--fx-font-sm);
    line-height: 1.25;
}

.flowaxy-account-page .input-group-sm > .input-group-prepend > .input-group-text {
    font-size: var(--fx-font-xs);
    border-color: var(--fx-border);
    background: var(--fx-surface-muted);
    color: var(--fx-text-muted);
}

.flowaxy-account-page .custom-control-label {
    font-size: var(--fx-font-sm);
    color: var(--fx-text);
}

.flowaxy-account-page__footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-top: 0.125rem;
}

.flowaxy-account-page .flowaxy-account-submit {
    min-width: 7.5rem;
    height: 2rem;
    padding: 0 1rem;
    font-size: var(--fx-font-sm);
    font-weight: 600;
    border-radius: var(--fx-radius);
    box-shadow: none;
}

.flowaxy-account-twofa-qr {
    max-width: 7.5rem;
}

.flowaxy-account-danger {
    border-color: var(--fx-border);
    border-left: 3px solid #dc3545;
}

.flowaxy-account-danger .card-header {
    color: #dc3545;
    background: var(--fx-surface);
}

.flowaxy-account-danger .card-body p {
    line-height: 1.45;
}

.flowaxy-account-dashboard-features > div {
    display: flex;
    align-items: flex-start;
    padding: 0.4375rem 0;
    border-bottom: 1px solid var(--fx-border-light);
}

.flowaxy-account-dashboard-features > div:first-child {
    padding-top: 0;
}

.flowaxy-account-dashboard-features > div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.flowaxy-account-dashboard-features .form-group {
    margin-bottom: 0;
}

.flowaxy-account-dashboard-features .custom-control-label {
    font-size: var(--fx-font-sm);
    font-weight: 500;
    color: var(--fx-text);
    line-height: 1.35;
}

.flowaxy-account-dashboard-features .drag {
    margin-top: 0.125rem;
}

[data-theme-style="dark"] .flowaxy-account-section .card-header,
[data-theme-style="dark"] .flowaxy-account-section-toggle {
    background: var(--fx-surface);
    border-bottom-color: var(--fx-border);
}

[data-theme-style="dark"] .flowaxy-account-page .form-control,
[data-theme-style="dark"] .flowaxy-account-page .custom-select {
    background: var(--fx-surface);
    border-color: var(--fx-border);
    color: var(--fx-text);
}

/* Form card inside page */
.flowaxy-form-section {
    background: var(--fx-surface);
    border: 1px solid var(--fx-border);
    border-radius: var(--fx-radius);
    margin-bottom: 0.75rem;
}

.flowaxy-form-section .card-body {
    padding: 1rem 1.25rem;
}

.flowaxy-form-section .card-header {
    background: var(--fx-surface-muted);
    border-bottom: 1px solid var(--fx-border-light);
    font-size: var(--fx-font-sm);
    font-weight: 600;
    padding: 0.65rem 1rem;
}

/* Empty state */
.flowaxy-empty {
    text-align: center;
    padding: 2.5rem 1.5rem;
    color: var(--fx-text-muted);
    font-size: var(--fx-font-sm);
}

.flowaxy-empty i {
    font-size: 2rem;
    color: var(--fx-text-subtle);
    margin-bottom: 0.75rem;
    display: block;
}

/* Filters dropdown */
.flowaxy-app .filters-dropdown,
.flowaxy-admin .filters-dropdown {
    min-width: 280px;
    border-radius: var(--fx-radius);
    border-color: var(--fx-border);
}

.flowaxy-app .filters-dropdown .dropdown-header,
.flowaxy-admin .filters-dropdown .dropdown-header {
    font-size: var(--fx-font-sm);
    font-weight: 600;
    color: var(--fx-text);
}

/* Chart card as panel */
.flowaxy-app .card.mb-4:has(.chart-container),
.flowaxy-admin .card.mb-4:has(.chart-container) {
    border-radius: var(--fx-radius);
    border-color: var(--fx-border);
    box-shadow: none;
}

.flowaxy-app .card.mb-4 .chart-container,
.flowaxy-admin .card.mb-4 .chart-container {
    padding: 0.5rem 0;
}

.flowaxy-admin .flowaxy-page-header .h3,
.flowaxy-admin .flowaxy-page-header h1 {
    font-size: var(--fx-font-lg);
    font-weight: 600;
    color: var(--fx-text);
}

.flowaxy-admin .btn-gray-300 {
    background: var(--fx-surface);
    border: 1px solid var(--fx-border);
    color: var(--fx-text-muted);
    border-radius: var(--fx-radius);
    font-size: var(--fx-font-sm);
}

.flowaxy-admin .btn-gray-300:hover {
    background: var(--fx-surface-muted);
    border-color: #cbd5e1;
    color: var(--fx-text);
}

.flowaxy-app .btn-custom {
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--fx-radius);
    color: var(--fx-text-muted);
    font-size: var(--fx-font-sm);
    font-weight: 500;
    box-shadow: none;
}

.flowaxy-app .btn-custom:hover {
    background: var(--fx-surface);
    border-color: var(--fx-border);
    color: var(--fx-text);
}

.flowaxy-app .btn-custom.active {
    background: var(--fx-primary-soft);
    border-color: transparent;
    color: var(--fx-primary);
    font-weight: 600;
}

/* Tooltips — strict dark popover (ADM-style) */
.flowaxy-tooltip.tooltip {
    opacity: 0;
    transition: opacity 0.12s ease;
    pointer-events: none;
    z-index: 1070;
}

.flowaxy-tooltip.tooltip.show {
    opacity: 1;
}

.flowaxy-tooltip .tooltip-inner {
    background: #141414;
    color: #ffffff;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.35;
    padding: 0.4rem 0.65rem;
    border-radius: 4px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
    max-width: 12rem;
    text-align: center;
}

.flowaxy-tooltip.bs-tooltip-top .arrow::before {
    border-top-color: #141414;
}

.flowaxy-tooltip.bs-tooltip-bottom .arrow::before {
    border-bottom-color: #141414;
}

.flowaxy-tooltip.bs-tooltip-left .arrow::before {
    border-left-color: #141414;
}

.flowaxy-tooltip.bs-tooltip-right .arrow::before {
    border-right-color: #141414;
}

.flowaxy-tooltip.bs-tooltip-top .arrow,
.flowaxy-tooltip.bs-tooltip-bottom .arrow {
    width: 0.55rem;
    height: 0.3rem;
}

.flowaxy-tooltip.bs-tooltip-top .arrow::before,
.flowaxy-tooltip.bs-tooltip-bottom .arrow::before {
    border-width: 0.3rem 0.275rem 0;
}

.flowaxy-tooltip.bs-tooltip-bottom .arrow::before {
    border-width: 0 0.275rem 0.3rem;
}
