/**
 * SMART-PGS — Accounting module page layout (classic full-width theme)
 */

.account-module {
    --account-page-gap: 1rem;
    --account-header-sticky-top: var(--account-desk-bar-height, 62px);
}

/* ── Full-width page shell (no narrow column) ── */
.account-module #layout-wrapper {
    min-height: 100vh;
    background: var(--smart-bg, #f0f4f8);
}

.account-module .account-page-content {
    margin-top: 0 !important;
    /* Fixed desk bar (Blade): clear sticky header. Inertia overrides in account-inertia.css */
    padding: calc(var(--account-desk-bar-height, 62px) + 1.25rem) 0 1.5rem !important;
    min-height: 100vh;
    background: transparent;
}

body.account-module .app-unified-shell.account-inertia-shell .account-page-content,
body.account-module.app-unified-nav .account-page-content {
    padding-top: calc(var(--account-desk-bar-height, 62px) + 0.5rem) !important;
    padding-bottom: 1.25rem !important;
}

/* Full-width container-fluid — override theme horizontal layout (85% cap) */
.account-module .page-content .container-fluid,
.account-module .account-page-container {
    max-width: 100% !important;
    width: 100% !important;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

@media (min-width: 992px) {
    .account-module .page-content .container-fluid,
    .account-module .account-page-container {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }
}

@media (min-width: 1400px) {
    .account-module .page-content .container-fluid,
    .account-module .account-page-container {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }
}

/* ── Cards — let module-theme handle surfaces ── */
.account-module .card {
    border-radius: var(--smart-radius-lg, 14px) !important;
    border-color: var(--smart-border-light, #eef2f6) !important;
    box-shadow: var(--smart-shadow, 0 2px 12px rgba(15, 23, 42, 0.07)) !important;
}

.account-module .card:hover {
    box-shadow: var(--smart-shadow-lg, 0 8px 28px rgba(15, 23, 42, 0.09)) !important;
}

.account-module .card-header {
    background: var(--smart-bg-subtle, #f8fafc) !important;
    border-bottom-color: var(--smart-border-light, #eef2f6) !important;
    padding: 0.875rem 1.25rem !important;
}

.account-module .card-body {
    padding: 1.25rem !important;
}

/* ── Breadcrumb / list toolbar ── */
.account-module .module-toolbar-card {
    margin-bottom: var(--account-page-gap) !important;
    border-radius: var(--smart-radius, 10px) !important;
    border-color: var(--smart-border-light, #eef2f6) !important;
    box-shadow: var(--smart-shadow-sm, 0 1px 3px rgba(15, 23, 42, 0.05)) !important;
}

.account-module .module-toolbar-breadcrumb {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--smart-text-muted, #94a3b8);
}

.account-module .module-toolbar-breadcrumb a {
    color: var(--smart-text-muted, #94a3b8);
}

.account-module .module-toolbar-breadcrumb a:hover {
    color: var(--smart-primary, #5b8def);
}

/* ── Create / edit page header (classic, non-sticky) ── */
.banking-create-header {
    margin-bottom: var(--account-page-gap);
}

.banking-create-header h4 {
    font-weight: 700;
    color: var(--smart-text-heading, #1e293b);
}

.banking-create-header .banking-voucher-type-badge {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

/* ── Shared filter tabs (contacts, vouchers, lists) ── */
.account-filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: var(--account-page-gap);
}

.account-filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.85rem;
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    cursor: pointer;
    background: var(--smart-primary-light, #eef4ff);
    color: var(--smart-primary, #5b8def);
}

.account-filter-tab:hover {
    background: var(--smart-primary-soft, rgba(91, 141, 239, 0.12));
    color: var(--smart-primary-hover, #4a7de0);
}

.account-filter-tab.active {
    background: var(--smart-primary, #5b8def);
    color: #fff;
    border-color: var(--smart-primary, #5b8def);
}

.account-filter-tab .badge {
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 0.15rem;
}

.account-filter-tab.active .badge {
    background: rgba(255, 255, 255, 0.25) !important;
    color: #fff !important;
}

.account-filter-tab:not(.active) .badge {
    background: rgba(91, 141, 239, 0.15) !important;
    color: var(--smart-primary, #5b8def) !important;
}

/* Secondary/inactive group tabs */
.account-filter-tab.is-muted {
    background: #f1f5f9;
    color: #64748b;
}

.account-filter-tab.is-muted:hover {
    background: #e2e8f0;
    color: #475569;
}

.account-filter-tab.is-muted.active {
    background: var(--smart-primary, #5b8def);
    color: #fff;
}

.account-filter-tab.is-muted:not(.active) .badge {
    background: #e2e8f0 !important;
    color: #64748b !important;
}

/* ── Contacts index (Inertia + AG Grid) ── */
.contacts-index {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

/* Single compact toolbar row */
.contacts-index__bar {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
    min-height: 2.25rem;
}

.contacts-index__identity {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex: 0 0 auto;
}

.contacts-index__title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.contacts-index__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.4rem;
    height: 1.35rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 0.72rem;
    font-weight: 700;
}

.contacts-index__search {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex: 1 1 220px;
    max-width: 420px;
    min-width: 180px;
}

.contacts-index__search-field {
    position: relative;
    flex: 1;
    min-width: 0;
}

.contacts-index__search-field > i {
    position: absolute;
    left: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    z-index: 1;
    pointer-events: none;
    font-size: 0.95rem;
}

.contacts-index__search-field .form-control {
    padding: 0.3rem 0.6rem 0.3rem 1.85rem;
    border-radius: 0.4rem;
    border-color: #e2e8f0;
    min-height: 32px;
    height: 32px;
    font-size: 0.84rem;
}

.contacts-index__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-left: auto;
}

.contacts-index__actions .btn {
    white-space: nowrap;
}

/* Unified panel: tabs + grid */
.contacts-index__panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.contacts-index__tabs {
    display: flex;
    gap: 0;
    overflow-x: auto;
    padding: 0 0.35rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    scrollbar-width: thin;
}

.contacts-index__tab {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex: 0 0 auto;
    padding: 0.55rem 0.75rem;
    border: 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    background: transparent;
    color: #64748b;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    transition: color 0.12s, border-color 0.12s;
}

.contacts-index__tab em {
    font-style: normal;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.05rem 0.35rem;
    border-radius: 999px;
    background: #e2e8f0;
    color: #64748b;
}

.contacts-index__tab:hover {
    color: #334155;
}

.contacts-index__tab.is-active {
    color: #4338ca;
    border-bottom-color: #556ee6;
    background: #fff;
}

.contacts-index__tab.is-active em {
    background: #eef2ff;
    color: #4338ca;
}

.contacts-index__tab.is-disabled {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
}

/* Grid sits flush inside panel (no double card) */
.contacts-index__grid.smart-ag-table,
.contacts-index .contacts-index__grid.card {
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin: 0;
}

.contacts-index__grid .smart-ag-toolbar {
    padding: 0.4rem 0.75rem;
    background: #fff;
}

.contacts-index__grid .smart-ag-toolbar__title {
    font-size: 0.75rem;
    color: #64748b;
}

.contacts-index__grid .smart-ag-tool-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.contacts-index__grid .smart-ag-footer {
    padding: 0.4rem 0.75rem;
    background: #fff;
}

.contacts-grid__name {
    font-weight: 600;
    color: #556ee6;
    text-decoration: none;
}

.contacts-grid__name:hover {
    text-decoration: underline;
}

.contacts-grid__code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8rem;
    color: #475569;
}

.contacts-grid__type {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 0.7rem;
    font-weight: 700;
}

.contacts-grid__email {
    color: #334155;
    text-decoration: none;
}

.contacts-grid__email:hover {
    color: #556ee6;
    text-decoration: underline;
}

@media (max-width: 991.98px) {
    .contacts-index__search {
        order: 3;
        flex: 1 1 100%;
        max-width: none;
    }

    .contacts-index__actions {
        margin-left: 0;
    }
}



/* ── Action toolbar card ── */
.account-action-toolbar .card-body {
    padding: 0.65rem 1rem !important;
}

.account-action-toolbar .btn {
    font-size: 0.8125rem;
    font-weight: 500;
}

/* ── Search box (contacts-style) ── */
.account-search-box {
    position: relative;
    min-width: 260px;
}

.account-search-box .form-control {
    padding-right: 2.25rem;
    border-radius: 8px;
}

.account-search-box .search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

/* ── Tables ── */
.account-module .table > thead.table-light th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--smart-text-muted, #94a3b8);
    background: var(--smart-bg-subtle, #f8fafc) !important;
    padding: 0.75rem 0.65rem !important;
}

.account-module .table > tbody > tr > td {
    padding: 0.65rem !important;
    vertical-align: middle;
    color: var(--smart-text, #475569);
}

.account-module .table-hover tbody tr:hover {
    background-color: var(--smart-primary-soft, rgba(91, 141, 239, 0.12)) !important;
}

.account-module .table-responsive.border {
    border-color: var(--smart-border-light, #eef2f6) !important;
    border-radius: var(--smart-radius, 10px);
}

/* ── Policy / info notes ── */
.account-module .accounting-policy-note {
    margin-bottom: var(--account-page-gap);
}

/* ── Responsive ── */
@media (max-width: 767.98px) {
    .account-module .page-content .container-fluid,
    .account-module .account-page-container {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    .account-search-box {
        min-width: 100%;
        width: 100%;
    }
}
