/* =========================================================
   BASE / GLOBAL
========================================================= */

body {
    font-family: Arial, Helvetica, sans-serif;
}

/* =========================================================
   APP NAVBAR
========================================================= */

body {
    background: #f5f7fa;
    padding-top: 76px;
}

.app-navbar {
    min-height: 64px;
    background: #fff;
    border-bottom: 1px solid #d7dee8;
    box-shadow: 0 1px 3px rgba(12, 31, 53, 0.06);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.app-navbar.scrolled {
    border-bottom-color: #cfd8e3;
    box-shadow: 0 8px 22px rgba(12, 31, 53, 0.11);
}

.app-navbar .container-fluid {
    gap: 12px;
    padding-right: 22px;
    padding-left: 22px;
}

.app-navbar .navbar-brand {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    margin-right: 18px;
    color: #172b4d;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0;
}

.app-navbar .navbar-brand::before {
    content: "";
    display: inline-block;
    width: 10px;
    height: 28px;
    margin-right: 10px;
    border-radius: 999px;
    background: #13b5ea;
}

.app-navbar .navbar-brand:hover,
.app-navbar .navbar-brand:focus {
    color: #0078a8;
}

.app-navbar .navbar-nav {
    gap: 2px;
}

.app-navbar .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    margin: 0 2px;
    padding: 8px 12px;
    border-radius: 4px;
    color: #40566f;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    transition: background-color 0.16s ease, color 0.16s ease;
}

.app-navbar .nav-link:hover,
.app-navbar .nav-link:focus,
.app-navbar .dropdown-item:hover,
.app-navbar .dropdown-item:focus {
    background: #e7f7fd;
    color: #0078a8 !important;
}

.app-navbar .nav-link.active,
.app-navbar .dropdown-toggle.active {
    background: #e7f7fd;
    color: #0078a8 !important;
}

.app-navbar .nav-link.active {
    box-shadow: inset 0 -2px 0 #13b5ea;
}

.app-navbar .nav-icon {
    color: #7a8ca1;
    font-size: 15px;
    transition: color 0.16s ease;
}

.app-navbar .nav-link:hover .nav-icon,
.app-navbar .nav-link:focus .nav-icon,
.app-navbar .nav-link.active .nav-icon,
.app-navbar .dropdown-item:hover .nav-icon,
.app-navbar .dropdown-item:focus .nav-icon,
.app-navbar .dropdown-item.active .nav-icon {
    color: #13b5ea;
}

.app-navbar .dropdown-menu {
    min-width: 235px;
    margin-top: 10px;
    padding: 8px;
    border: 1px solid #d7dee8;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 14px 30px rgba(12, 31, 53, 0.14);
}

.app-navbar .dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 10px;
    border-radius: 4px;
    color: #40566f;
    font-size: 14px;
    font-weight: 600;
}

.app-navbar .dropdown-item.active {
    background: #e7f7fd;
    color: #0078a8 !important;
}

.app-navbar .dropdown-header {
    padding: 8px 10px;
    color: #6b7c93;
    font-size: 12px;
}

.app-navbar .dropdown-divider {
    margin: 8px 4px;
    border-top-color: #e6edf5;
}

.app-navbar .navbar-toggler {
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid #cfd8e3;
    border-radius: 4px;
    box-shadow: none !important;
}

.app-navbar .navbar-toggler-icon {
    width: 18px;
    height: 18px;
    background-image: none;
    position: relative;
}

.app-navbar .navbar-toggler-icon::before,
.app-navbar .navbar-toggler-icon::after,
.app-navbar .navbar-toggler-icon {
    border-top: 2px solid #40566f;
}

.app-navbar .navbar-toggler-icon::before,
.app-navbar .navbar-toggler-icon::after {
    content: "";
    position: absolute;
    left: 0;
    width: 18px;
}

.app-navbar .navbar-toggler-icon::before {
    top: -6px;
}

.app-navbar .navbar-toggler-icon::after {
    top: 4px;
}

@media (max-width: 991px) {
    body {
        padding-top: 70px;
    }

    .app-navbar .container-fluid {
        padding-right: 14px;
        padding-left: 14px;
    }

    .app-navbar .navbar-collapse {
        margin-top: 12px;
        padding: 12px;
        border: 1px solid #d7dee8;
        border-radius: 6px;
        background: #fff;
        box-shadow: 0 14px 30px rgba(12, 31, 53, 0.12);
    }

    .app-navbar .nav-link {
        width: 100%;
        margin: 2px 0;
    }

    .app-navbar .dropdown-menu {
        margin-top: 4px;
        border: none;
        box-shadow: none;
    }
}

/* =========================================================
   DASHBOARD
========================================================= */

.dashboard-page {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 18px 34px;
}

.dashboard-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.dashboard-toolbar h1 {
    margin: 0;
    color: #172b4d;
    font-size: 28px;
    font-weight: 600;
}

.dashboard-kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.dashboard-kpi-card,
.dashboard-panel {
    border: 1px solid #d7dee8;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(12, 31, 53, 0.08);
}

.dashboard-kpi-card {
    min-height: 116px;
    padding: 17px;
    border-top: 3px solid #13b5ea;
}

.dashboard-kpi-card span {
    display: block;
    margin-bottom: 9px;
    color: #5f738c;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    text-transform: uppercase;
}

.dashboard-kpi-card strong {
    display: block;
    color: #172b4d;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.18;
}

.dashboard-kpi-blue {
    border-top-color: #13b5ea;
}

.dashboard-kpi-blue strong {
    color: #0078a8;
}

.dashboard-kpi-orange {
    border-top-color: #f59e0b;
}

.dashboard-kpi-orange strong {
    color: #b45309;
}

.dashboard-kpi-red {
    border-top-color: #ef4444;
}

.dashboard-kpi-red strong {
    color: #b42318;
}

.dashboard-kpi-green {
    border-top-color: #22c55e;
}

.dashboard-kpi-green strong {
    color: #166534;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(300px, 0.85fr);
    gap: 18px;
}

.dashboard-main,
.dashboard-side {
    display: grid;
    align-content: start;
    gap: 18px;
}

.dashboard-panel {
    overflow: hidden;
}

.dashboard-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-bottom: 1px solid #e6edf5;
    background: #fbfcfe;
}

.dashboard-panel-header h2 {
    margin: 0;
    color: #172b4d;
    font-size: 16px;
    font-weight: 700;
}

.dashboard-panel-header p {
    margin: 3px 0 0;
    color: #6b7c93;
    font-size: 13px;
}

.dashboard-panel-body {
    padding: 18px;
}

.dashboard-chart-wrap {
    height: 315px;
}

.dashboard-table-wrap {
    overflow-x: auto;
}

.dashboard-table {
    width: 100%;
    min-width: 660px;
    margin: 0;
    border-collapse: collapse;
    color: #172b4d;
    font-size: 14px;
}

.dashboard-table td {
    padding: 15px 18px;
    border-bottom: 1px solid #eef2f6;
    vertical-align: middle;
}

.dashboard-table tr:last-child td {
    border-bottom: 0;
}

.dashboard-table tbody tr:hover {
    background: #f3fbfe;
}

.dashboard-table td:first-child strong,
.dashboard-table td:first-child span {
    display: block;
}

.dashboard-table td:first-child strong {
    margin-bottom: 2px;
    color: #0078a8;
}

.dashboard-table td:first-child span {
    color: #40566f;
}

.dashboard-date {
    color: #6b7c93;
    font-size: 13px;
    text-align: right;
    white-space: nowrap;
}

.dashboard-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 25px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #eef2f6;
    color: #40566f;
    font-size: 12px;
    font-weight: 700;
    text-transform: capitalize;
    white-space: nowrap;
}

.dashboard-status-open {
    background: #e7f7fd;
    color: #0078a8;
}

.dashboard-status-in-progress {
    background: #fff4e5;
    color: #b45309;
}

.dashboard-status-waiting-for-client,
.dashboard-status-3rd-party-repairs {
    background: #fef9c3;
    color: #854d0e;
}

.dashboard-status-closed,
.dashboard-status-invoiced {
    background: #dcfce7;
    color: #166534;
}

.dashboard-weather-list {
    display: grid;
    gap: 10px;
}

.dashboard-weather-list div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eef2f6;
}

.dashboard-weather-list div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.dashboard-weather-list span {
    color: #40566f;
    font-weight: 700;
}

.dashboard-weather-list strong {
    color: #0078a8;
    font-weight: 700;
}

.dashboard-service-list {
    display: grid;
    gap: 14px;
}

.dashboard-service-row {
    display: grid;
    gap: 7px;
}

.dashboard-service-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.dashboard-service-summary span {
    color: #40566f;
    font-weight: 700;
}

.dashboard-service-summary strong {
    color: #0078a8;
    font-size: 18px;
    font-weight: 700;
}

.dashboard-service-meter {
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: #e8eef5;
}

.dashboard-service-meter span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #13b5ea;
}

.dashboard-text-block {
    color: #40566f;
    line-height: 1.6;
}

.dashboard-empty {
    padding: 18px;
    color: #6b7c93;
    text-align: center;
}

@media (max-width: 1180px) {
    .dashboard-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .dashboard-page {
        padding-inline: 12px;
    }

    .dashboard-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .dashboard-kpi-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-chart-wrap {
        height: 260px;
    }
}

/* =========================================================
   SUBSCRIPTION PLANS
========================================================= */

.subscription-plans-page,
.subscription-plan-form-page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 18px 34px;
}

.subscription-plans-toolbar,
.subscription-plan-form-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.subscription-plans-toolbar h1,
.subscription-plan-form-toolbar h1 {
    margin: 0;
    color: #172b4d;
    font-size: 28px;
    font-weight: 600;
}

.subscription-plans-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.subscription-plans-search {
    position: relative;
    width: min(100vw, 330px);
}

.subscription-plans-search i,
.subscription-plan-stock-search i {
    position: absolute;
    top: 50%;
    left: 12px;
    z-index: 1;
    color: #7a8ca1;
    transform: translateY(-50%);
}

.subscription-plans-search .form-control,
.subscription-plan-stock-search .form-control {
    min-height: 40px;
    padding-left: 38px;
    border-color: #cfd8e3;
    border-radius: 4px;
    color: #172b4d;
}

.subscription-plans-search .form-control:focus,
.subscription-plan-field .form-control:focus,
.subscription-plan-field .form-select:focus {
    border-color: #13b5ea;
    box-shadow: 0 0 0 3px rgba(19, 181, 234, 0.15);
}

.subscription-plans-primary-action,
.subscription-plans-secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 4px;
    font-weight: 600;
}

.subscription-plans-primary-action {
    background: #13b5ea;
    border-color: #13b5ea;
}

.subscription-plans-primary-action:hover,
.subscription-plans-primary-action:focus {
    background: #0f9fce;
    border-color: #0f9fce;
}

.subscription-plans-panel,
.subscription-plan-form-panel {
    overflow: visible;
    border: 1px solid #d7dee8;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(12, 31, 53, 0.08);
}

.subscription-plans-panel {
    overflow: hidden;
}

.subscription-plans-panel-header,
.subscription-plan-form-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-bottom: 1px solid #e6edf5;
    background: #fbfcfe;
}

.subscription-plans-panel-header h2,
.subscription-plan-form-panel-header h2 {
    margin: 0;
    color: #172b4d;
    font-size: 16px;
    font-weight: 700;
}

.subscription-plans-panel-header p,
.subscription-plan-form-panel-header p {
    margin: 3px 0 0;
    color: #6b7c93;
    font-size: 13px;
}

.subscription-plans-results-info {
    color: #5f738c;
    font-size: 13px;
    white-space: nowrap;
}

.subscription-plans-table-wrap {
    overflow-x: auto;
}

.subscription-plans-table {
    width: 100%;
    min-width: 920px;
    margin: 0;
    border-collapse: collapse;
    color: #172b4d;
    font-size: 14px;
}

.subscription-plans-table th {
    padding: 12px 18px;
    border-bottom: 1px solid #dbe3ed;
    background: #f7f9fc;
    color: #5f738c;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.subscription-plans-table td {
    padding: 15px 18px;
    border-bottom: 1px solid #eef2f6;
    vertical-align: middle;
}

.subscription-plans-table tbody tr {
    cursor: pointer;
    transition: background-color 0.16s ease;
}

.subscription-plans-table tbody tr:hover {
    background: #f3fbfe;
}

.subscription-plans-table th {
    cursor: pointer;
    user-select: none;
}

.subscription-plans-table th::after {
    display: inline-block;
    width: 11px;
    margin-left: 6px;
    color: #13b5ea;
    font-size: 10px;
}

.subscription-plans-table th.sort-asc::after {
    content: "^";
}

.subscription-plans-table th.sort-desc::after {
    content: "v";
}

.subscription-plan-name {
    color: #172b4d;
    font-weight: 700;
}

.subscription-plan-description {
    max-width: 360px;
    overflow: hidden;
    color: #6b7c93;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.subscription-plan-price {
    color: #172b4d;
    font-weight: 700;
    white-space: nowrap;
}

.subscription-plan-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 25px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.subscription-plan-status.is-active {
    background: #dcfce7;
    color: #166534;
}

.subscription-plan-status.is-inactive {
    background: #eef2f6;
    color: #40566f;
}

.subscription-plans-state {
    padding: 34px 18px !important;
    color: #6b7c93;
    text-align: center;
}

.subscription-plans-state-danger {
    color: #b42318;
}

.subscription-plans-pagination {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    min-height: 58px;
    padding: 12px 18px;
    border-top: 1px solid #e6edf5;
    background: #fbfcfe;
}

.subscription-plans-pagination button {
    min-width: 34px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid #cfd8e3;
    border-radius: 4px;
    background: #fff;
    color: #172b4d;
    font-size: 13px;
    font-weight: 600;
}

.subscription-plans-pagination button:hover:not(:disabled),
.subscription-plans-pagination button:disabled {
    border-color: #13b5ea;
    background: #13b5ea;
    color: #fff;
}

.subscription-plan-form-panel {
    padding-bottom: 18px;
}

.subscription-plan-form-panel .alert-msg {
    margin: 18px 18px 0;
}

.subscription-plan-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    padding: 18px 18px 0;
}

.subscription-plan-field {
    position: relative;
}

.subscription-plan-field label {
    display: block;
    margin-bottom: 7px;
    color: #40566f;
    font-size: 13px;
    font-weight: 700;
}

.subscription-plan-field .form-control,
.subscription-plan-field .form-select {
    min-height: 40px;
    border-color: #cfd8e3;
    border-radius: 4px;
    color: #172b4d;
}

.subscription-plan-field textarea.form-control {
    min-height: 130px;
    resize: vertical;
}

.subscription-plan-stock-search {
    position: relative;
}

.subscription-plan-results {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    display: block;
    max-height: 280px;
    overflow-y: auto;
    z-index: 30;
    padding: 6px;
    border: 1px solid #cfd8e3;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 14px 30px rgba(12, 31, 53, 0.14);
}

.subscription-plan-results:empty {
    display: none;
}

.subscription-plan-result {
    padding: 9px 10px;
    border-radius: 4px;
    cursor: pointer;
}

.subscription-plan-result:hover {
    background: #e7f7fd;
}

.subscription-plan-result-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.subscription-plan-result-title {
    color: #172b4d;
    font-weight: 700;
}

.subscription-plan-result-sub {
    color: #6b7c93;
    font-size: 12px;
}

.subscription-plan-result-price {
    color: #166534;
    font-weight: 700;
    white-space: nowrap;
}

