:root {
    --branch-primary: #1769d2;
    --branch-primary-dark: #0f4fa8;
    --branch-primary-soft: #eaf3ff;
    --branch-navy: #102a43;
    --branch-text: #243b53;
    --branch-muted: #6b7c93;
    --branch-border: #e2e8f0;
    --branch-surface: #ffffff;
    --branch-background: #f4f7fb;
    --branch-success: #138a5b;
    --branch-warning: #d97706;
    --branch-danger: #c2414b;
    --branch-radius: 14px;
    --branch-shadow: 0 8px 24px rgba(16, 42, 67, .07);
}

html {
    background: var(--branch-background);
}

body,
button,
input,
select,
textarea {
    font-family: Tahoma, Arial, sans-serif;
}

body.main-body {
    color: var(--branch-text);
    background: var(--branch-background) !important;
    -webkit-font-smoothing: antialiased;
}

a,
button,
.btn,
.form-control,
.side-menu__item {
    transition: all .18s ease;
}

.main-content {
    min-height: calc(100vh - 110px);
    padding-bottom: 38px;
    background: var(--branch-background);
}

.main-content > .container-fluid {
    padding-right: 24px;
    padding-left: 24px;
}

/* Header */
.main-header.side-header {
    min-height: 66px;
    background: rgba(255, 255, 255, .97);
    border-bottom: 1px solid var(--branch-border);
    box-shadow: 0 3px 14px rgba(16, 42, 67, .045);
}

.main-header-center span {
    color: var(--branch-navy) !important;
    font-size: 15px;
}

.header-icon,
.header-icons,
.header-icon-svgs {
    color: #52667a !important;
}

.main-header .nav-link:hover .header-icon-svgs,
.main-header .open-toggle:hover .header-icon {
    color: var(--branch-primary) !important;
}

.branch-header-avatar {
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border: 1px solid #cfe2fb;
    border-radius: 13px;
    color: var(--branch-primary);
    background: var(--branch-primary-soft);
    font-size: 23px;
}

.main-profile-menu .dropdown-menu {
    overflow: hidden;
    border: 1px solid var(--branch-border);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(16, 42, 67, .14);
}

.main-profile-menu .main-header-profile {
    background: linear-gradient(135deg, var(--branch-primary-dark), var(--branch-primary)) !important;
}

.main-profile-menu .dropdown-item {
    padding: 12px 18px;
}

/* Sidebar */
.app-sidebar,
.main-sidebar-header {
    background: #fff !important;
    border-left: 1px solid var(--branch-border);
}

.main-sidebar-header {
    border-bottom: 1px solid var(--branch-border);
}

.desktop-logo span {
    color: var(--branch-navy) !important;
    font-size: 18px;
}

.desktop-logo .branch-brand-mark {
    display: inline-flex;
    width: 31px;
    height: 31px;
    margin-left: 8px;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    color: #fff;
    background: var(--branch-primary);
    font-size: 18px;
}

.desktop-logo .branch-brand-mark i {
    color: #fff;
}

.app-sidebar__user {
    margin: 16px 14px 8px;
    padding: 18px 12px !important;
    border: 1px solid #e5edf6;
    border-radius: 15px;
    background: #f8fbff;
}

.branch-avatar {
    width: 58px;
    height: 58px;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid #fff;
    border-radius: 18px;
    color: #fff;
    background: linear-gradient(135deg, var(--branch-primary-dark), #2d8be8);
    box-shadow: 0 8px 18px rgba(23, 105, 210, .2);
    font-size: 29px;
}

.user-info h4 {
    color: var(--branch-navy);
    font-size: 14px;
}

.user-info span {
    font-size: 12px;
}

.side-item.side-item-category {
    margin: 20px 19px 8px;
    padding: 0;
    color: #8a99aa !important;
    font-size: 11px;
    font-weight: 700;
}

.side-menu__item {
    min-height: 46px;
    margin: 4px 11px;
    padding: 10px 13px !important;
    border-radius: 11px;
    color: #496076 !important;
    font-weight: 700;
}

.side-menu__item .side-menu__icon {
    color: #708399 !important;
    font-size: 22px !important;
}

.side-menu__item:hover {
    color: var(--branch-primary) !important;
    background: #f1f6fc !important;
    transform: translateX(-2px);
}

.side-menu__item:hover .side-menu__icon {
    color: var(--branch-primary) !important;
}

.side-menu__item.active {
    color: #fff !important;
    background: linear-gradient(135deg, var(--branch-primary-dark), var(--branch-primary)) !important;
    box-shadow: 0 7px 17px rgba(23, 105, 210, .22);
}

.side-menu__item.active .side-menu__label,
.side-menu__item.active .side-menu__icon {
    color: #fff !important;
    fill: #fff !important;
}

.app-sidebar .slide .side-menu__item.active::before {
    display: none !important;
}

/* Page heading */
.breadcrumb-header {
    min-height: 92px;
    margin-bottom: 0;
    padding: 24px 0 18px;
    align-items: center;
}

.branch-page-title {
    color: var(--branch-navy);
    font-size: 24px;
    font-weight: 800;
    line-height: 1.45;
}

.breadcrumb-header .text-muted {
    color: var(--branch-muted) !important;
    font-size: 13px;
}

.branch-page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Cards */
.branch-card {
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, .9);
    border-radius: var(--branch-radius);
    background: var(--branch-surface);
    box-shadow: var(--branch-shadow);
}

.branch-card .card-header,
.branch-card .card-footer {
    background: #fff;
    border-color: #edf1f6;
}

.branch-card .card-header {
    min-height: 64px;
    padding: 17px 21px;
}

.branch-card .card-body {
    padding: 22px;
}

.branch-card .card-footer {
    padding: 15px 21px;
}

.branch-card .card-title {
    color: var(--branch-navy);
    font-size: 16px;
    font-weight: 800;
}

.branch-stat {
    position: relative;
    overflow: hidden;
    border: 0;
    border-radius: var(--branch-radius);
    color: #fff;
    box-shadow: 0 10px 22px rgba(16, 42, 67, .1);
}

.branch-stat::after {
    position: absolute;
    width: 120px;
    height: 120px;
    top: -54px;
    left: -38px;
    border: 18px solid rgba(255, 255, 255, .09);
    border-radius: 50%;
    content: "";
}

.branch-stat .card-body {
    position: relative;
    z-index: 1;
    min-height: 124px;
    padding: 22px;
}

.branch-stat.primary {
    background: linear-gradient(135deg, #1557b0, #2583e8) !important;
}

.branch-stat.warning {
    background: linear-gradient(135deg, #c96a06, #ee9b22) !important;
}

.branch-stat.success {
    background: linear-gradient(135deg, #087a4d, #1aad78) !important;
}

.branch-stat.dark {
    background: linear-gradient(135deg, #213e5b, #102a43) !important;
}

.branch-stat p {
    color: rgba(255, 255, 255, .84);
    font-weight: 700;
}

.branch-stat h2 {
    color: #fff !important;
    font-size: 28px;
    font-weight: 800;
}

.branch-stat small,
.branch-stat .stat-icon i {
    color: #fff !important;
}

.branch-stat .stat-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 15px;
    background: rgba(255, 255, 255, .14);
    font-size: 27px;
}

/* Tables */
.branch-table {
    color: var(--branch-text);
}

.branch-table thead th {
    padding: 14px 16px;
    border-top: 0 !important;
    border-bottom: 1px solid #dfe7f0 !important;
    color: #4c6176;
    background: #f7f9fc;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.branch-table tbody td {
    padding: 15px 16px;
    border-top-color: #edf1f5;
    vertical-align: middle !important;
}

.branch-table tbody tr:hover {
    background: #fafcff;
}

.branch-table td .btn-sm {
    min-width: 35px;
    min-height: 34px;
    margin: 2px;
    border-radius: 9px;
}

/* Forms */
.branch-form label {
    margin-bottom: 8px;
    color: #334e68;
    font-size: 13px;
    font-weight: 800;
}

.branch-form .form-control,
.branch-login-card .form-control {
    min-height: 47px;
    padding: 9px 13px;
    border: 1px solid #d7e1ec;
    border-radius: 10px;
    color: var(--branch-navy);
    background: #fff;
    box-shadow: none;
}

.branch-form textarea.form-control {
    min-height: 112px;
    resize: vertical;
}

.branch-form .form-control:hover,
.branch-login-card .form-control:hover {
    border-color: #adc7e5;
}

.branch-form .form-control:focus,
.branch-login-card .form-control:focus {
    border-color: #69a3e4;
    box-shadow: 0 0 0 3px rgba(23, 105, 210, .11);
}

.branch-form .form-control.is-invalid,
.branch-login-card .form-control.is-invalid {
    border-color: var(--branch-danger);
}

.branch-form .input-group-text {
    min-width: 50px;
    justify-content: center;
    border-color: #d7e1ec;
    color: #52667a;
    background: #f4f7fb;
    font-weight: 700;
}

.branch-form small.text-muted {
    display: block;
    margin-top: 6px;
}

.branch-service-row {
    border: 1px solid #e1e8f0 !important;
    border-radius: 12px !important;
    background: #fbfcfe;
}

.branch-service-row:hover {
    border-color: #c6d9ee !important;
    background: #fff;
}

/* Buttons and status */
.btn {
    border-radius: 9px;
    font-weight: 700;
}

.btn-primary {
    border-color: var(--branch-primary);
    background: var(--branch-primary);
}

.btn-primary:hover,
.btn-primary:focus {
    border-color: var(--branch-primary-dark);
    background: var(--branch-primary-dark);
    box-shadow: 0 5px 13px rgba(23, 105, 210, .2);
}

.btn-success {
    border-color: var(--branch-success);
    background: var(--branch-success);
}

.btn-light {
    border-color: #dbe4ed;
    color: #445b70;
    background: #f8fafc;
}

.btn-outline-primary {
    border-color: #8ab5e5;
    color: var(--branch-primary);
}

.branch-btn {
    min-height: 42px;
    padding: 9px 17px;
    border-radius: 10px;
}

.status-badge {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    justify-content: center;
    padding: 6px 11px;
    border: 1px solid transparent;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.status-pending_payment {
    border-color: #f2d79b;
    color: #9a5b06;
    background: #fff7e1;
}

.status-paid {
    border-color: #a9dfca;
    color: #0b6b45;
    background: #e9f8f1;
}

.status-cancelled {
    border-color: #edbdc1;
    color: #a92f39;
    background: #fff0f1;
}

/* Messages and summaries */
.alert {
    border: 1px solid transparent;
    border-radius: 11px;
}

.alert-success {
    border-color: #b7e4d1;
    color: #0b6844;
    background: #eaf8f2;
}

.alert-info {
    border-color: #bdd9f6;
    color: #17588f;
    background: #edf6ff;
}

.alert-danger {
    border-color: #efc3c7;
    color: #9c3039;
    background: #fff1f2;
}

.branch-due-summary {
    padding: 19px !important;
    border: 1px solid #bdd9f6;
    border-radius: 12px;
    color: #174d7a;
    background: #eef7ff;
}

.branch-change-box {
    border: 1px dashed #b8c7d8;
    border-radius: 12px !important;
    background: #f8fafc !important;
}

.money-value {
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
    direction: rtl;
    white-space: nowrap;
}

.money-value bdi {
    direction: ltr;
    unicode-bidi: isolate;
}

.daily-session-banner {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 15px 18px;
    border: 1px solid var(--branch-border);
    border-right-width: 4px;
    border-radius: var(--branch-radius);
    background: #fff;
    box-shadow: var(--branch-shadow);
}

.daily-session-banner.is-open {
    border-right-color: var(--branch-success);
}

.daily-session-banner.is-closed {
    border-right-color: var(--branch-warning);
}

.daily-session-banner__info,
.daily-session-banner__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.daily-session-banner__info strong,
.daily-session-banner__info small {
    display: block;
}

.daily-session-banner__info strong {
    margin-bottom: 3px;
    color: var(--branch-navy);
    font-size: 14px;
}

.daily-session-banner__info small,
.daily-session-banner__actions small {
    color: var(--branch-muted);
}

.daily-session-banner__actions .money-value {
    color: var(--branch-navy);
    font-size: 17px;
    font-weight: 800;
}

.daily-session-dot {
    width: 12px;
    height: 12px;
    flex: 0 0 12px;
    border-radius: 50%;
    background: var(--branch-warning);
    box-shadow: 0 0 0 5px rgba(217, 119, 6, .12);
}

.is-open .daily-session-dot {
    background: var(--branch-success);
    box-shadow: 0 0 0 5px rgba(19, 138, 91, .12);
}

.branch-mini-stat {
    height: calc(100% - 16px);
    margin-bottom: 16px;
    padding: 16px;
    border: 1px solid #e3eaf2;
    border-radius: 12px;
    background: #fbfcfe;
}

.branch-mini-stat span {
    display: block;
    margin-bottom: 6px;
    color: var(--branch-muted);
    font-size: 12px;
}

.branch-mini-stat strong {
    color: var(--branch-navy);
    font-size: 19px;
    font-weight: 800;
}

.daily-status-badge {
    display: inline-flex;
    min-width: 65px;
    min-height: 29px;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
}

.daily-status-open {
    color: #0b6b45;
    background: #e9f8f1;
}

.daily-status-closed {
    color: #526174;
    background: #edf1f5;
}

.daily-close-panel {
    border: 1px solid #dbe5ef;
    border-radius: 12px;
    background: #f8fafc;
}

.cash-movement-type {
    display: inline-flex;
    min-width: 78px;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
}

.cash-movement-expense,
.cash-movement-withdrawal {
    color: #9f241b;
    background: #fff0ee;
}

.cash-movement-deposit {
    color: #0b6b45;
    background: #e9f8f1;
}

.cash-movement-cancelled {
    opacity: .68;
    background: #f8fafc;
}

.cash-movement-cancelled td {
    text-decoration-color: #8a99aa;
}

.cash-movement-cancel-form {
    min-width: 185px;
    display: flex;
    gap: 5px;
    align-items: center;
}

.cashout-settlement {
    display: inline-flex;
    min-width: 84px;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
}

.cashout-settlement-pending {
    color: #98620b;
    background: #fff6dc;
}

.cashout-settlement-settled {
    color: #0b6b45;
    background: #e9f8f1;
}

.cashout-settlement-difference {
    color: #9f241b;
    background: #fff0ee;
}

.cashout-action-row td {
    padding: 16px !important;
    border-top: 0 !important;
    background: #f8fafc;
}

.cashout-calculator .branch-mini-stat {
    border-style: dashed;
    background: #f5f9ff;
}

.empty-branch {
    padding: 46px 20px;
    color: var(--branch-muted);
    text-align: center;
}

.empty-branch i {
    display: block;
    margin-bottom: 10px;
    color: #a5b4c4;
    font-size: 46px;
}

.pagination {
    justify-content: center;
    margin-bottom: 0;
}

.page-link {
    margin: 0 2px;
    border-color: #dfe7f0;
    color: var(--branch-primary);
}

.page-item.active .page-link {
    border-color: var(--branch-primary);
    background: var(--branch-primary);
}

.main-footer {
    min-height: 52px;
    border-top: 1px solid var(--branch-border);
    color: #718096;
    background: #fff;
}

@media (max-width: 991px) {
    .main-content > .container-fluid {
        padding-right: 17px;
        padding-left: 17px;
    }

    .breadcrumb-header {
        min-height: auto;
        padding-top: 20px;
    }

    .branch-page-title {
        font-size: 21px;
    }
}

@media (max-width: 767px) {
    .breadcrumb-header.justify-content-between {
        align-items: flex-start;
        flex-direction: column;
    }

    .branch-page-actions {
        width: 100%;
        margin-top: 13px;
    }

    .branch-page-actions .btn {
        flex: 1;
    }

    .daily-session-banner,
    .daily-session-banner__actions {
        align-items: stretch;
        flex-direction: column;
    }

    .daily-session-banner__actions .btn {
        width: 100%;
    }

    .branch-card .card-header,
    .branch-card .card-body,
    .branch-card .card-footer {
        padding-right: 15px;
        padding-left: 15px;
    }

    .branch-table {
        min-width: 760px;
        font-size: 12px;
    }

    .branch-table thead th,
    .branch-table tbody td {
        padding-right: 12px;
        padding-left: 12px;
    }

    .branch-form .form-group,
    .branch-form [class*="col-"] {
        margin-bottom: 14px;
    }
}

@media (max-width: 575px) {
    .main-content > .container-fluid {
        padding-right: 12px;
        padding-left: 12px;
    }

    .branch-page-title {
        font-size: 19px;
    }

    .branch-stat .card-body {
        min-height: 108px;
        padding: 18px;
    }

    .branch-stat h2 {
        font-size: 24px;
    }

    .branch-card .card-footer.text-left .btn,
    .branch-card .text-left > .btn {
        width: 100%;
        margin: 4px 0;
    }
}