.subscription-plan-result-danger {
    color: #b42318;
}

.subscription-plan-toggle-field {
    display: flex;
    align-items: flex-end;
}

.subscription-plan-toggle {
    display: inline-flex !important;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    margin: 0 !important;
    color: #40566f;
    cursor: pointer;
}

.subscription-plan-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.subscription-plan-toggle span {
    position: relative;
    display: inline-flex;
    width: 38px;
    height: 22px;
    border-radius: 999px;
    background: #cfd8e3;
    transition: background-color 0.16s ease;
}

.subscription-plan-toggle span::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(12, 31, 53, 0.18);
    transition: transform 0.16s ease;
}

.subscription-plan-toggle input:checked + span {
    background: #13b5ea;
}

.subscription-plan-toggle input:checked + span::after {
    transform: translateX(16px);
}

.subscription-plan-description-field {
    margin: 18px 18px 0;
}

.subscription-plan-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 18px 18px 0;
}

.alert-msg.is-visible {
    display: block;
}

@media (max-width: 820px) {
    .subscription-plans-page,
    .subscription-plan-form-page {
        padding-inline: 12px;
    }

    .subscription-plans-toolbar,
    .subscription-plan-form-toolbar,
    .subscription-plans-panel-header,
    .subscription-plan-form-panel-header {
        align-items: stretch;
        flex-direction: column;
    }

    .subscription-plans-actions,
    .subscription-plan-form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .subscription-plans-search,
    .subscription-plans-primary-action,
    .subscription-plans-secondary-action {
        width: 100%;
    }

    .subscription-plan-form-grid {
        grid-template-columns: 1fr;
    }

    .subscription-plans-results-info {
        white-space: normal;
    }
}

/* =========================================================
   SUBSCRIPTIONS
========================================================= */

.subscriptions-page,
.subscription-form-page {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 18px 34px;
}

.subscriptions-toolbar,
.subscription-form-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.subscriptions-toolbar h1,
.subscription-form-toolbar h1 {
    margin: 0;
    color: #172b4d;
    font-size: 28px;
    font-weight: 600;
}

.subscriptions-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.subscriptions-search {
    position: relative;
    width: min(100vw, 390px);
}

.subscriptions-search i,
.subscription-search-box i {
    position: absolute;
    top: 50%;
    left: 12px;
    z-index: 1;
    color: #7a8ca1;
    transform: translateY(-50%);
}

.subscriptions-search .form-control,
.subscription-search-box .form-control {
    min-height: 40px;
    padding-left: 38px;
    border-color: #cfd8e3;
    border-radius: 4px;
    color: #172b4d;
}

.subscriptions-status-filter {
    width: 150px;
    min-height: 40px;
    border-color: #cfd8e3;
    border-radius: 4px;
}

.subscriptions-search .form-control:focus,
.subscriptions-status-filter:focus,
.subscription-field .form-control:focus,
.subscription-field .form-select:focus {
    border-color: #13b5ea;
    box-shadow: 0 0 0 3px rgba(19, 181, 234, 0.15);
}

.subscriptions-primary-action,
.subscriptions-secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 4px;
    font-weight: 600;
}

.subscriptions-primary-action {
    background: #13b5ea;
    border-color: #13b5ea;
}

.subscriptions-primary-action:hover,
.subscriptions-primary-action:focus {
    background: #0f9fce;
    border-color: #0f9fce;
}

.subscriptions-panel,
.subscription-form-panel {
    overflow: hidden;
    border: 1px solid #d7dee8;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(12, 31, 53, 0.08);
}

.subscription-form-panel {
    overflow: visible;
    padding-bottom: 18px;
}

.subscriptions-panel-header,
.subscription-form-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-bottom: 1px solid #e6edf5;
    background: #fbfcfe;
}

.subscriptions-panel-header h2,
.subscription-form-panel-header h2 {
    margin: 0;
    color: #172b4d;
    font-size: 16px;
    font-weight: 700;
}

.subscriptions-panel-header p,
.subscription-form-panel-header p {
    margin: 3px 0 0;
    color: #6b7c93;
    font-size: 13px;
}

.subscriptions-results-info {
    color: #5f738c;
    font-size: 13px;
    white-space: nowrap;
}

.subscriptions-table-wrap {
    max-height: 630px;
    overflow: auto;
}

.subscriptions-table {
    width: 100%;
    min-width: 1080px;
    margin: 0;
    border-collapse: collapse;
    color: #172b4d;
    font-size: 14px;
}

.subscriptions-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 12px 18px;
    border-bottom: 1px solid #dbe3ed;
    background: #f7f9fc;
    color: #5f738c;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    user-select: none;
}

.subscriptions-table th::after {
    display: inline-block;
    width: 11px;
    margin-left: 6px;
    color: #13b5ea;
    font-size: 10px;
}

.subscriptions-table th.sort-asc::after {
    content: "^";
}

.subscriptions-table th.sort-desc::after {
    content: "v";
}

.subscriptions-table td {
    padding: 15px 18px;
    border-bottom: 1px solid #eef2f6;
    vertical-align: middle;
}

.subscriptions-row {
    border-left: 4px solid transparent;
    cursor: pointer;
    transition: background-color 0.16s ease;
}

.subscriptions-row:hover {
    background: #f3fbfe;
}

.subscriptions-row-voip {
    border-left-color: #13b5ea;
}

.subscriptions-row-hosting {
    border-left-color: #7c3aed;
}

.subscriptions-row-backup {
    border-left-color: #22c55e;
}

.subscriptions-row-managed-it,
.subscriptions-row-other {
    border-left-color: #94a3b8;
}

.subscriptions-client,
.subscriptions-plan {
    color: #172b4d;
    font-weight: 700;
}

.subscriptions-identity {
    margin-top: 2px;
    color: #6b7c93;
    font-size: 12px;
}

.subscriptions-numeric {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.subscriptions-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 25px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-transform: capitalize;
    white-space: nowrap;
}

.subscriptions-status-active {
    background: #dcfce7;
    color: #166534;
}

.subscriptions-status-paused {
    background: #fff4e5;
    color: #b45309;
}

.subscriptions-status-cancelled,
.subscriptions-status-expired {
    background: #fee4e2;
    color: #b42318;
}

.subscriptions-highlight {
    padding: 1px 3px;
    border-radius: 3px;
    background: #fef9c3;
}

.subscriptions-state {
    padding: 34px 18px !important;
    color: #6b7c93;
    text-align: center;
}

.subscriptions-state-danger {
    color: #b42318;
}

.subscriptions-pagination {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    min-height: 58px;
    padding: 12px 18px;
    border-top: 1px solid #e6edf5;
    background: #fbfcfe;
}

.subscriptions-pagination button {
    min-width: 34px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid #cfd8e3;
    border-radius: 4px;
    background: #fff;
    color: #172b4d;
    font-size: 13px;
    font-weight: 600;
}

.subscriptions-pagination button:hover:not(:disabled),
.subscriptions-pagination button:disabled {
    border-color: #13b5ea;
    background: #13b5ea;
    color: #fff;
}

.subscription-form-panel .alert-msg {
    margin: 18px 18px 0;
}

.subscription-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    padding: 18px 18px 0;
}

.subscription-field {
    position: relative;
}

.subscription-field label {
    display: block;
    margin-bottom: 7px;
    color: #40566f;
    font-size: 13px;
    font-weight: 700;
}

.subscription-field .form-control,
.subscription-field .form-select {
    min-height: 40px;
    border-color: #cfd8e3;
    border-radius: 4px;
    color: #172b4d;
}

.subscription-field textarea.form-control {
    min-height: 130px;
    resize: vertical;
}

.subscription-search-box {
    position: relative;
}

.subscription-search-results {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    display: block;
    max-height: 280px;
    overflow-y: auto;
    z-index: 30;
    padding: 6px;
    border: 1px solid #cfd8e3;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 14px 30px rgba(12, 31, 53, 0.14);
}

.subscription-search-results:empty {
    display: none;
}

.subscription-search-result {
    padding: 9px 10px;
    border-radius: 4px;
    cursor: pointer;
}

.subscription-search-result:hover {
    background: #e7f7fd;
}

.subscription-result-title {
    color: #172b4d;
    font-weight: 700;
}

.subscription-result-sub {
    color: #6b7c93;
    font-size: 12px;
}

.plan-summary {
    display: none;
    margin: 18px 18px 0;
    padding: 16px;
    border: 1px solid #d7dee8;
    border-radius: 4px;
    background: #fbfcfe;
}

.plan-summary.is-visible {
    display: block;
}

.plan-summary h4 {
    margin: 0 0 10px;
    color: #172b4d;
    font-size: 16px;
    font-weight: 700;
}

.plan-summary div {
    color: #40566f;
    font-size: 14px;
}

.subscription-notes-field {
    margin: 18px 18px 0;
}

.subscription-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 18px 18px 0;
}

@media (max-width: 900px) {
    .subscriptions-page,
    .subscription-form-page {
        padding-inline: 12px;
    }

    .subscriptions-toolbar,
    .subscription-form-toolbar,
    .subscriptions-panel-header,
    .subscription-form-panel-header,
    .subscriptions-actions,
    .subscription-form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .subscriptions-search,
    .subscriptions-status-filter,
    .subscriptions-primary-action,
    .subscriptions-secondary-action {
        width: 100%;
    }

    .subscription-form-grid {
        grid-template-columns: 1fr;
    }

    .subscriptions-results-info {
        white-space: normal;
    }
}

/* =========================================================
   SETTINGS
========================================================= */

.settings-page {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 18px 34px;
}

.settings-toolbar {
    margin-bottom: 18px;
}

.settings-toolbar h1 {
    margin: 0;
    color: #172b4d;
    font-size: 28px;
    font-weight: 600;
}

.settings-toolbar p:last-child {
    margin: 3px 0 0;
    color: #6b7c93;
    font-size: 14px;
}

.settings-sidebar,
.settings-panel {
    border: 1px solid #d7dee8;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(12, 31, 53, 0.08);
}

.settings-sidebar {
    position: sticky;
    top: 88px;
    padding: 8px;
}

.settings-sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 42px;
    padding: 8px 10px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #40566f;
    font-size: 14px;
    font-weight: 700;
    text-align: left;
    transition: background-color 0.16s ease, color 0.16s ease;
}

.settings-sidebar .nav-link:hover,
.settings-sidebar .nav-link:focus {
    background: #e7f7fd;
    color: #0078a8;
}

.settings-sidebar .nav-link.active {
    background: #e7f7fd;
    color: #0078a8;
    box-shadow: inset 3px 0 0 #13b5ea;
}

.settings-icon-circle {
    display: inline-flex;
    flex: 0 0 30px;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    background: #eef2f6;
    color: #7a8ca1;
}

.settings-sidebar .nav-link.active .settings-icon-circle,
.settings-sidebar .nav-link:hover .settings-icon-circle {
    background: #13b5ea;
    color: #fff;
}

.settings-panel {
    margin-bottom: 18px;
    padding: 18px;
}

.settings-panel h5 {
    margin: 0 0 18px;
    color: #172b4d;
    font-size: 18px;
    font-weight: 700;
}

.settings-panel h6 {
    margin: 0 0 4px;
    color: #40566f;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.settings-panel .form-label {
    margin-bottom: 7px;
    color: #40566f;
    font-size: 13px;
    font-weight: 700;
}

.settings-panel .form-control,
.settings-panel .form-select {
    min-height: 40px;
    border-color: #cfd8e3;
    border-radius: 4px;
    color: #172b4d;
}

.settings-panel .form-control:focus,
.settings-panel .form-select:focus {
    border-color: #13b5ea;
    box-shadow: 0 0 0 3px rgba(19, 181, 234, 0.15);
}

.settings-panel textarea.form-control {
    min-height: 150px;
}

.settings-panel small {
    display: block;
    margin-top: 5px;
    color: #6b7c93 !important;
    font-size: 12px;
}

.settings-panel .badge {
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 700;
}

.settings-inline-action {
    margin-top: 15px;
}

.settings-primary-action,
.settings-secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 4px;
    font-weight: 600;
}

.settings-primary-action {
    min-width: 150px;
    background: #13b5ea;
    border-color: #13b5ea;
}

.settings-primary-action:hover,
.settings-primary-action:focus {
    background: #0f9fce;
    border-color: #0f9fce;
}

.settings-save-bar {
    display: flex;
    justify-content: flex-end;
    padding: 16px 0 0;
}

.settings-page .alert-success {
    border: 1px solid #bbf7d0;
    border-radius: 4px;
    background: #f0fdf4;
    color: #166534;
}

@media (max-width: 767px) {
    .settings-page {
        padding-inline: 12px;
    }

    .settings-sidebar {
        position: static;
    }

    .settings-save-bar,
    .settings-primary-action,
    .settings-secondary-action {
        width: 100%;
    }
}

/* =========================================================
   PROFILE
========================================================= */

.profile-page {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 18px 34px;
}

.profile-toolbar {
    margin-bottom: 18px;
}

.profile-toolbar h1 {
    margin: 0;
    color: #172b4d;
    font-size: 28px;
    font-weight: 600;
}

.profile-toolbar p:last-child {
    margin: 3px 0 0;
    color: #6b7c93;
    font-size: 14px;
}

.profile-grid {
    display: grid;
    grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
    gap: 18px;
}

.profile-panel {
    overflow: hidden;
    border: 1px solid #d7dee8;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(12, 31, 53, 0.08);
}

.profile-summary-panel {
    align-self: start;
}

.profile-summary-header,
.profile-panel-header {
    padding: 18px;
    border-bottom: 1px solid #e6edf5;
    background: #fbfcfe;
}

.profile-summary-header {
    display: flex;
    align-items: center;
    gap: 13px;
}

.profile-avatar {
    display: inline-flex;
    flex: 0 0 46px;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #13b5ea;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
}

.profile-summary-header h2,
.profile-panel-header h2 {
    margin: 0;
    color: #172b4d;
    font-size: 18px;
    font-weight: 700;
}

.profile-summary-header p,
.profile-panel-header p {
    margin: 3px 0 0;
    color: #6b7c93;
    font-size: 13px;
}

.profile-detail-list {
    padding: 18px;
}

.profile-detail-list div {
    padding: 12px 0;
    border-bottom: 1px solid #eef2f6;
}

.profile-detail-list div:first-child {
    padding-top: 0;
}

.profile-detail-list div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.profile-detail-list span {
    display: block;
    margin-bottom: 4px;
    color: #5f738c;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.profile-detail-list strong {
    color: #172b4d;
    font-size: 14px;
}

.profile-form {
    display: grid;
    gap: 16px;
    padding: 18px;
}

.profile-field label {
    display: block;
    margin-bottom: 7px;
    color: #40566f;
    font-size: 13px;
    font-weight: 700;
}

.profile-field .form-control {
    min-height: 40px;
    border-color: #cfd8e3;
    border-radius: 4px;
    color: #172b4d;
}

.profile-field .form-control:focus {
    border-color: #13b5ea;
    box-shadow: 0 0 0 3px rgba(19, 181, 234, 0.15);
}

.profile-actions {
    display: flex;
    justify-content: flex-end;
}

.profile-primary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 160px;
    border-radius: 4px;
    background: #13b5ea;
    border-color: #13b5ea;
    font-weight: 600;
}

.profile-primary-action:hover,
.profile-primary-action:focus {
    background: #0f9fce;
    border-color: #0f9fce;
}

.profile-alert {
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid;
    border-radius: 4px;
    font-size: 14px;
}

.profile-alert-success {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

@media (max-width: 760px) {
    .profile-page {
        padding-inline: 12px;
    }

    .profile-grid {
        grid-template-columns: 1fr;
    }

    .profile-actions,
    .profile-primary-action {
        width: 100%;
    }
}

/* =========================================================
   USERS
========================================================= */

.users-page,
.user-form-page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 18px 34px;
}

.users-toolbar,
.user-form-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.users-toolbar h1,
.user-form-toolbar h1 {
    margin: 0;
    color: #172b4d;
    font-size: 28px;
    font-weight: 600;
}

.users-toolbar p:last-child,
.user-form-toolbar p:last-child {
    margin: 3px 0 0;
    color: #6b7c93;
    font-size: 14px;
}

.users-primary-action,
.users-secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 4px;
    font-weight: 600;
}

.users-primary-action {
    background: #13b5ea;
    border-color: #13b5ea;
}

.users-primary-action:hover,
.users-primary-action:focus {
    background: #0f9fce;
    border-color: #0f9fce;
}

.users-panel,
.user-form-panel {
    overflow: hidden;
    border: 1px solid #d7dee8;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(12, 31, 53, 0.08);
}

.user-form-panel {
    overflow: visible;
}

.users-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-bottom: 1px solid #e6edf5;
    background: #fbfcfe;
}

.users-panel-header h2,
.user-form-section h2 {
    margin: 0;
    color: #172b4d;
    font-size: 16px;
    font-weight: 700;
}

.users-panel-header p,
.user-section-note {
    margin: 3px 0 0;
    color: #6b7c93;
    font-size: 13px;
}

.users-table-wrap {
    overflow-x: auto;
}

.users-table {
    width: 100%;
    min-width: 880px;
    margin: 0;
    border-collapse: collapse;
    color: #172b4d;
    font-size: 14px;
}

.users-table th {
    padding: 12px 18px;
    border-bottom: 1px solid #dbe3ed;
    background: #f7f9fc;
    color: #5f738c;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.users-table td {
    padding: 15px 18px;
    border-bottom: 1px solid #eef2f6;
    vertical-align: middle;
}

.users-table tbody tr:hover {
    background: #f3fbfe;
}

.users-name {
    color: #172b4d;
    font-weight: 700;
}

.users-email {
    color: #0078a8;
    text-decoration: none;
}

.users-email:hover {
    color: #005f85;
    text-decoration: underline;
}

.users-muted {
    color: #6b7c93;
}

.users-role,
.users-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 25px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-transform: capitalize;
    white-space: nowrap;
}

.users-role {
    background: #e7f7fd;
    color: #0078a8;
}

.users-role-admin {
    background: #fee4e2;
    color: #b42318;
}

.users-role-manager {
    background: #fff4e5;
    color: #b45309;
}

.users-status.is-active {
    background: #dcfce7;
    color: #166534;
}

.users-status.is-disabled {
    background: #eef2f6;
    color: #40566f;
}

.users-actions-cell {
    text-align: right;
    white-space: nowrap;
}

.users-row-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.users-row-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 4px 10px;
    border: 1px solid;
    border-radius: 4px;
    background: #fff;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.users-row-action.is-edit {
    border-color: #bae6fd;
    color: #0078a8;
}

.users-row-action.is-edit:hover {
    background: #e7f7fd;
}

.users-row-action.is-disable {
    border-color: #fecaca;
    color: #b42318;
}

.users-row-action.is-disable:hover {
    background: #fee4e2;
}

.users-state {
    padding: 34px 18px !important;
    color: #6b7c93;
    text-align: center;
}

.user-form-section {
    padding: 18px;
    border-bottom: 1px solid #e6edf5;
}

.user-form-section:last-of-type {
    border-bottom: 0;
}

.user-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 16px;
}

.user-form-grid-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.user-field {
    position: relative;
}

.user-field label {
    display: block;
    margin-bottom: 7px;
    color: #40566f;
    font-size: 13px;
    font-weight: 700;
}

.user-field .form-control,
.user-field .form-select {
    min-height: 40px;
    border-color: #cfd8e3;
    border-radius: 4px;
    color: #172b4d;
}

.user-field .form-control:focus,
.user-field .form-select:focus {
    border-color: #13b5ea;
    box-shadow: 0 0 0 3px rgba(19, 181, 234, 0.15);
}

.user-item-search {
    position: relative;
}

#itemResults {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    display: block;
    max-height: 280px;
    overflow-y: auto;
    z-index: 30;
    padding: 6px;
    border: 1px solid #cfd8e3;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 14px 30px rgba(12, 31, 53, 0.14);
}

#itemResults:empty {
    display: none;
}

.user-item-result {
    display: block;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.user-item-result:hover {
    background: #e7f7fd;
}

.user-item-result-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.item-code {
    color: #172b4d;
    font-weight: 700;
}

.item-name {
    color: #6b7c93;
    font-size: 12px;
}

.item-type {
    color: #0078a8;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.user-item-empty {
    padding: 12px;
    color: #6b7c93;
    font-size: 13px;
    text-align: center;
}

.user-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 18px;
    border-top: 1px solid #e6edf5;
    background: #fbfcfe;
}

@media (max-width: 860px) {
    .users-page,
    .user-form-page {
        padding-inline: 12px;
    }

    .users-toolbar,
    .user-form-toolbar,
    .users-panel-header,
    .user-form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .users-primary-action,
    .users-secondary-action,
    .user-form-actions .btn {
        width: 100%;
    }

    .user-form-grid,
    .user-form-grid-three {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   AUTH LOGIN
========================================================= */

.auth-body {
    min-height: 100vh;
    padding-top: 0;
    background: #f5f7fa;
}

.auth-body > .container {
    max-width: none;
    width: 100%;
    min-height: 100vh;
    padding: 0;
}

.auth-login-page {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px 16px;
}

.auth-login-card {
    width: min(100%, 430px);
    padding: 28px;
    border: 1px solid #d7dee8;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(12, 31, 53, 0.12);
}

.auth-login-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.auth-login-logo img {
    max-width: 180px;
    height: auto;
}

.auth-login-header {
    margin-bottom: 20px;
    text-align: center;
}

.auth-login-header h1 {
    margin: 0;
    color: #172b4d;
    font-size: 24px;
    font-weight: 700;
}

.auth-login-header p:last-child {
    margin: 5px 0 0;
    color: #6b7c93;
    font-size: 14px;
}

.auth-login-form {
    display: grid;
    gap: 15px;
}

.auth-login-field label {
    display: block;
    margin-bottom: 7px;
    color: #40566f;
    font-size: 13px;
    font-weight: 700;
}

.auth-login-field .form-control {
    min-height: 42px;
    border-color: #cfd8e3;
    border-radius: 4px;
    color: #172b4d;
}

.auth-login-field .form-control:focus {
    border-color: #13b5ea;
    box-shadow: 0 0 0 3px rgba(19, 181, 234, 0.15);
}

.auth-login-links {
    display: flex;
    justify-content: flex-end;
}

.auth-login-links a {
    color: #0078a8;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.auth-login-links a:hover {
    color: #005f85;
    text-decoration: underline;
}

.auth-login-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 42px;
    border-radius: 4px;
    background: #13b5ea;
    border-color: #13b5ea;
    font-weight: 700;
}

.auth-login-button:hover,
.auth-login-button:focus {
    background: #0f9fce;
    border-color: #0f9fce;
}

.auth-login-alert {
    margin-bottom: 16px;
    padding: 11px 12px;
    border: 1px solid #fecaca;
    border-radius: 4px;
    background: #fff1f2;
    color: #b42318;
    font-size: 14px;
}

.auth-login-footer {
    margin-top: 16px;
    color: #6b7c93;
    font-size: 12px;
    text-align: center;
}

@media (max-width: 520px) {
    .auth-login-page {
        justify-content: flex-start;
        padding-top: 22px;
    }

    .auth-login-card {
        padding: 22px;
    }
}

/* =========================================================
   SUBSCRIPTION OVERVIEW
========================================================= */

.subscription-overview-page {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 18px 34px;
}

.subscription-overview-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.subscription-overview-toolbar h1 {
    margin: 0;
    color: #172b4d;
    font-size: 28px;
    font-weight: 600;
}

.subscription-overview-toolbar p:last-child {
    margin: 3px 0 0;
    color: #6b7c93;
    font-size: 14px;
}

.subscription-overview-total-card,
.subscription-overview-filter-panel,
.subscription-overview-client-panel,
.subscription-overview-empty,
.subscription-overview-error {
    border: 1px solid #d7dee8;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(12, 31, 53, 0.08);
}

.subscription-overview-total-card {
    min-width: 220px;
    padding: 15px 18px;
    text-align: right;
}

.subscription-overview-total-card span,
.subscription-overview-client-total span {
    display: block;
    margin-bottom: 4px;
    color: #5f738c;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.subscription-overview-total-card strong,
.subscription-overview-client-total strong {
    color: #166534;
    font-size: 24px;
    line-height: 1.15;
}

.subscription-overview-filter-panel {
    margin-bottom: 18px;
    padding: 18px;
}

.subscription-overview-filter-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    gap: 16px;
    align-items: end;
}

.subscription-overview-field label {
    display: block;
    margin-bottom: 7px;
    color: #40566f;
    font-size: 13px;
    font-weight: 700;
}

.subscription-overview-field .form-control,
.subscription-overview-field .form-select {
    min-height: 40px;
    border-color: #cfd8e3;
    border-radius: 4px;
    color: #172b4d;
}

.subscription-overview-field .form-control:focus,
.subscription-overview-field .form-select:focus {
    border-color: #13b5ea;
    box-shadow: 0 0 0 3px rgba(19, 181, 234, 0.15);
}

.subscription-overview-actions {
    display: flex;
    gap: 8px;
}

.subscription-overview-primary-action,
.subscription-overview-secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    border-radius: 4px;
    font-weight: 600;
}

.subscription-overview-primary-action {
    min-width: 112px;
    background: #13b5ea;
    border-color: #13b5ea;
}

.subscription-overview-primary-action:hover,
.subscription-overview-primary-action:focus {
    background: #0f9fce;
    border-color: #0f9fce;
}

.subscription-overview-secondary-action {
    min-width: 92px;
}

.subscription-overview-loading,
.subscription-overview-empty {
    padding: 44px 18px;
    color: #6b7c93;
    text-align: center;
}

.subscription-overview-loading .spinner-border {
    width: 2rem;
    height: 2rem;
    margin-bottom: 12px;
    color: #13b5ea;
}

.subscription-overview-client-panel {
    overflow: hidden;
    margin-bottom: 18px;
}

.subscription-overview-client-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-bottom: 1px solid #e6edf5;
    background: #fbfcfe;
}

.subscription-overview-client-header h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 4px;
    color: #172b4d;
    font-size: 17px;
    font-weight: 700;
}

.subscription-overview-client-header h2 i {
    color: #13b5ea;
}

.subscription-overview-client-header div div {
    color: #6b7c93;
    font-size: 13px;
}

.subscription-overview-client-total {
    text-align: right;
    white-space: nowrap;
}

.subscription-overview-table-wrap {
    overflow-x: auto;
}

.subscription-overview-table {
    width: 100%;
    min-width: 860px;
    margin: 0;
    border-collapse: collapse;
    color: #172b4d;
    font-size: 14px;
}

.subscription-overview-table th {
    padding: 12px 18px;
    border-bottom: 1px solid #dbe3ed;
    background: #f7f9fc;
    color: #5f738c;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.subscription-overview-table td {
    padding: 15px 18px;
    border-bottom: 1px solid #eef2f6;
    vertical-align: middle;
}

.subscription-overview-table tbody tr:hover {
    background: #f3fbfe;
}

.subscription-overview-table tr:last-child td {
    border-bottom: 0;
}

.subscription-overview-plan-name {
    color: #172b4d;
    font-weight: 700;
}

.subscription-overview-plan-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 3px;
    color: #40566f;
    font-size: 12px;
}

.subscription-overview-table small {
    display: block;
    margin-top: 3px;
    color: #6b7c93;
    font-size: 12px;
}

.subscription-overview-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 25px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #e7f7fd;
    color: #0078a8;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.subscription-overview-money {
    color: #172b4d;
    font-weight: 700;
    white-space: nowrap;
}

.subscription-overview-error {
    padding: 14px 16px;
    border-color: #fecaca;
    background: #fff1f2;
    color: #b42318;
    font-size: 14px;
}

@media (max-width: 960px) {
    .subscription-overview-page {
        padding-inline: 12px;
    }

    .subscription-overview-toolbar,
    .subscription-overview-client-header {
        align-items: stretch;
        flex-direction: column;
    }

    .subscription-overview-total-card,
    .subscription-overview-client-total {
        text-align: left;
    }

    .subscription-overview-filter-form {
        grid-template-columns: 1fr;
    }

    .subscription-overview-actions,
    .subscription-overview-primary-action,
    .subscription-overview-secondary-action {
        width: 100%;
    }
}

/* =========================================================
   REPORTS
========================================================= */

.reports-page {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 18px 34px;
}

.reports-toolbar {
    margin-bottom: 18px;
}

.reports-toolbar h1 {
    margin: 0;
    color: #172b4d;
    font-size: 28px;
    font-weight: 600;
}

.reports-toolbar p:last-child {
    margin: 3px 0 0;
    color: #6b7c93;
    font-size: 14px;
}

.reports-filter-panel,
.reports-panel,
.reports-empty {
    border: 1px solid #d7dee8;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(12, 31, 53, 0.08);
}

.reports-filter-panel {
    margin-bottom: 18px;
    padding: 18px;
}

.reports-filter-form,
.reports-toolbar-row {
    display: flex;
    align-items: end;
    gap: 16px;
    flex-wrap: wrap;
}

.reports-stock-filter-form {
    flex: 1 1 auto;
}

.reports-export-form {
    display: flex;
    gap: 8px;
    align-items: end;
    margin-left: auto;
}

.reports-field {
    min-width: 190px;
}

.reports-field label {
    display: block;
    margin-bottom: 7px;
    color: #40566f;
    font-size: 13px;
    font-weight: 700;
}

.reports-field .form-control,
.reports-field .form-select {
    min-height: 40px;
    border-color: #cfd8e3;
    border-radius: 4px;
    color: #172b4d;
}

.reports-field .form-control:focus,
.reports-field .form-select:focus {
    border-color: #13b5ea;
    box-shadow: 0 0 0 3px rgba(19, 181, 234, 0.15);
}

.reports-check-field {
    min-height: 40px;
    display: flex;
    align-items: center;
}

.reports-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #40566f;
    font-size: 14px;
    font-weight: 700;
}

.reports-filter-actions {
    display: flex;
    gap: 8px;
}

.reports-primary-action,
.reports-secondary-action,
.reports-warning-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    border-radius: 4px;
    font-weight: 600;
}

.reports-primary-action {
    background: #13b5ea;
    border-color: #13b5ea;
}

.reports-primary-action:hover,
.reports-primary-action:focus {
    background: #0f9fce;
    border-color: #0f9fce;
}

.reports-warning-action {
    margin-bottom: 14px;
    border: 1px solid #fedf89;
    background: #fffbeb;
    color: #92400e;
    text-decoration: none;
}

.reports-warning-action:hover {
    background: #fef3c7;
    color: #92400e;
}

.reports-notice {
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 1px solid;
    border-radius: 4px;
    font-size: 14px;
}

.reports-notice-warning {
    border-color: #fedf89;
    background: #fffbeb;
    color: #92400e;
}

.reports-panel {
    overflow: hidden;
}

.reports-table-wrap {
    overflow-x: auto;
}

.report-table {
    width: 100%;
    min-width: 980px;
    margin: 0;
    border-collapse: collapse;
    color: #172b4d;
    font-size: 14px;
}

.report-table th {
    padding: 12px 14px;
    border-bottom: 1px solid #dbe3ed;
    background: #f7f9fc;
    color: #5f738c;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.report-table th a {
    color: inherit;
    text-decoration: none;
}

.report-table th a:hover {
    color: #0078a8;
}

.report-table td {
    padding: 13px 14px;
    border-bottom: 1px solid #eef2f6;
    vertical-align: middle;
}

.report-table tbody tr:hover {
    background: #f3fbfe;
}

.report-table tfoot th {
    background: #fbfcfe;
    color: #172b4d;
    font-size: 13px;
}

.reports-row-success {
    background: #f0fdf4;
}

.reports-row-warning {
    background: #fffbeb;
}

.reports-row-muted {
    background: #f8fafc;
}

.reports-number {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.reports-subtext {
    display: block;
    margin-top: 2px;
    color: #6b7c93;
    font-size: 12px;
}

.reports-danger-text {
    color: #b42318;
    font-weight: 700;
}

.reports-success-text {
    color: #166534;
    font-weight: 700;
}

.reports-status {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.reports-status-invoiced {
    background: #dcfce7;
    color: #166534;
}

.reports-status-muted {
    background: #eef2f6;
    color: #40566f;
}

.reports-status-open {
    background: #fff4e5;
    color: #b45309;
}

.reports-total-success th {
    background: #f0fdf4 !important;
    color: #166534 !important;
}

.reports-total-danger th {
    background: #fff1f2 !important;
    color: #b42318 !important;
}

.reports-empty,
.reports-state {
    padding: 34px 18px !important;
    color: #6b7c93;
    text-align: center;
}

.hover-cell {
    cursor: pointer;
    color: #0078a8;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.hover-tooltip {
    position: absolute;
    z-index: 1000;
    display: flex;
    width: 280px;
    max-height: 220px;
    overflow: hidden;
    flex-direction: column;
    border: 1px solid #d7dee8;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 14px 30px rgba(12, 31, 53, 0.16);
    font-size: 12px;
}

.tooltip-header {
    padding: 8px 10px;
    background: #fbfcfe;
    border-bottom: 1px solid #e6edf5;
    color: #172b4d;
    font-weight: 700;
}

.tooltip-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    border-bottom: 1px solid #eef2f6;
}

.tooltip-row:nth-child(even) {
    background: #fbfcfe;
}

.tooltip-row span:first-child {
    color: #40566f;
}

.tooltip-row span:last-child {
    color: #172b4d;
    font-weight: 700;
}

.tooltip-empty {
    padding: 10px;
    color: #6b7c93;
}

@media (max-width: 860px) {
    .reports-page {
        padding-inline: 12px;
    }

    .reports-filter-form,
    .reports-toolbar-row,
    .reports-export-form,
    .reports-filter-actions,
    .reports-primary-action,
    .reports-secondary-action,
    .reports-warning-action {
        width: 100%;
    }

    .reports-field {
        width: 100%;
    }
}

/* =========================================================
   VOIP USAGE
========================================================= */

.voip-usage-page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 18px 34px;
}

.voip-usage-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.voip-usage-toolbar h1 {
    margin: 0;
    color: #172b4d;
    font-size: 28px;
    font-weight: 600;
}

.voip-usage-toolbar p:last-child {
    margin: 3px 0 0;
    color: #6b7c93;
    font-size: 14px;
}

.voip-usage-panel,
.voip-usage-summary-card,
.voip-usage-result-panel {
    border: 1px solid #d7dee8;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(12, 31, 53, 0.08);
}

.voip-usage-panel {
    overflow: hidden;
}

.voip-usage-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-bottom: 1px solid #e6edf5;
    background: #fbfcfe;
}

.voip-usage-panel-header h2,
.voip-usage-result-panel h2 {
    margin: 0;
    color: #172b4d;
    font-size: 18px;
    font-weight: 700;
}

.voip-usage-panel-header p,
.voip-usage-result-panel p {
    margin: 3px 0 0;
    color: #6b7c93;
    font-size: 14px;
}

.voip-usage-form {
    padding: 18px;
}

.voip-usage-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.voip-usage-field-wide {
    grid-column: 1 / -1;
}

.voip-usage-field label {
    display: block;
    margin-bottom: 7px;
    color: #40566f;
    font-size: 13px;
    font-weight: 700;
}

.voip-usage-field .form-control,
.voip-usage-field .form-select {
    min-height: 40px;
    border-color: #cfd8e3;
    border-radius: 4px;
    color: #172b4d;
}

.voip-usage-field .form-control:focus,
.voip-usage-field .form-select:focus {
    border-color: #13b5ea;
    box-shadow: 0 0 0 3px rgba(19, 181, 234, 0.15);
}

.voip-usage-field small {
    display: block;
    margin-top: 6px;
    color: #6b7c93;
    font-size: 12px;
}

.voip-usage-note {
    margin-top: 18px;
    padding: 12px 14px;
    border: 1px solid #bae6fd;
    border-radius: 4px;
    background: #f0f9ff;
    color: #075985;
    font-size: 14px;
}

.voip-usage-actions,
.voip-usage-confirm-form {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 18px;
}

.voip-usage-confirm-form {
    padding: 14px 18px;
    border-top: 1px solid #e6edf5;
    background: #fbfcfe;
}

.voip-usage-primary-action,
.voip-usage-secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    border-radius: 4px;
    font-weight: 600;
}

.voip-usage-primary-action {
    background: #13b5ea;
    border-color: #13b5ea;
}

.voip-usage-primary-action:hover,
.voip-usage-primary-action:focus {
    background: #0f9fce;
    border-color: #0f9fce;
}

.voip-usage-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.voip-usage-summary-card {
    padding: 18px;
    border-top: 3px solid #13b5ea;
}

.voip-usage-summary-card span {
    display: block;
    margin-bottom: 6px;
    color: #5f738c;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.voip-usage-summary-card strong {
    color: #172b4d;
    font-size: 28px;
    line-height: 1.15;
}

.voip-usage-summary-card.is-success {
    border-top-color: #22c55e;
}

.voip-usage-summary-card.is-success strong {
    color: #166534;
}

.voip-usage-summary-card.is-danger {
    border-top-color: #ef4444;
}

.voip-usage-summary-card.is-danger strong {
    color: #b42318;
}

.voip-usage-table-wrap {
    overflow-x: auto;
}

.voip-usage-table {
    width: 100%;
    min-width: 880px;
    margin: 0;
    border-collapse: collapse;
    color: #172b4d;
    font-size: 14px;
}

.voip-usage-table th {
    padding: 12px 18px;
    border-bottom: 1px solid #dbe3ed;
    background: #f7f9fc;
    color: #5f738c;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.voip-usage-table td {
    padding: 15px 18px;
    border-bottom: 1px solid #eef2f6;
    vertical-align: middle;
}

.voip-usage-table tbody tr:hover {
    background: #f3fbfe;
}

.voip-usage-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 25px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.voip-usage-status.is-matched {
    background: #dcfce7;
    color: #166534;
}

.voip-usage-status.is-unmatched {
    background: #fee4e2;
    color: #b42318;
}

.voip-usage-state {
    padding: 34px 18px !important;
    color: #6b7c93;
    text-align: center;
}

.voip-usage-result-panel {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
}

.voip-usage-result-panel.is-success {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.voip-usage-result-panel.is-danger {
    border-color: #fecaca;
    background: #fff1f2;
}

.voip-usage-result-icon {
    display: inline-flex;
    flex: 0 0 42px;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #fff;
    font-size: 23px;
}

.voip-usage-result-panel.is-success .voip-usage-result-icon {
    color: #166534;
}

.voip-usage-result-panel.is-danger .voip-usage-result-icon {
    color: #b42318;
}

@media (max-width: 760px) {
    .voip-usage-page {
        padding-inline: 12px;
    }

    .voip-usage-toolbar,
    .voip-usage-actions,
    .voip-usage-confirm-form {
        align-items: stretch;
        flex-direction: column;
    }

    .voip-usage-grid,
    .voip-usage-summary-grid {
        grid-template-columns: 1fr;
    }

    .voip-usage-primary-action,
    .voip-usage-secondary-action {
        width: 100%;
    }
}


/* =========================================================
   LAYOUT
========================================================= */

.form-wrapper,
.tickets-wrapper {
    max-width: 1100px;
    margin: auto;
    padding: 25px;
}


/* =========================================================
   COMPONENTS - CARDS
========================================================= */

.card {
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.card-header {
    background: #f8fafc;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}


/* =========================================================
   COMPONENTS - SEARCH
========================================================= */

.search-box {
    position: relative;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    padding: 12px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    border-radius: 8px;
    margin-top: 4px;
    max-height: 260px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}


.search-result:hover {
    background: #f8fafc;
}

.search-result:last-child{
    border-bottom:none;
}

.search-results:empty{
    display:none;
}


/* =========================================================
   COMPONENTS - AVATAR
========================================================= */

.avatar-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 600;
    color: white;
}

.small-avatar {
    width: 28px;
    height: 28px;
    font-size: 12px;
    margin-right: 6px;
}

.avatar-blue { background: #3b82f6; }
.avatar-green { background: #10b981; }
.avatar-purple { background: #8b5cf6; }
.avatar-orange { background: #f59e0b; }
.avatar-pink { background: #ec4899; }
.avatar-indigo { background: #6366f1; }
.avatar-teal { background: #14b8a6; }
.avatar-red { background: #ef4444; }
.avatar-cyan { background: #06b6d4; }
.avatar-lime { background: #84cc16; }

.avatar-gray { background: #94a3b8; }

/* =========================================================
   CLIENTS
========================================================= */

.clients-page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 18px 34px;
}

.clients-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.clients-toolbar h1 {
    margin: 0;
    color: #172b4d;
    font-size: 28px;
    font-weight: 600;
}

.page-kicker {
    margin: 0 0 3px;
    color: #5f738c;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
}

.clients-panel {
    overflow: hidden;
    background: #fff;
    border: 1px solid #d7dee8;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(12, 31, 53, 0.08);
}

.clients-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-bottom: 1px solid #e6edf5;
    background: #fbfcfe;
}

.clients-search {
    position: relative;
    flex: 1 1 420px;
    max-width: 520px;
}

.clients-search i {
    position: absolute;
    top: 50%;
    left: 12px;
    z-index: 1;
    color: #7a8ca1;
    transform: translateY(-50%);
}

.clients-search .form-control {
    min-height: 40px;
    padding-left: 38px;
    border-color: #cfd8e3;
    border-radius: 4px;
    color: #172b4d;
}

.clients-search .form-control:focus {
    border-color: #13b5ea;
    box-shadow: 0 0 0 3px rgba(19, 181, 234, 0.15);
}

.clients-results-info {
    color: #5f738c;
    font-size: 13px;
    white-space: nowrap;
}

.clients-table-wrap {
    overflow-x: auto;
}

.clients-table {
    width: 100%;
    min-width: 850px;
    margin: 0;
    border-collapse: collapse;
    color: #172b4d;
    font-size: 14px;
}

.clients-table th {
    padding: 12px 18px;
    border-bottom: 1px solid #dbe3ed;
    background: #f7f9fc;
    color: #5f738c;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.clients-table td {
    padding: 15px 18px;
    border-bottom: 1px solid #eef2f6;
    vertical-align: middle;
}

.clients-table tbody tr {
    cursor: pointer;
    transition: background-color 0.16s ease;
}

.clients-table tbody tr:hover {
    background: #f3fbfe;
}

.sortable {
    cursor: pointer;
    user-select: none;
}

.sortable::after {
    display: inline-block;
    width: 11px;
    margin-left: 6px;
    color: #13b5ea;
    font-size: 10px;
}

.sortable.sort-asc::after {
    content: "^";
}

.sortable.sort-desc::after {
    content: "v";
}

.client-cell {
    display: flex;
    align-items: center;
    gap: 11px;
}

.client-avatar {
    display: inline-flex;
    flex: 0 0 34px;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #13b5ea;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}

.client-info {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.client-name {
    color: #172b4d;
    font-weight: 700;
}

.client-sub {
    max-width: 360px;
    overflow: hidden;
    color: #6b7c93;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.client-link {
    color: #0078a8;
    text-decoration: none;
}

.client-link:hover {
    color: #005f85;
    text-decoration: underline;
}

.ticket-badge {
    display: inline-flex;
    min-width: 30px;
    align-items: center;
    justify-content: center;
    padding: 4px 9px;
    border-radius: 999px;
    background: #e7f7fd;
    color: #0078a8;
    font-size: 12px;
    font-weight: 700;
}

.clients-state {
    padding: 34px 18px !important;
    color: #6b7c93;
    text-align: center;
}

.clients-state-danger {
    color: #b42318;
}

.clients-footer {
    display: flex;
    justify-content: flex-end;
    min-height: 58px;
    padding: 12px 18px;
    border-top: 1px solid #e6edf5;
    background: #fbfcfe;
}

.clients-pagination {
    display: flex;
    align-items: center;
    gap: 6px;
}

.clients-page-btn {
    min-width: 34px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid #cfd8e3;
    border-radius: 4px;
    background: #fff;
    color: #172b4d;
    font-size: 13px;
    font-weight: 600;
}

.clients-page-btn:hover:not(:disabled),
.clients-page-btn.is-active {
    border-color: #13b5ea;
    background: #13b5ea;
    color: #fff;
}

.clients-page-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

@media (max-width: 720px) {
    .clients-page {
        padding-inline: 12px;
    }

    .clients-toolbar,
    .clients-panel-header {
        align-items: stretch;
        flex-direction: column;
    }

    .clients-search {
        width: 100%;
        max-width: none;
    }

    .clients-results-info {
        white-space: normal;
    }
}

/* =========================================================
   STOCK PROCESS
========================================================= */

.stock-process-page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 18px 34px;
}

.stock-process-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.stock-process-toolbar h1 {
    margin: 0;
    color: #172b4d;
    font-size: 28px;
    font-weight: 600;
}

.stock-process-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.stock-process-summary-card,
.stock-process-panel {
    border: 1px solid #d7dee8;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(12, 31, 53, 0.08);
}

.stock-process-summary-card {
    padding: 18px;
}

.stock-process-summary-card span {
    display: block;
    margin-bottom: 5px;
    color: #5f738c;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.stock-process-summary-card strong {
    display: block;
    color: #0078a8;
    font-size: 28px;
    line-height: 1.15;
}

.stock-process-panel {
    overflow: visible;
    margin-bottom: 18px;
}

.stock-process-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-bottom: 1px solid #e6edf5;
    background: #fbfcfe;
}

.stock-process-panel-header h2 {
    margin: 0;
    color: #172b4d;
    font-size: 16px;
    font-weight: 700;
}

.stock-process-panel-body {
    padding: 18px;
}

.stock-process-entry-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
    gap: 18px;
}

.stock-process-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stock-process-field {
    position: relative;
}

.stock-process-field .form-label {
    color: #40566f;
    font-size: 13px;
    font-weight: 700;
}

.stock-process-field .form-control,
.stock-process-field .form-select,
.stock-return-modal-content input {
    min-height: 40px;
    border-color: #cfd8e3;
    border-radius: 4px;
    color: #172b4d;
}

.stock-process-field .form-control:focus,
.stock-process-field .form-select:focus,
.stock-return-modal-content input:focus {
    border-color: #13b5ea;
    box-shadow: 0 0 0 3px rgba(19, 181, 234, 0.15);
}

.stock-process-input-icon {
    position: relative;
}

.stock-process-input-icon i {
    position: absolute;
    top: 50%;
    left: 12px;
    z-index: 1;
    color: #7a8ca1;
    transform: translateY(-50%);
}

.stock-process-input-icon .form-control {
    padding-left: 38px;
}

.stock-process-number-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

#line_total {
    background: #fbfcfe;
    font-weight: 700;
}

.stock-process-primary-action,
.stock-process-secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 4px;
    font-weight: 600;
}

.stock-process-primary-action {
    background: #13b5ea;
    border-color: #13b5ea;
}

.stock-process-primary-action:hover,
.stock-process-primary-action:focus {
    background: #0f9fce;
    border-color: #0f9fce;
}

.stock-process-results {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    display: block;
    max-height: 280px;
    overflow-y: auto;
    z-index: 30;
    padding: 6px;
    border: 1px solid #cfd8e3;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 14px 30px rgba(12, 31, 53, 0.14);
}

.client-results.stock-process-results {
    display: block;
}

.stock-process-results:empty {
    display: none;
}

.stock-process-results .client-result {
    padding: 9px 10px;
    border-radius: 4px;
    cursor: pointer;
}

.stock-process-results .client-result:hover {
    background: #e7f7fd;
}

.stock-process-result-title {
    color: #172b4d;
    font-weight: 700;
}

.stock-process-result-sub,
.stock-process-empty {
    color: #6b7c93;
    font-size: 12px;
}

.stock-process-stock-result {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.stock-process-result-price {
    color: #166534;
    font-weight: 700;
    white-space: nowrap;
}

.stock-process-client-card {
    height: 100%;
    min-height: 330px;
    padding: 18px;
    border: 1px solid #d7dee8;
    border-radius: 4px;
    background: #fbfcfe;
}

.stock-process-client-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e6edf5;
}

.stock-process-client-avatar {
    display: inline-flex;
    flex: 0 0 42px;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #13b5ea;
    color: #fff;
    font-weight: 700;
}

.stock-process-client-header h2 {
    margin: 0;
    color: #172b4d;
    font-size: 18px;
    font-weight: 700;
}

.stock-process-client-header p {
    margin: 2px 0 0;
    color: #6b7c93;
    font-size: 13px;
}

.stock-process-client-body {
    display: grid;
    gap: 14px;
    padding-top: 14px;
}

.stock-process-client-section {
    padding-top: 14px;
    border-top: 1px solid #e6edf5;
}

.stock-process-client-section:first-child {
    padding-top: 0;
    border-top: 0;
}

.stock-process-client-section h3 {
    margin: 0 0 8px;
    color: #40566f;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.stock-process-profile-item {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-bottom: 8px;
    color: #40566f;
    font-size: 14px;
}

.stock-process-profile-item i {
    color: #13b5ea;
}

.stock-process-table-wrap {
    max-height: 460px;
    overflow: auto;
}

.stock-process-table {
    width: 100%;
    min-width: 760px;
    margin: 0;
    border-collapse: collapse;
    color: #172b4d;
    font-size: 14px;
}

.stock-process-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 12px 14px;
    border-bottom: 1px solid #dbe3ed;
    background: #f7f9fc;
    color: #5f738c;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.stock-process-table td {
    padding: 13px 14px;
    border-bottom: 1px solid #eef2f6;
    vertical-align: middle;
}

.stock-process-table tbody tr:hover {
    background: #f3fbfe;
}

.stock-process-row-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.stock-process-row-action {
    min-height: 30px;
    padding: 4px 9px;
    border: 1px solid;
    border-radius: 4px;
    background: #fff;
    font-size: 12px;
    font-weight: 700;
}

.stock-process-row-action.is-return {
    border-color: #bae6fd;
    color: #0078a8;
}

.stock-process-row-action.is-return:hover {
    background: #e7f7fd;
}

.stock-process-row-action.is-delete {
    border-color: #fecaca;
    color: #b42318;
}

.stock-process-row-action.is-delete:hover {
    background: #fee4e2;
}

.stock-return-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 18px;
    background: rgba(12, 31, 53, 0.42);
}

.stock-return-modal.is-open {
    display: flex;
}

.stock-return-modal-content {
    width: min(100%, 420px);
    padding: 20px;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 18px 44px rgba(12, 31, 53, 0.22);
}

.stock-return-modal-content h3 {
    margin: 0 0 16px;
    color: #172b4d;
    font-size: 20px;
    font-weight: 700;
}

.stock-return-modal-content label {
    color: #40566f;
    font-size: 13px;
    font-weight: 700;
}

.stock-return-modal-content input {
    width: 100%;
    margin-top: 6px;
}

.stock-return-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

@media (max-width: 820px) {
    .stock-process-page {
        padding-inline: 12px;
    }

    .stock-process-summary-grid,
    .stock-process-entry-grid,
    .stock-process-number-grid {
        grid-template-columns: 1fr;
    }

    .stock-process-row-actions,
    .stock-return-actions {
        flex-direction: column;
    }

    .stock-process-primary-action,
    .stock-process-secondary-action {
        width: 100%;
    }
}

/* =========================================================
   INVOICES INDEX
========================================================= */

.invoices-page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 18px 34px;
}

.invoices-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.invoices-toolbar h1 {
    margin: 0;
    color: #172b4d;
    font-size: 28px;
    font-weight: 600;
}

.invoices-panel {
    overflow: hidden;
    background: #fff;
    border: 1px solid #d7dee8;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(12, 31, 53, 0.08);
}

.invoices-filter-bar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(150px, 190px) minmax(150px, 190px) auto;
    gap: 12px;
    align-items: center;
    padding: 16px 18px;
    border-bottom: 1px solid #e6edf5;
    background: #fbfcfe;
}

.invoices-search {
    position: relative;
}

.invoices-search i {
    position: absolute;
    top: 50%;
    left: 12px;
    z-index: 1;
    color: #7a8ca1;
    transform: translateY(-50%);
}

.invoices-search .form-control {
    padding-left: 38px;
}

.invoices-filter-bar .form-control,
.invoices-filter-bar .form-select {
    min-height: 40px;
    border-color: #cfd8e3;
    border-radius: 4px;
    color: #172b4d;
}

.invoices-filter-bar .form-control:focus,
.invoices-filter-bar .form-select:focus {
    border-color: #13b5ea;
    box-shadow: 0 0 0 3px rgba(19, 181, 234, 0.15);
}

.invoices-primary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    border-radius: 4px;
    background: #13b5ea;
    border-color: #13b5ea;
    font-weight: 600;
}

.invoices-primary-action:hover,
.invoices-primary-action:focus {
    background: #0f9fce;
    border-color: #0f9fce;
}

.invoices-table-wrap {
    overflow-x: auto;
}

.invoices-table {
    width: 100%;
    min-width: 900px;
    margin: 0;
    border-collapse: collapse;
    color: #172b4d;
    font-size: 14px;
}

.invoices-table th {
    padding: 12px 18px;
    border-bottom: 1px solid #dbe3ed;
    background: #f7f9fc;
    color: #5f738c;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.invoices-table td {
    padding: 15px 18px;
    border-bottom: 1px solid #eef2f6;
    vertical-align: middle;
}

.invoice-row {
    cursor: pointer;
    transition: background-color 0.16s ease;
}

.invoice-row:hover {
    background: #f3fbfe;
}

.invoice-number {
    color: #0078a8;
}

.invoice-status,
.invoice-sync {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-transform: capitalize;
}

.invoice-status.is-paid,
.invoice-sync.is-synced {
    background: #dcfce7;
    color: #166534;
}

.invoice-status.is-overdue {
    background: #fee4e2;
    color: #b42318;
}

.invoice-status.is-draft,
.invoice-status.is-neutral {
    background: #eef2f6;
    color: #40566f;
}

.invoice-sync.is-pending {
    background: #fff4e5;
    color: #b45309;
}

.invoice-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 4px 10px;
    border: 1px solid #bae6fd;
    border-radius: 4px;
    background: #fff;
    color: #0078a8;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.invoice-action-btn:hover {
    background: #e7f7fd;
    color: #0078a8;
}

.invoices-state {
    padding: 34px 18px !important;
    color: #6b7c93;
    text-align: center;
}

.invoices-pagination {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    padding: 12px 18px;
    border-top: 1px solid #e6edf5;
    background: #fbfcfe;
}

.invoices-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid #cfd8e3;
    border-radius: 4px;
    background: #fff;
    color: #172b4d;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.invoices-page-btn:hover,
.invoices-page-btn.is-active {
    border-color: #13b5ea;
    background: #13b5ea;
    color: #fff;
}

@media (max-width: 820px) {
    .invoices-page {
        padding-inline: 12px;
    }

    .invoices-filter-bar {
        grid-template-columns: 1fr;
    }

    .invoices-primary-action {
        width: 100%;
    }

    .invoices-pagination {
        justify-content: flex-start;
        overflow-x: auto;
    }
}

/* =========================================================
   INVOICE VIEW
========================================================= */

.invoice-view-page {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 18px 34px;
}

.invoice-view-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.invoice-view-toolbar h1 {
    margin: 0;
    color: #172b4d;
    font-size: 28px;
    font-weight: 600;
}

.invoice-view-panel {
    overflow: hidden;
    background: #fff;
    border: 1px solid #d7dee8;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(12, 31, 53, 0.08);
}

.invoice-view-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 22px;
    border-bottom: 1px solid #e6edf5;
    background: #fbfcfe;
}

.invoice-view-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    color: #5f738c;
    font-size: 13px;
}

.invoice-view-xero-ref {
    margin-top: 8px;
    color: #166534;
    font-size: 13px;
    font-weight: 700;
}

.invoice-view-status-block {
    display: flex;
    align-items: flex-end;
    flex-direction: column;
    gap: 8px;
}

.invoice-view-status,
.invoice-view-sync {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-transform: capitalize;
}

.invoice-view-status.is-paid,
.invoice-view-sync.is-synced {
    background: #dcfce7;
    color: #166534;
}

.invoice-view-status.is-overdue {
    background: #fee4e2;
    color: #b42318;
}

.invoice-view-status.is-draft,
.invoice-view-status.is-neutral {
    background: #eef2f6;
    color: #40566f;
}

.invoice-view-sync.is-pending {
    background: #fff4e5;
    color: #b45309;
}

.invoice-view-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 22px;
    border-bottom: 1px solid #e6edf5;
}

.invoice-view-primary-action,
.invoice-view-secondary-action,
.invoice-view-danger-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 4px;
    font-weight: 600;
}

.invoice-view-primary-action {
    background: #13b5ea;
    border-color: #13b5ea;
}

.invoice-view-primary-action:hover,
.invoice-view-primary-action:focus {
    background: #0f9fce;
    border-color: #0f9fce;
}

.invoice-view-danger-action {
    border-color: #fecaca;
    color: #b42318;
}

.invoice-view-danger-action:hover {
    background: #fee4e2;
    color: #b42318;
}

.invoice-view-client {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 0.8fr);
    gap: 22px;
    margin: 22px;
    padding: 18px;
    border: 1px solid #d7dee8;
    border-radius: 4px;
    background: #fbfcfe;
}

.invoice-view-client h2,
.invoice-view-section-title h2 {
    margin: 0 0 8px;
    color: #40566f;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.invoice-view-contact {
    display: grid;
    gap: 7px;
    margin-top: 12px;
    color: #40566f;
    font-size: 14px;
}

.invoice-view-contact div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.invoice-view-contact i {
    color: #13b5ea;
}

.invoice-view-client address {
    margin: 0;
    color: #40566f;
    font-size: 14px;
    line-height: 1.55;
    text-align: right;
}

.invoice-view-client address span {
    color: #6b7c93;
}

.invoice-view-items {
    padding: 0 22px 22px;
}

.invoice-view-table-wrap {
    overflow-x: auto;
}

.invoice-view-table {
    width: 100%;
    min-width: 860px;
    margin: 0;
    border-collapse: collapse;
    color: #172b4d;
    font-size: 14px;
}

.invoice-view-table th {
    padding: 12px 14px;
    border-bottom: 1px solid #dbe3ed;
    background: #f7f9fc;
    color: #5f738c;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.invoice-view-table td {
    padding: 14px;
    border-bottom: 1px solid #eef2f6;
    vertical-align: top;
}

.invoice-view-table tbody tr:hover {
    background: #f3fbfe;
}

.invoice-view-item-meta {
    margin-top: 4px;
    color: #6b7c93;
    font-size: 12px;
}

.invoice-view-item-meta span {
    margin-left: 8px;
}

.invoice-view-footer {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 22px;
    padding: 0 22px 22px;
}

.invoice-view-totals {
    width: min(100%, 360px);
    margin-left: auto;
}

.invoice-view-totals div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    color: #40566f;
    font-size: 14px;
}

.invoice-view-totals strong {
    color: #172b4d;
}

.invoice-view-grand-total {
    margin-top: 5px;
    padding-top: 14px !important;
    border-top: 1px solid #dbe3ed;
    font-size: 18px !important;
}

.invoice-view-grand-total strong {
    color: #0078a8;
    font-size: 24px;
}

@media (max-width: 760px) {
    .invoice-view-page {
        padding-inline: 12px;
    }

    .invoice-view-toolbar,
    .invoice-view-header,
    .invoice-view-actions,
    .invoice-view-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .invoice-view-status-block {
        align-items: flex-start;
    }

    .invoice-view-client {
        grid-template-columns: 1fr;
    }

    .invoice-view-client address {
        text-align: left;
    }

    .invoice-view-primary-action,
    .invoice-view-secondary-action,
    .invoice-view-danger-action {
        width: 100%;
    }
}

/* =========================================================
   STOCK
========================================================= */

.stock-page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 18px 34px;
}

.stock-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.stock-toolbar h1 {
    margin: 0;
    color: #172b4d;
    font-size: 28px;
    font-weight: 600;
}

.stock-panel {
    overflow: hidden;
    background: #fff;
    border: 1px solid #d7dee8;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(12, 31, 53, 0.08);
}

.stock-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-bottom: 1px solid #e6edf5;
    background: #fbfcfe;
}

.stock-search {
    position: relative;
    flex: 1 1 420px;
    max-width: 520px;
}

.stock-search i {
    position: absolute;
    top: 50%;
    left: 12px;
    z-index: 1;
    color: #7a8ca1;
    transform: translateY(-50%);
}

.stock-search .form-control {
    min-height: 40px;
    padding-left: 38px;
    border-color: #cfd8e3;
    border-radius: 4px;
    color: #172b4d;
}

.stock-search .form-control:focus {
    border-color: #13b5ea;
    box-shadow: 0 0 0 3px rgba(19, 181, 234, 0.15);
}

.stock-results-info {
    color: #5f738c;
    font-size: 13px;
    white-space: nowrap;
}

.stock-table-wrap {
    overflow-x: auto;
}

.stock-table {
    width: 100%;
    min-width: 850px;
    margin: 0;
    border-collapse: collapse;
    color: #172b4d;
    font-size: 14px;
}

.stock-table th {
    padding: 12px 18px;
    border-bottom: 1px solid #dbe3ed;
    background: #f7f9fc;
    color: #5f738c;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.stock-table td {
    padding: 15px 18px;
    border-bottom: 1px solid #eef2f6;
    vertical-align: middle;
}

.stock-table tbody tr {
    cursor: pointer;
    transition: background-color 0.16s ease;
}

.stock-table tbody tr:hover {
    background: #f3fbfe;
}

.stock-sortable {
    cursor: pointer;
    user-select: none;
}

.stock-sortable::after {
    display: inline-block;
    width: 11px;
    margin-left: 6px;
    color: #13b5ea;
    font-size: 10px;
}

.stock-sortable.sort-asc::after {
    content: "^";
}

.stock-sortable.sort-desc::after {
    content: "v";
}

.stock-item-cell {
    display: flex;
    align-items: center;
    gap: 11px;
}

.stock-avatar {
    display: inline-flex;
    flex: 0 0 34px;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #13b5ea;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}

.stock-item-info {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.stock-item-name {
    color: #172b4d;
    font-weight: 700;
}

.stock-item-sub {
    color: #6b7c93;
    font-size: 12px;
}

.stock-type {
    display: inline-flex;
    padding: 4px 9px;
    border-radius: 999px;
    background: #eef2f6;
    color: #40566f;
    font-size: 12px;
    font-weight: 700;
    text-transform: capitalize;
}

.stock-qty {
    display: inline-flex;
    min-width: 34px;
    align-items: center;
    justify-content: center;
    padding: 4px 9px;
    border-radius: 999px;
    background: #e7f7fd;
    color: #0078a8;
    font-size: 12px;
    font-weight: 700;
}

.stock-qty.is-low {
    background: #fff4e5;
    color: #b45309;
}

.stock-qty.is-empty {
    background: #fee4e2;
    color: #b42318;
}

.stock-state {
    padding: 34px 18px !important;
    color: #6b7c93;
    text-align: center;
}

.stock-state-danger {
    color: #b42318;
}

.stock-footer {
    display: flex;
    justify-content: flex-end;
    min-height: 58px;
    padding: 12px 18px;
    border-top: 1px solid #e6edf5;
    background: #fbfcfe;
}

.stock-pagination {
    display: flex;
    align-items: center;
    gap: 6px;
}

.stock-page-btn {
    min-width: 34px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid #cfd8e3;
    border-radius: 4px;
    background: #fff;
    color: #172b4d;
    font-size: 13px;
    font-weight: 600;
}

.stock-page-btn:hover:not(:disabled),
.stock-page-btn.is-active {
    border-color: #13b5ea;
    background: #13b5ea;
    color: #fff;
}

.stock-page-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

@media (max-width: 720px) {
    .stock-page {
        padding-inline: 12px;
    }

    .stock-toolbar,
    .stock-panel-header {
        align-items: stretch;
        flex-direction: column;
    }

    .stock-search {
        width: 100%;
        max-width: none;
    }

    .stock-results-info {
        white-space: normal;
    }
}

/* =========================================================
   QUOTES
========================================================= */

.quotes-page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 18px 34px;
}

.quotes-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.quotes-toolbar h1 {
    margin: 0;
    color: #172b4d;
    font-size: 28px;
    font-weight: 600;
}

.quotes-primary-action {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #13b5ea;
    border-color: #13b5ea;
    border-radius: 4px;
    font-weight: 600;
}

.quotes-primary-action:hover,
.quotes-primary-action:focus {
    background: #0f9fce;
    border-color: #0f9fce;
}

.quotes-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quotes-secondary-action {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border-color: #d7dee8;
    color: #40566f;
    font-weight: 700;
}

.quotes-panel {
    overflow: hidden;
    background: #fff;
    border: 1px solid #d7dee8;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(12, 31, 53, 0.08);
}

.quotes-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-bottom: 1px solid #e6edf5;
    background: #fbfcfe;
}

.quotes-search {
    position: relative;
    flex: 1 1 420px;
    max-width: 520px;
}

.quotes-search i {
    position: absolute;
    top: 50%;
    left: 12px;
    z-index: 1;
    color: #7a8ca1;
    transform: translateY(-50%);
}

.quotes-search .form-control {
    min-height: 40px;
    padding-left: 38px;
    border-color: #cfd8e3;
    border-radius: 4px;
    color: #172b4d;
}

.quotes-search .form-control:focus {
    border-color: #13b5ea;
    box-shadow: 0 0 0 3px rgba(19, 181, 234, 0.15);
}

.quotes-results-info {
    color: #5f738c;
    font-size: 13px;
    white-space: nowrap;
}

.quotes-table-wrap {
    overflow-x: auto;
}

.quotes-table {
    width: 100%;
    min-width: 920px;
    margin: 0;
    border-collapse: collapse;
    color: #172b4d;
    font-size: 14px;
}

.quotes-table th {
    padding: 12px 18px;
    border-bottom: 1px solid #dbe3ed;
    background: #f7f9fc;
    color: #5f738c;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.quotes-table td {
    padding: 15px 18px;
    border-bottom: 1px solid #eef2f6;
    vertical-align: middle;
}

.quotes-table tbody tr {
    cursor: pointer;
    transition: background-color 0.16s ease;
}

.quotes-table tbody tr:hover {
    background: #f3fbfe;
}

.quotes-sortable {
    cursor: pointer;
    user-select: none;
}

.quotes-sortable::after {
    display: inline-block;
    width: 11px;
    margin-left: 6px;
    color: #13b5ea;
    font-size: 10px;
}

.quotes-sortable.sort-asc::after {
    content: "^";
}

.quotes-sortable.sort-desc::after {
    content: "v";
}

.quote-number {
    color: #0078a8;
    font-weight: 700;
}

.quote-status {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 999px;
    background: #eef2f6;
    color: #40566f;
    font-size: 12px;
    font-weight: 700;
    text-transform: capitalize;
}

.quote-status-accepted {
    background: #dcfce7;
    color: #166534;
}

.quote-status-rejected,
.quote-status-declined {
    background: #fee4e2;
    color: #b42318;
}

.quote-status-sent {
    background: #e7f7fd;
    color: #0078a8;
}

.quote-status-viewed {
    background: #fff4e5;
    color: #b45309;
}

.quote-status-draft {
    background: #eef2f6;
    color: #40566f;
}

.quote-actions {
    white-space: nowrap;
}

.quote-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-left: 4px;
    border: 1px solid #cfd8e3;
    border-radius: 4px;
    background: #fff;
    color: #40566f;
    text-decoration: none;
}

.quote-icon-btn:hover {
    border-color: #13b5ea;
    background: #e7f7fd;
    color: #0078a8;
}

.quotes-state {
    padding: 34px 18px !important;
    color: #6b7c93;
    text-align: center;
}

.quotes-state-danger {
    color: #b42318;
}

.quotes-footer {
    display: flex;
    justify-content: flex-end;
    min-height: 58px;
    padding: 12px 18px;
    border-top: 1px solid #e6edf5;
    background: #fbfcfe;
}

.quotes-pagination {
    display: flex;
    align-items: center;
    gap: 6px;
}

.quotes-page-btn {
    min-width: 34px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid #cfd8e3;
    border-radius: 4px;
    background: #fff;
    color: #172b4d;
    font-size: 13px;
    font-weight: 600;
}

.quotes-page-btn:hover:not(:disabled),
.quotes-page-btn.is-active {
    border-color: #13b5ea;
    background: #13b5ea;
    color: #fff;
}

.quotes-page-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

@media (max-width: 720px) {
    .quotes-page {
        padding-inline: 12px;
    }

    .quotes-toolbar,
    .quotes-panel-header {
        align-items: stretch;
        flex-direction: column;
    }

    .quotes-primary-action,
    .quotes-search {
        width: 100%;
        max-width: none;
    }

    .quotes-results-info {
        white-space: normal;
    }
}

/* =========================================================
   PROCESS TIMESHEET
========================================================= */

.process-page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 18px 34px;
}

.process-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.process-toolbar h1 {
    margin: 0;
    color: #172b4d;
    font-size: 28px;
    font-weight: 600;
}

.process-date-form {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.process-date-form .form-control {
    min-width: 180px;
    min-height: 38px;
    border-color: #cfd8e3;
    border-radius: 4px;
}

.process-primary-action,
.process-secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 4px;
    font-weight: 600;
}

.process-primary-action {
    background: #13b5ea;
    border-color: #13b5ea;
}

.process-primary-action:hover,
.process-primary-action:focus {
    background: #0f9fce;
    border-color: #0f9fce;
}

.process-primary-action.is-editing {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #172b4d;
}

.process-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.process-summary-card {
    padding: 18px;
    border: 1px solid #d7dee8;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(12, 31, 53, 0.08);
}

.process-summary-card span {
    display: block;
    margin-bottom: 5px;
    color: #5f738c;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.process-summary-card strong {
    display: block;
    color: #0078a8;
    font-size: 28px;
    line-height: 1.15;
}

.process-panel {
    overflow: visible;
    margin-bottom: 18px;
    background: #fff;
    border: 1px solid #d7dee8;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(12, 31, 53, 0.08);
}

.process-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-bottom: 1px solid #e6edf5;
    background: #fbfcfe;
}

.process-panel-header h2 {
    margin: 0;
    color: #172b4d;
    font-size: 16px;
    font-weight: 700;
}

.process-panel-body {
    padding: 18px;
}

.process-entry-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.process-client-search,
.process-ticket-field,
.process-note-field,
.process-switch,
.process-form-actions {
    grid-column: 1 / -1;
}

.process-field {
    position: relative;
}

.process-field .form-label {
    color: #40566f;
    font-size: 13px;
    font-weight: 700;
}

.process-field .form-control,
.process-field .form-select {
    min-height: 40px;
    border-color: #cfd8e3;
    border-radius: 4px;
    color: #172b4d;
}

.process-field .form-control:focus,
.process-field .form-select:focus,
.process-date-form .form-control:focus {
    border-color: #13b5ea;
    box-shadow: 0 0 0 3px rgba(19, 181, 234, 0.15);
}

.process-input-icon {
    position: relative;
}

.process-input-icon i {
    position: absolute;
    top: 50%;
    left: 12px;
    z-index: 1;
    color: #7a8ca1;
    transform: translateY(-50%);
}

.process-input-icon .form-control {
    padding-left: 38px;
}

.process-client-results {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    display: block;
    max-height: 260px;
    overflow-y: auto;
    z-index: 20;
    padding: 6px;
    border: 1px solid #cfd8e3;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 14px 30px rgba(12, 31, 53, 0.14);
}

.client-results.process-client-results {
    display: block;
}

.process-client-results:empty {
    display: none;
}

.process-client-results .client-result {
    padding: 9px 10px;
    border-radius: 4px;
    cursor: pointer;
}

.process-client-results .client-result:hover {
    background: #e7f7fd;
}

.process-result-title {
    color: #172b4d;
    font-weight: 700;
}

.process-result-sub {
    color: #6b7c93;
    font-size: 12px;
}

.process-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 10px 12px;
    border: 1px solid #e6edf5;
    border-radius: 4px;
    background: #fbfcfe;
}

.process-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.process-table-wrap {
    max-height: 460px;
    overflow: auto;
}

.process-table {
    width: 100%;
    min-width: 980px;
    margin: 0;
    border-collapse: collapse;
    color: #172b4d;
    font-size: 14px;
}

.process-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 12px 14px;
    border-bottom: 1px solid #dbe3ed;
    background: #f7f9fc;
    color: #5f738c;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.process-table td {
    padding: 13px 14px;
    border-bottom: 1px solid #eef2f6;
    vertical-align: middle;
}

.process-table tbody tr {
    cursor: pointer;
    transition: background-color 0.16s ease;
}

.process-table tbody tr:hover {
    background: #f3fbfe;
}

.process-table tfoot th {
    border-top: 1px solid #dbe3ed;
    background: #fbfcfe;
}

.process-options-col {
    width: 120px;
}

.row-invoiced {
    box-shadow: inset 4px 0 0 #13b5ea;
}

.row-not-invoiced {
    box-shadow: inset 4px 0 0 #94a3b8;
}

.row-closed-nonbillable {
    box-shadow: inset 4px 0 0 #16a34a;
}

.process-row-action {
    width: 100%;
    min-height: 30px;
    border: 1px solid;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
}

.process-row-action.is-delete {
    border-color: #fecaca;
    background: #fff;
    color: #b42318;
}

.process-row-action.is-delete:hover {
    background: #fee4e2;
}

.process-row-action.is-locked {
    border-color: #cfd8e3;
    background: #eef2f6;
    color: #5f738c;
}

@media (max-width: 760px) {
    .process-page {
        padding-inline: 12px;
    }

    .process-toolbar,
    .process-date-form,
    .process-form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .process-summary-grid,
    .process-entry-grid {
        grid-template-columns: 1fr;
    }

    .process-primary-action,
    .process-secondary-action,
    .process-date-form .form-control {
        width: 100%;
    }
}

/* =========================================================
   TICKET FORM
========================================================= */

.ticket-manage-page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 18px 34px;
}

.ticket-manage-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.ticket-manage-toolbar h1 {
    margin: 0;
    color: #172b4d;
    font-size: 28px;
    font-weight: 600;
}

.ticket-secondary-action,
.ticket-save-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 4px;
    font-weight: 600;
}

.ticket-save-action {
    min-width: 132px;
    background: #13b5ea;
    border-color: #13b5ea;
}

.ticket-save-action:hover,
.ticket-save-action:focus {
    background: #0f9fce;
    border-color: #0f9fce;
}

.ticket-notice {
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid;
    border-radius: 4px;
    font-size: 14px;
}

.ticket-notice-danger {
    border-color: #fecaca;
    background: #fff5f5;
    color: #b42318;
}

.ticket-manage-panel {
    overflow: visible;
    margin-bottom: 18px;
    background: #fff;
    border: 1px solid #d7dee8;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(12, 31, 53, 0.08);
}

.ticket-subpanel {
    margin: 18px 0 0;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    box-shadow: none;
}

.ticket-subpanel .ticket-manage-panel-header {
    padding-right: 0;
    padding-left: 0;
    background: #fff;
}

.ticket-subpanel .ticket-field-grid {
    padding-right: 0;
    padding-left: 0;
}

.ticket-manage-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-bottom: 1px solid #e6edf5;
    background: #fbfcfe;
}

.ticket-manage-panel-header h2 {
    margin: 0;
    color: #172b4d;
    font-size: 16px;
    font-weight: 700;
}

.ticket-reference {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 3px 9px;
    border-radius: 999px;
    background: #e7f7fd;
    color: #0078a8;
    font-size: 12px;
    font-weight: 700;
}

.ticket-manage-panel-body {
    padding: 18px;
}

.ticket-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
    gap: 18px;
}

.ticket-form-main {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.ticket-field {
    position: relative;
}

.ticket-field .form-label {
    color: #40566f;
    font-size: 13px;
    font-weight: 700;
}

.ticket-field .form-control,
.ticket-field .form-select {
    min-height: 40px;
    border-color: #cfd8e3;
    border-radius: 4px;
    color: #172b4d;
}

.ticket-field textarea.form-control {
    min-height: 240px;
    resize: vertical;
}

.ticket-field .form-control:focus,
.ticket-field .form-select:focus {
    border-color: #13b5ea;
    box-shadow: 0 0 0 3px rgba(19, 181, 234, 0.15);
}

.ticket-input-icon {
    position: relative;
}

.ticket-input-icon i {
    position: absolute;
    top: 50%;
    left: 12px;
    z-index: 1;
    color: #7a8ca1;
    transform: translateY(-50%);
}

.ticket-input-icon .form-control {
    padding-left: 38px;
}

.ticket-client-search {
    z-index: 4;
}

.ticket-search-results,
.client-results {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    display: none;
    max-height: 260px;
    overflow-y: auto;
    z-index: 20;
    padding: 6px;
    border: 1px solid #cfd8e3;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 14px 30px rgba(12, 31, 53, 0.14);
}

.ticket-search-results .search-result,
.client-results .search-result {
    padding: 9px 10px;
    border-radius: 4px;
    cursor: pointer;
}

.ticket-search-results .search-result:hover,
.client-results .search-result:hover {
    background: #e7f7fd;
}

.ticket-search-result-title {
    color: #172b4d;
    font-weight: 700;
}

.ticket-search-result-sub {
    color: #6b7c93;
    font-size: 12px;
}

.ticket-client-card {
    height: 100%;
    min-height: 330px;
    padding: 18px;
    border: 1px solid #d7dee8;
    border-radius: 4px;
    background: #fbfcfe;
}

.ticket-client-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e6edf5;
}

.ticket-client-avatar {
    display: inline-flex;
    flex: 0 0 42px;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #13b5ea;
    color: #fff;
    font-weight: 700;
}

.ticket-client-card-header h2 {
    margin: 0;
    color: #172b4d;
    font-size: 18px;
    font-weight: 700;
}

.ticket-client-card-header p {
    margin: 2px 0 0;
    color: #6b7c93;
    font-size: 13px;
}

.ticket-client-details {
    display: grid;
    gap: 8px;
    padding: 14px 0;
    color: #40566f;
    font-size: 14px;
}

.ticket-client-details div {
    display: flex;
    align-items: center;
    gap: 9px;
}

.ticket-client-details i {
    color: #13b5ea;
}

.ticket-client-section {
    padding-top: 14px;
    border-top: 1px solid #e6edf5;
}

.ticket-client-section h3 {
    margin: 0 0 8px;
    color: #40566f;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.ticket-client-address {
    color: #6b7c93;
    font-size: 13px;
}

.ticket-client-ticket-scroll {
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid #e6edf5;
    border-radius: 4px;
    background: #fff;
}

.ticket-client-ticket-scroll .list-group-item {
    border-color: #eef2f6;
    font-size: 13px;
}

.ticket-field-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    padding: 18px;
}

.ticket-actions-bar {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

@media (max-width: 900px) {
    .ticket-form-grid,
    .ticket-field-grid {
        grid-template-columns: 1fr;
    }

    .ticket-form-side {
        order: -1;
    }
}

@media (max-width: 720px) {
    .ticket-manage-page {
        padding-inline: 12px;
    }

    .ticket-manage-toolbar,
    .ticket-manage-panel-header,
    .ticket-actions-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .ticket-secondary-action,
    .ticket-save-action {
        width: 100%;
    }
}

/* =========================================================
   TICKETS INDEX
========================================================= */

.tickets-page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 18px 34px;
}

.tickets-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.tickets-toolbar h1 {
    margin: 0;
    color: #172b4d;
    font-size: 28px;
    font-weight: 600;
}

.tickets-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.tickets-primary-action,
.tickets-secondary-action {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border-radius: 4px;
    font-weight: 600;
}

.tickets-primary-action {
    background: #13b5ea;
    border-color: #13b5ea;
}

.tickets-primary-action:hover,
.tickets-primary-action:focus {
    background: #0f9fce;
    border-color: #0f9fce;
}

.tickets-panel {
    overflow: hidden;
    background: #fff;
    border: 1px solid #d7dee8;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(12, 31, 53, 0.08);
}

.tickets-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-bottom: 1px solid #e6edf5;
    background: #fbfcfe;
}

.tickets-search {
    position: relative;
    flex: 1 1 420px;
    max-width: 520px;
}

.tickets-search i {
    position: absolute;
    top: 50%;
    left: 12px;
    z-index: 1;
    color: #7a8ca1;
    transform: translateY(-50%);
}

.tickets-search .form-control {
    min-height: 40px;
    padding-left: 38px;
    border-color: #cfd8e3;
    border-radius: 4px;
    color: #172b4d;
}

.tickets-search .form-control:focus {
    border-color: #13b5ea;
    box-shadow: 0 0 0 3px rgba(19, 181, 234, 0.15);
}

.tickets-results-info {
    color: #5f738c;
    font-size: 13px;
    white-space: nowrap;
}

.ticket-filter-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 12px 18px;
    border-bottom: 1px solid #e6edf5;
    background: #fff;
}

.ticket-filter {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 6px 10px;
    border: 1px solid #cfd8e3;
    border-radius: 999px;
    background: #fff;
    color: #40566f;
    font-size: 13px;
    font-weight: 700;
}

.ticket-filter:hover,
.ticket-filter.is-active {
    border-color: #13b5ea;
    background: #e7f7fd;
    color: #0078a8;
}

.tickets-table-wrap {
    overflow-x: auto;
}

.tickets-index-table {
    width: 100%;
    min-width: 980px;
    margin: 0;
    border-collapse: collapse;
    color: #172b4d;
    font-size: 14px;
}

.tickets-index-table th {
    padding: 12px 18px;
    border-bottom: 1px solid #dbe3ed;
    background: #f7f9fc;
    color: #5f738c;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.tickets-index-table td {
    padding: 15px 18px;
    border-bottom: 1px solid #eef2f6;
    vertical-align: middle;
}

.tickets-index-table tbody tr {
    cursor: pointer;
    transition: background-color 0.16s ease;
}

.tickets-index-table tbody tr:hover {
    background: #f3fbfe;
}

.tickets-sortable {
    cursor: pointer;
    user-select: none;
}

.tickets-sortable::after {
    display: inline-block;
    width: 11px;
    margin-left: 6px;
    color: #13b5ea;
    font-size: 10px;
}

.tickets-sortable.sort-asc::after {
    content: "^";
}

.tickets-sortable.sort-desc::after {
    content: "v";
}

.ticket-main-cell {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.ticket-number {
    color: #0078a8;
    font-weight: 700;
}

.ticket-subject {
    color: #172b4d;
    font-weight: 700;
}

.ticket-meta-line {
    min-height: 16px;
    color: #6b7c93;
    font-size: 12px;
}

.ticket-owner {
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.ticket-owner-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e7f7fd;
    color: #0078a8;
    font-size: 12px;
    font-weight: 700;
}

.ticket-status-pill,
.ticket-priority {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-transform: capitalize;
}

.ticket-status-pill {
    background: #eef2f6;
    color: #40566f;
}

.ticket-status-open {
    background: #e7f7fd;
    color: #0078a8;
}

.ticket-status-in-progress {
    background: #fff4e5;
    color: #b45309;
}

.ticket-status-waiting-for-client,
.ticket-status-3rd-party-repairs {
    background: #fef9c3;
    color: #854d0e;
}

.ticket-status-closed,
.ticket-status-invoiced {
    background: #dcfce7;
    color: #166534;
}

.ticket-priority {
    background: #eef2f6;
    color: #40566f;
}

.ticket-priority-low {
    background: #e7f7fd;
    color: #0078a8;
}

.ticket-priority-normal,
.ticket-priority-medium {
    background: #eef2f6;
    color: #40566f;
}

.ticket-priority-high,
.ticket-priority-urgent {
    background: #fee4e2;
    color: #b42318;
}

.tickets-state {
    padding: 34px 18px !important;
    color: #6b7c93;
    text-align: center;
}

.tickets-state-danger {
    color: #b42318;
}

.tickets-footer {
    display: flex;
    justify-content: flex-end;
    min-height: 58px;
    padding: 12px 18px;
    border-top: 1px solid #e6edf5;
    background: #fbfcfe;
}

.tickets-pagination {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tickets-page-btn {
    min-width: 34px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid #cfd8e3;
    border-radius: 4px;
    background: #fff;
    color: #172b4d;
    font-size: 13px;
    font-weight: 600;
}

.tickets-page-btn:hover:not(:disabled),
.tickets-page-btn.is-active {
    border-color: #13b5ea;
    background: #13b5ea;
    color: #fff;
}

.tickets-page-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

@media (max-width: 760px) {
    .tickets-page {
        padding-inline: 12px;
    }

    .tickets-toolbar,
    .tickets-panel-header {
        align-items: stretch;
        flex-direction: column;
    }

    .tickets-actions,
    .tickets-primary-action,
    .tickets-secondary-action,
    .tickets-search {
        width: 100%;
        max-width: none;
    }

    .tickets-actions {
        justify-content: stretch;
    }

    .tickets-primary-action,
    .tickets-secondary-action {
        justify-content: center;
    }

    .tickets-results-info {
        white-space: normal;
    }
}

/* =========================================================
   QUOTE MANAGE
========================================================= */

.quote-manage-page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 18px 34px;
}

.quote-manage-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.quote-manage-toolbar h1 {
    margin: 0;
    color: #172b4d;
    font-size: 28px;
    font-weight: 600;
}

.quote-secondary-action,
.quote-save-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 4px;
    font-weight: 600;
}

.quote-save-action {
    min-width: 132px;
    background: #13b5ea;
    border-color: #13b5ea;
}

.quote-save-action:hover,
.quote-save-action:focus {
    background: #0f9fce;
    border-color: #0f9fce;
}

.quote-notice {
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid;
    border-radius: 4px;
    font-size: 14px;
}

.quote-notice-warning {
    border-color: #fedf89;
    background: #fffbeb;
    color: #92400e;
}

.quote-notice-info {
    border-color: #bae6fd;
    background: #f0f9ff;
    color: #075985;
}

.quote-manage-panel,
.quote-summary-panel {
    overflow: visible;
    margin-bottom: 18px;
    background: #fff;
    border: 1px solid #d7dee8;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(12, 31, 53, 0.08);
}

.quote-manage-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-bottom: 1px solid #e6edf5;
    background: #fbfcfe;
}

.quote-manage-panel-header h2 {
    margin: 0;
    color: #172b4d;
    font-size: 16px;
    font-weight: 700;
}

.quote-manage-panel-header p {
    margin: 3px 0 0;
    color: #6b7c93;
    font-size: 13px;
}

.quote-form-grid {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(180px, 260px);
    gap: 18px;
    padding: 18px;
}

.quote-field {
    position: relative;
}

.quote-field .form-label {
    color: #40566f;
    font-size: 13px;
    font-weight: 700;
}

.quote-input-icon {
    position: relative;
}

.quote-input-icon i {
    position: absolute;
    top: 50%;
    left: 12px;
    z-index: 1;
    color: #7a8ca1;
    transform: translateY(-50%);
}

.quote-input-icon .form-control {
    min-height: 40px;
    padding-left: 38px;
    border-color: #cfd8e3;
    border-radius: 4px;
    color: #172b4d;
}

.quote-input-icon .form-control:focus,
.quote-field > .form-control:focus,
.quote-line-input:focus {
    border-color: #13b5ea;
    box-shadow: 0 0 0 3px rgba(19, 181, 234, 0.15);
}

.quote-search-field {
    position: relative;
}

.quote-search-results {
    border-color: #cfd8e3;
    border-radius: 4px;
}

.quote-search-result-title {
    color: #172b4d;
    font-weight: 700;
}

.quote-search-result-sub {
    color: #6b7c93;
    font-size: 12px;
}

.quote-stock-search {
    padding: 18px 18px 0;
}

.quote-items-header {
    align-items: flex-start;
}

.quote-line-action {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border-radius: 4px;
    font-weight: 600;
}

.quote-items-table-wrap {
    overflow-x: auto;
    overflow-y: visible;
    padding: 18px;
}

.quote-items-table {
    width: 100%;
    min-width: 900px;
    margin: 0;
    border-collapse: collapse;
    color: #172b4d;
    font-size: 14px;
}

.quote-advanced-table {
    min-width: 1420px;
}

.quote-advanced-table th,
.quote-advanced-table td {
    white-space: nowrap;
}

.quote-advanced-table td:nth-child(2) {
    min-width: 260px;
}

.quote-advanced-code-cell {
    position: relative;
    min-width: 150px;
    z-index: 2;
}

.quote-advanced-stock-results {
    position: fixed;
    top: auto;
    left: auto;
    right: auto;
    width: 320px;
    margin-top: 0;
    z-index: 3000;
    max-height: 280px;
    overflow-y: auto;
}

.quote-advanced-totals {
    width: min(100%, 760px);
}

.quote-advanced-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quote-import-action {
    cursor: pointer;
}

.quote-import-notice {
    margin: 0 18px 18px;
    padding: 12px 14px;
    border: 1px solid #dbe3ed;
    border-radius: 4px;
    background: #f7f9fc;
    color: #40566f;
    font-size: 13px;
}

.quote-import-notice-success {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.quote-import-notice-danger {
    border-color: #fecaca;
    background: #fef2f2;
    color: #b42318;
}

.quote-import-notice pre {
    max-height: 180px;
    margin: 10px 0 0;
    overflow: auto;
    white-space: pre-wrap;
}

.quote-items-table th {
    padding: 12px 10px;
    border-bottom: 1px solid #dbe3ed;
    background: #f7f9fc;
    color: #5f738c;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.quote-items-table td {
    padding: 10px;
    border-bottom: 1px solid #eef2f6;
    vertical-align: middle;
}

.quote-line-input {
    min-height: 38px;
    border-color: #cfd8e3;
    border-radius: 4px;
    color: #172b4d;
}

.quote-remove-line {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid #fecaca;
    border-radius: 4px;
    background: #fff;
    color: #b42318;
}

.quote-remove-line:hover {
    background: #fee4e2;
}

.quote-summary-panel {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    padding: 18px;
}

.quote-totals {
    width: min(100%, 360px);
    margin-left: auto;
}

.quote-totals div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    color: #40566f;
    font-size: 14px;
}

.quote-totals strong {
    color: #172b4d;
}

.quote-grand-total {
    margin-top: 5px;
    padding-top: 14px !important;
    border-top: 1px solid #dbe3ed;
    font-size: 18px !important;
}

.quote-grand-total strong {
    color: #0078a8;
    font-size: 24px;
}

.quote-actions-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

@media (max-width: 760px) {
    .quote-manage-page {
        padding-inline: 12px;
    }

    .quote-manage-toolbar,
    .quote-manage-panel-header,
    .quote-summary-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .quote-secondary-action,
    .quotes-secondary-action,
    .quote-save-action,
    .quote-line-action {
        width: 100%;
    }

    .quote-form-grid {
        grid-template-columns: 1fr;
    }

    .quote-totals {
        width: 100%;
        margin-left: 0;
    }
}
/* =========================================================
   COMPONENTS - CLIENT TICKETS
========================================================= */
.ticket-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ticket-main .fw-semibold {
    font-size: 14px;
}

.ticket-main .small {
    font-size: 12px;
}
.ticket-scroll {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 6px;
}

.list-group-item a:hover {
    background-color: #f8f9fa;
    border-radius: 4px;
}

.badge {
    font-size: 0.75rem;
}

.ticket-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ticket-title {
    font-weight: 600;
}

.ticket-meta {
    font-size: 12px;
    color: #64748b;
}

.ticket-submeta {
    display: flex;
    gap: 6px;
    align-items: center;
}

.priority {
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 600;
}

.ticket-status {
    margin-top: 4px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 999px;
    line-height: 1.4;
    white-space: nowrap;
}

/* Open / New (blue tone) */
.status-open {
    background: #e8f1fd;
    color: #1d4ed8;
}

/* In Progress (orange tone) */
.status-in-progress {
    background: #fff4e5;
    color: #b45309;
}

/* Pending / Waiting (grey tone) */
.status-pending {
    background: #f1f5f9;
    color: #475569;
}

/* Closed / Done (green tone) */
.status-closed {
    background: #e6f7ee;
    color: #047857;
}

/* Cancelled (red tone) */
.status-cancelled {
    background: #fde8e8;
    color: #b91c1c;
}

.priority-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

/* High = soft red */
/* Match whatever your getPriorityClass returns */
.priority-high {
    background: #fde8e8;
    color: #b91c1c;
}

.priority-medium {
    background: #fff4e5;
    color: #b45309;
}

.priority-low {
    background: #e6f7ee;
    color: #047857;
}

/*this page only */
.tickets-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
}

.tickets-table tbody tr:hover {
    background: #f8fafc;
    cursor: pointer;
}

.tickets-table td {
    padding: 16px;
}
.tickets-table thead th {
    background: #f8fafc;
    font-weight: 600;
    color: #475569;
    border-bottom: 1px solid #e2e8f0;
}

/* =========================================================
   FORMS
========================================================= */

.form-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    padding: 30px;
}

.form-card h2 {
    margin: 0 0 8px;
    font-weight: 600;
}

.form-card p {
    color: #64748b;
    margin-bottom: 25px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-actions {
    margin-top: 25px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}


/* =========================================================
   ALERTS
========================================================= */

.alert-msg {
    display: none;
    margin-bottom: 20px;
    padding: 12px 16px;
    border-radius: 8px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
}


/* =========================================================
   TICKETS MODULE
========================================================= */

/* HEADER */
.tickets-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.tickets-header h2 {
    margin: 0;
    font-weight: 600;
}

.tickets-header input {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    width: 250px;
    font-size: 14px;
}

/* FILTERS */
.ticket-filters {
    margin-bottom: 15px;
}

.ticket-filters button {
    border: none;
    padding: 6px 12px;
    margin-right: 5px;
    background: #f1f5f9;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.ticket-filters button:hover {
    background: #e2e8f0;
}

.ticket-filters button.active {
    background: #2563eb;
    color: white;
}

/* TABLE */
.tickets-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    overflow: hidden;
}

.tickets-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.tickets-table thead {
    background: #f8fafc;
}

.tickets-table th {
    text-align: left;
    padding: 14px 16px;
    font-weight: 600;
    color: #475569;
    border-bottom: 1px solid #e2e8f0;
    cursor: pointer;
    position: relative;
}

.tickets-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
}

.tickets-table tbody tr:hover {
    background: #f8fafc;
    cursor: pointer;
}

.tickets-table td:first-child {
    font-weight: 600;
    color: #1e293b;
}

/* SORT ICONS */
.tickets-table th::after {
    content: "^";
    font-size: 10px;
    margin-left: 6px;
    color: #94a3b8;
}

.tickets-table th.sorted-asc::after {
    content: "^";
    color: #2563eb;
}

.tickets-table th.sorted-desc::after {
    content: "v";
    color: #2563eb;
}

/* STATUS */
.status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-open { background:#dcfce7; color:#166534; }
.status-closed { background:#e2e8f0; color:#334155; }
.status-waiting { background:#fef9c3; color:#854d0e; }
.status-progress { background:#dbeafe; color:#1e40af; }

/* PRIORITY */
.priority { font-weight: 600; }

.priority-low { color:#0ea5e9; }
.priority-normal { color:#6366f1; }
.priority-high { color:#ef4444; }
.priority-urgent { color:#b91c1c; }

/* SCROLL TABLE */
.tickets-table-container {
    max-height: calc(100vh - 300px);
    overflow-y: auto;
    overflow-x: auto;
}

.tickets-table thead th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    z-index: 2;
}


/* =========================================================
   XERO INTEGRATION
========================================================= */

.xero-page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 18px 34px;
}

.xero-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.xero-toolbar h1,
.xero-result-panel h1 {
    margin: 0 0 6px;
    color: #172b4d;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0;
}

.xero-toolbar p:last-child,
.xero-result-panel p {
    margin: 0;
    color: #5f7288;
}

.xero-status-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.xero-status-card,
.xero-panel,
.xero-result-panel {
    background: #ffffff;
    border: 1px solid #d7dee8;
    border-radius: 4px;
    box-shadow: 0 8px 20px rgba(23, 43, 77, 0.06);
}

.xero-status-card {
    padding: 16px;
}

.xero-status-card span {
    display: block;
    color: #6b7d90;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.xero-status-card strong {
    display: block;
    margin-top: 7px;
    color: #172b4d;
    font-size: 16px;
}

.xero-status-pill {
    display: inline-flex !important;
    align-items: center;
    width: fit-content;
    min-height: 26px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 13px !important;
}

.xero-status-pill.is-connected {
    background: #ecfdf3;
    color: #067647;
}

.xero-status-pill.is-disconnected {
    background: #fef3f2;
    color: #b42318;
}

.xero-panel {
    overflow: hidden;
}

.xero-panel-header {
    padding: 16px 18px;
    border-bottom: 1px solid #e6edf5;
    background: #fbfcfe;
}

.xero-panel-header h2 {
    margin: 0 0 4px;
    color: #172b4d;
    font-size: 17px;
    font-weight: 700;
}

.xero-panel-header p {
    margin: 0;
    color: #6b7d90;
    font-size: 13px;
}

.xero-action-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    padding: 18px;
}

.xero-action-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-height: 112px;
    padding: 16px;
    border: 1px solid #d7dee8;
    border-radius: 4px;
    background: #ffffff;
    color: #25364a;
    text-decoration: none;
}

.xero-action-card:hover,
.xero-action-card:focus {
    border-color: #13b5ea;
    background: #f5fbfe;
    color: #25364a;
}

.xero-action-card i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 4px;
    background: #eef9fd;
    color: #0078a8;
    font-size: 20px;
}

.xero-action-card strong,
.xero-action-card small {
    display: block;
}

.xero-action-card strong {
    margin-bottom: 5px;
    color: #172b4d;
    font-size: 15px;
}

.xero-action-card small {
    color: #6b7d90;
    line-height: 1.45;
}

.xero-primary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    padding: 9px 14px;
    border: 1px solid #0078a8;
    border-radius: 4px;
    background: #13b5ea;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
}

.xero-primary-action:hover,
.xero-primary-action:focus {
    background: #0078a8;
    color: #ffffff;
}

.xero-result-panel {
    max-width: 720px;
    margin: 40px auto 0;
    padding: 34px;
    text-align: center;
}

.xero-result-panel .page-kicker {
    margin-bottom: 8px;
}

.xero-result-panel .xero-primary-action {
    margin-top: 22px;
}

.xero-result-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    margin-bottom: 16px;
    border-radius: 50%;
    background: #eef9fd;
    color: #0078a8;
    font-size: 30px;
}

.xero-result-panel.is-success .xero-result-icon {
    background: #ecfdf3;
    color: #067647;
}

.xero-result-panel.is-warning .xero-result-icon {
    background: #fffbeb;
    color: #b54708;
}

.xero-result-panel.is-danger .xero-result-icon {
    background: #fef3f2;
    color: #b42318;
}

.xero-debug-output {
    max-height: 260px;
    margin: 18px 0 0;
    overflow: auto;
    padding: 12px;
    border-radius: 4px;
    background: #111827;
    color: #d1d5db;
    font-size: 12px;
    line-height: 1.45;
    text-align: left;
}


/* =========================================================
   BILLING
========================================================= */

.billing-page {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 18px 34px;
}

.billing-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.billing-toolbar h1 {
    margin: 0 0 6px;
    color: #172b4d;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0;
}

.billing-toolbar p:last-child {
    margin: 0;
    color: #5f7288;
}

.billing-toolbar-actions,
.billing-row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.billing-panel,
.billing-progress-panel,
.billing-summary-card,
.billing-notice {
    background: #ffffff;
    border: 1px solid #d7dee8;
    border-radius: 4px;
    box-shadow: 0 8px 20px rgba(23, 43, 77, 0.06);
}

.billing-panel,
.billing-progress-panel {
    overflow: hidden;
    margin-bottom: 18px;
}

.billing-panel-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-bottom: 1px solid #e6edf5;
    background: #fbfcfe;
}

.billing-panel-header h2 {
    margin: 0 0 4px;
    color: #172b4d;
    font-size: 17px;
    font-weight: 700;
}

.billing-panel-header p {
    margin: 0;
    color: #6b7d90;
    font-size: 13px;
}

.billing-run-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 14px;
    padding: 18px;
}

.billing-field {
    min-width: 220px;
}

.billing-field label {
    display: block;
    margin-bottom: 6px;
    color: #40566f;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.billing-field .form-control {
    min-height: 40px;
    border-color: #ccd6e2;
    border-radius: 4px;
}

.billing-field .form-control:focus {
    border-color: #13b5ea;
    box-shadow: 0 0 0 3px rgba(19, 181, 234, 0.14);
}

.billing-primary-action,
.billing-secondary-action,
.billing-danger-action,
.billing-row-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    padding: 8px 13px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.billing-primary-action {
    border: 1px solid #0078a8;
    background: #13b5ea;
    color: #ffffff;
}

.billing-primary-action:hover,
.billing-primary-action:focus {
    background: #0078a8;
    color: #ffffff;
}

.billing-secondary-action,
.billing-row-action {
    border: 1px solid #c8d3df;
    background: #ffffff;
    color: #0078a8;
}

.billing-secondary-action:hover,
.billing-secondary-action:focus,
.billing-row-action:hover,
.billing-row-action:focus {
    border-color: #13b5ea;
    background: #eef9fd;
    color: #005f85;
}

.billing-secondary-action:disabled {
    cursor: not-allowed;
    opacity: 0.72;
}

.billing-danger-action,
.billing-row-action-danger {
    border: 1px solid #d92d20;
    background: #ffffff;
    color: #b42318;
}

.billing-danger-action:hover,
.billing-danger-action:focus,
.billing-row-action-danger:hover,
.billing-row-action-danger:focus {
    background: #fef3f2;
    color: #912018;
}

.billing-progress-body {
    padding: 18px;
}

.billing-progress-track {
    height: 13px;
    margin-bottom: 14px;
    overflow: hidden;
    border-radius: 999px;
    background: #e6edf5;
}

.billing-progress-bar {
    width: 0;
    height: 100%;
    min-width: 0;
    background: #13b5ea;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    line-height: 13px;
    text-align: center;
    transition: width 0.2s ease;
}

.billing-run-log {
    height: 200px;
    margin: 0;
    overflow: auto;
    padding: 12px;
    border-radius: 4px;
    background: #111827;
    color: #86efac;
    font-size: 12px;
    line-height: 1.45;
}

.billing-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.billing-summary-card {
    padding: 16px;
}

.billing-summary-card span,
.billing-subtext {
    display: block;
    color: #6b7d90;
    font-size: 12px;
}

.billing-summary-card strong {
    display: block;
    margin-top: 5px;
    color: #172b4d;
    font-size: 18px;
}

.billing-table-wrap {
    overflow-x: auto;
}

.billing-table,
.billing-nested-table,
.billing-line-table {
    width: 100%;
    border-collapse: collapse;
}

.billing-table {
    min-width: 980px;
}

.billing-nested-table,
.billing-line-table {
    min-width: 760px;
    border: 1px solid #e6edf5;
    background: #ffffff;
}

.billing-table th,
.billing-nested-table th,
.billing-line-table th {
    padding: 11px 14px;
    border-bottom: 1px solid #d7dee8;
    background: #f7f9fb;
    color: #40566f;
    font-size: 12px;
    font-weight: 700;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.billing-table td,
.billing-nested-table td,
.billing-line-table td {
    padding: 13px 14px;
    border-bottom: 1px solid #edf1f5;
    color: #25364a;
    vertical-align: middle;
}

.billing-table tbody tr:hover,
.billing-nested-table tbody tr:hover,
.billing-line-table tbody tr:hover {
    background: #fbfcfe;
}

.billing-table tr:last-child td,
.billing-nested-table tr:last-child td,
.billing-line-table tr:last-child td {
    border-bottom: 0;
}

.billing-number {
    text-align: right !important;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.billing-actions-cell {
    text-align: right !important;
    white-space: nowrap;
}

.billing-detail-panel {
    padding: 14px;
    border: 1px solid #e6edf5;
    border-radius: 4px;
    background: #fbfcfe;
}

.billing-run-detail-row.is-hidden,
.billing-progress-panel.is-hidden {
    display: none;
}

.billing-status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 3px 9px;
    border-radius: 999px;
    background: #eef9fd;
    color: #0078a8;
    font-size: 12px;
    font-weight: 700;
}

.billing-empty {
    padding: 22px 18px;
    color: #6b7d90;
    text-align: center;
}

.billing-empty-compact {
    padding: 12px;
    border: 1px dashed #c8d3df;
    border-radius: 4px;
    background: #ffffff;
}

.billing-notice {
    margin-bottom: 18px;
    padding: 14px 16px;
    color: #40566f;
}

.billing-notice-warning {
    border-color: #f4c430;
    background: #fffbeb;
    color: #7a5b00;
}

.billing-notice-danger {
    border-color: #fecdca;
    background: #fef3f2;
    color: #b42318;
}


/* =========================================================
   PAGINATION
========================================================= */

.pagination {
    margin-top: 20px;
    text-align: center;
}

.pagination button {
    border: none;
    padding: 6px 12px;
    margin: 3px;
    background: #f1f5f9;
    border-radius: 6px;
    cursor: pointer;
}

.pagination button:hover {
    background: #e2e8f0;
}

.pagination button:disabled {
    background: #2563eb;
    color: white;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width:768px){

    .billing-page {
        padding: 0 12px 28px;
    }

    .billing-toolbar,
    .billing-toolbar-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .billing-toolbar h1 {
        font-size: 24px;
    }

    .billing-summary-grid {
        grid-template-columns: 1fr;
    }

    .billing-run-form,
    .billing-primary-action,
    .billing-secondary-action,
    .billing-danger-action {
        width: 100%;
    }

    .billing-field {
        width: 100%;
        min-width: 0;
    }

    .billing-row-actions {
        justify-content: flex-start;
    }

    .xero-page {
        padding: 0 12px 28px;
    }

    .xero-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .xero-toolbar h1,
    .xero-result-panel h1 {
        font-size: 24px;
    }

    .xero-status-grid,
    .xero-action-grid {
        grid-template-columns: 1fr;
    }

    .xero-primary-action {
        width: 100%;
    }

    .xero-result-panel {
        margin-top: 18px;
        padding: 24px 18px;
    }

    .tickets-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .tickets-header input {
        width: 100%;
    }

    .ticket-filters {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
    }

    .ticket-filters button {
        flex: 1 1 48%;
        font-size: 12px;
        padding: 8px;
    }

    .tickets-table thead {
        display: none;
    }

    .tickets-table,
    .tickets-table tbody,
    .tickets-table tr,
    .tickets-table td {
        display: block;
        width: 100%;
    }

    .tickets-table tr {
        background: white;
        border-radius: 10px;
        padding: 12px;
        margin-bottom: 10px;
        box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    }

    .tickets-table td {
        padding: 6px 0;
        border: none;
        display: flex;
        justify-content: space-between;
        font-size: 13px;
    }

    .tickets-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #64748b;
    }
}


/* =========================
   XERO LAYER (ADD ONLY)
========================= */

body {
    background: #f5f7fa;
    font-size: 14px;
    color: #1e293b;
}

.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.form-control {
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.form-control:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37,99,235,0.1);
}

.table thead th {
    background: #f8fafc;
    color: #64748b;
    font-size: 13px;
}

.table tbody tr:hover {
    background: #f9fbfd;
}

.btn {
    border-radius: 8px;
}
