/* Apply styles to the Select2 container */
.select2-container--default .select2-selection--single {
    width: 100%;
    height: calc(2.25rem + 2px) !important;
    border-radius: 3px !important;
    box-shadow: none !important;
    border-color: #c8cdd8 !important;
}

.select2-selection__rendered {
    line-height: calc(2.25rem + 2px) !important;
}

*:focus {
    outline: none;
}

/* Disable focus styles only for keyboard navigation */
*:focus:not(:focus-visible) {
    outline: none;
}

.page-sidebar-menu ul li a:link {
    font-size: 14px !important;
}

.input,
.custom-file,
.custom-select,
.form-control {
    border-color: #c8cdd8 !important;
}

/* ---- Mobile layout: sidebar drawer + calendar report table ---- */
@media (max-width: 991px) {
    body.page-sidebar-fixed .page-content,
    body.page-sidebar-fixed.page-sidebar-collapsed .page-content {
        margin-left: 0 !important;
        width: 100% !important;
        float: none;
    }

    body .page-sidebar {
        width: 260px !important;
        left: -280px !important;
        z-index: 1050;
        transition: left 0.2s ease-in-out;
    }

    body.page-sidebar-visible .page-sidebar {
        left: 0 !important;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
    }

    /* Full-width drawer on mobile (not the 60px icon strip) */
    body.page-sidebar-collapsed .page-sidebar,
    body.page-sidebar-collapsed.page-sidebar-visible .page-sidebar {
        width: 260px !important;
    }

    body.page-sidebar-collapsed .page-sidebar .logo,
    body.page-sidebar-collapsed.page-sidebar-visible .page-sidebar .logo {
        width: 260px !important;
    }

    body.page-sidebar-collapsed.page-sidebar-visible .page-sidebar-menu ul li a span,
    body.page-sidebar-collapsed.page-sidebar-visible .page-sidebar-menu ul li a i.accordion-icon {
        display: inline !important;
    }

    body.page-sidebar-collapsed.page-sidebar-visible .page-sidebar-menu > ul > li > a {
        width: auto !important;
        padding: 7px 15px !important;
    }

    body.page-sidebar-collapsed.page-sidebar-visible .logo a.logo-img img.desktop-logo {
        display: block !important;
    }

    body.page-sidebar-collapsed.page-sidebar-visible .logo a.logo-img img.small-logo {
        display: none !important;
    }

    body.page-sidebar-visible .page-inner,
    body.page-sidebar-visible .page-header {
        pointer-events: none;
    }

    body.page-sidebar-visible .page-sidebar {
        pointer-events: auto;
    }
}

#exampleModal .modal-dialog {
    max-width: calc(100vw - 1rem);
    margin: 0.5rem auto;
}

#exampleModal .modal-body {
    overflow-x: hidden;
}

#exampleModal .calendar-report-results {
    overflow-x: hidden;
}

#exampleModal .calendar-report-table {
    width: 100%;
    margin-bottom: 0;
    table-layout: fixed;
}

#exampleModal .calendar-report-table th,
#exampleModal .calendar-report-table td {
    padding: 0.5rem 0.4rem;
    vertical-align: middle;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    font-size: 0.8125rem;
}

@media (max-width: 767px) {
    #exampleModal .calendar-report-table thead {
        display: none;
    }

    #exampleModal .calendar-report-table,
    #exampleModal .calendar-report-table tbody,
    #exampleModal .calendar-report-table tr,
    #exampleModal .calendar-report-table td {
        display: block;
        width: 100%;
    }

    #exampleModal .calendar-report-table tr {
        margin-bottom: 0.75rem;
        padding: 0.5rem 0.65rem;
        border: 1px solid #dee2e6;
        border-radius: 6px;
        background: #fff;
    }

    #exampleModal .calendar-report-table tr:last-child {
        margin-bottom: 0;
    }

    #exampleModal .calendar-report-table td {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 0.75rem;
        padding: 0.35rem 0;
        border: none;
        text-align: right;
    }

    #exampleModal .calendar-report-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #495057;
        text-align: left;
        flex: 0 0 42%;
        max-width: 42%;
    }
}

.hgr-subscription-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    border: 1px solid #f5c06a;
    background: linear-gradient(135deg, #fff9ee 0%, #fff3dc 100%);
    box-shadow: 0 2px 8px rgba(245, 166, 35, 0.12);
}

.hgr-subscription-banner.is-expired {
    border-color: #f1aeb5;
    background: linear-gradient(135deg, #fff5f5 0%, #ffe8ea 100%);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.1);
}

.hgr-subscription-banner__content {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    min-width: 0;
    flex: 1 1 auto;
}

.hgr-subscription-banner__icon {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #e67e22;
    font-size: 18px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.hgr-subscription-banner.is-expired .hgr-subscription-banner__icon {
    color: #dc3545;
}

.hgr-subscription-banner__text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    line-height: 1.35;
}

.hgr-subscription-banner__text strong {
    font-size: 15px;
    color: #2c3e50;
    font-weight: 600;
}

.hgr-subscription-banner__text span {
    font-size: 13px;
    color: #6c757d;
}

.hgr-subscription-banner__btn {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 0.5rem 1.25rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 6px rgba(0, 123, 255, 0.25);
}

.hgr-subscription-banner__btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.3);
}

@media (max-width: 575px) {
    .hgr-subscription-banner {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .hgr-subscription-banner__content {
        flex-direction: column;
    }

    .hgr-subscription-banner__btn {
        width: 100%;
    }
}

/* ---- Subscription & Storage page ---- */
.hgr-sub-page {
    --hgr-sub-accent: #007bff;
    --hgr-sub-accent-soft: #e8f2ff;
    --hgr-sub-success: #198754;
    --hgr-sub-warning: #e67e22;
    --hgr-sub-danger: #dc3545;
    --hgr-sub-muted: #6c757d;
    --hgr-sub-border: #e3e8ef;
    --hgr-sub-card-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
}

.hgr-sub-hero {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    padding: 1.75rem 1.875rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #0b3d78 0%, #007bff 55%, #4dabf7 100%);
    color: #fff;
    box-shadow: var(--hgr-sub-card-shadow);
}

.hgr-sub-hero::after {
    content: "";
    position: absolute;
    top: -40%;
    right: -8%;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

.hgr-sub-hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 600;
    opacity: 0.9;
    margin-bottom: 0.5rem;
    color: #fff;
}

.hgr-sub-hero__title {
    font-size: 1.65rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
    line-height: 1.2;
    color: #fff !important;
}

.hgr-sub-hero__subtitle {
    margin: 0;
    font-size: 0.95rem;
    opacity: 0.92;
    max-width: 640px;
    color: #fff;
}

.hgr-sub-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 1rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.22);
    font-size: 12px;
    font-weight: 600;
}

.hgr-sub-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.hgr-sub-stat {
    background: #fff;
    border: 1px solid var(--hgr-sub-border);
    border-radius: 12px;
    padding: 1rem 1.125rem;
    box-shadow: var(--hgr-sub-card-shadow);
}

.hgr-sub-stat__label {
    display: block;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--hgr-sub-muted);
    font-weight: 600;
    margin-bottom: 0.45rem;
}

.hgr-sub-stat__value {
    display: block;
    font-size: 1.35rem;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.2;
}

.hgr-sub-stat__meta {
    display: block;
    margin-top: 0.25rem;
    font-size: 12px;
    color: var(--hgr-sub-muted);
}

.hgr-sub-stat.is-warning .hgr-sub-stat__value {
    color: var(--hgr-sub-warning);
}

.hgr-sub-stat.is-danger .hgr-sub-stat__value {
    color: var(--hgr-sub-danger);
}

.hgr-sub-stat.is-success .hgr-sub-stat__value {
    color: var(--hgr-sub-success);
}

.hgr-sub-panel {
    background: #fff;
    border: 1px solid var(--hgr-sub-border);
    border-radius: 12px;
    box-shadow: var(--hgr-sub-card-shadow);
    margin-bottom: 1.5rem;
}

.hgr-sub-overview-row {
    align-items: stretch;
    margin-bottom: 1rem;
}

.hgr-sub-overview-row > [class*="col-"] {
    display: flex;
    flex-direction: column;
}

.hgr-sub-overview-row .hgr-sub-panel {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
    height: 100%;
}

.hgr-sub-overview-row .hgr-sub-panel__body {
    flex: 1 1 auto;
}

.hgr-sub-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--hgr-sub-border);
}

.hgr-sub-panel__title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
}

.hgr-sub-panel__body {
    padding: 1.25rem;
}

.hgr-sub-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.5rem;
}

.hgr-sub-detail-item__label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--hgr-sub-muted);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.hgr-sub-detail-item__value {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}

.hgr-sub-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.hgr-sub-status-pill.is-trial {
    background: #fff4e6;
    color: #d9480f;
}

.hgr-sub-status-pill.is-paid {
    background: #ebfbee;
    color: #2b8a3e;
}

.hgr-sub-status-pill.is-expired {
    background: #fff5f5;
    color: #c92a2a;
}

.hgr-sub-storage-block {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--hgr-sub-border);
}

.hgr-sub-storage-block__top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}

.hgr-sub-storage-block__top strong {
    font-size: 14px;
    color: #1f2937;
}

.hgr-sub-storage-block__top span {
    font-size: 13px;
    color: var(--hgr-sub-muted);
    font-weight: 600;
}

.hgr-sub-progress {
    height: 10px;
    border-radius: 999px;
    background: #edf2f7;
    overflow: hidden;
}

.hgr-sub-progress__bar {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #007bff 0%, #4dabf7 100%);
    transition: width 0.4s ease;
}

.hgr-sub-progress__bar.is-warning {
    background: linear-gradient(90deg, #f59f00 0%, #fab005 100%);
}

.hgr-sub-progress__bar.is-danger {
    background: linear-gradient(90deg, #e03131 0%, #ff6b6b 100%);
}

.hgr-sub-storage-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.85rem;
}

.hgr-sub-storage-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 12px;
    color: var(--hgr-sub-muted);
}

.hgr-sub-storage-legend__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #007bff;
}

.hgr-sub-storage-legend__dot.is-addon {
    background: #74c0fc;
}

.hgr-sub-section-title {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #1f2937;
}

.hgr-sub-section-desc {
    margin: 0 0 1.25rem;
    font-size: 13px;
    color: var(--hgr-sub-muted);
}

.hgr-sub-plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.hgr-sub-plan-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--hgr-sub-border);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--hgr-sub-card-shadow);
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.hgr-sub-plan-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.hgr-sub-plan-card.is-current {
    border-color: #007bff;
    box-shadow: 0 8px 28px rgba(0, 123, 255, 0.14);
}

.hgr-sub-plan-card__ribbon {
    position: absolute;
    top: 14px;
    right: -28px;
    transform: rotate(45deg);
    background: #007bff;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.25rem 2rem;
}

.hgr-sub-plan-card__body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    padding: 1.25rem;
}

.hgr-sub-plan-card__name {
    margin: 0 0 0.35rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: #1f2937;
}

.hgr-sub-plan-card__price {
    margin: 0 0 0.75rem;
    font-size: 1.75rem;
    font-weight: 800;
    color: #007bff;
    line-height: 1.1;
}

.hgr-sub-plan-card__price small {
    font-size: 13px;
    font-weight: 500;
    color: var(--hgr-sub-muted);
}

.hgr-sub-plan-card__desc {
    margin: 0 0 1rem;
    font-size: 13px;
    color: var(--hgr-sub-muted);
    min-height: 2.5rem;
}

.hgr-sub-plan-card__highlight {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.85rem;
    padding: 0.45rem 0.65rem;
    border-radius: 8px;
    background: var(--hgr-sub-accent-soft);
    color: #1864ab;
    font-size: 12px;
    font-weight: 700;
}

.hgr-sub-feature-list {
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0;
}

.hgr-sub-feature-list li {
    position: relative;
    padding-left: 1.35rem;
    margin-bottom: 0.45rem;
    font-size: 13px;
    color: #374151;
}

.hgr-sub-feature-list li::before {
    content: "\f00c";
    font-family: FontAwesome;
    position: absolute;
    left: 0;
    top: 0.1rem;
    color: #2b8a3e;
    font-size: 11px;
}

.hgr-sub-addon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.col-lg-4 .hgr-sub-addon-grid {
    grid-template-columns: 1fr;
}

.hgr-sub-addon-card {
    border: 1px dashed #c8cdd8;
    border-radius: 12px;
    padding: 1.125rem;
    background: #fafbfc;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.hgr-sub-addon-card__size {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.hgr-sub-addon-card__price {
    font-size: 1rem;
    font-weight: 700;
    color: #007bff;
    margin-bottom: 1rem;
}

.hgr-sub-history-table {
    width: 100%;
    margin: 0;
}

.hgr-sub-history-table th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--hgr-sub-muted);
    font-weight: 700;
    border-top: none;
}

.hgr-sub-history-table td {
    vertical-align: middle;
    font-size: 13px;
}

.hgr-sub-history-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: capitalize;
}

.hgr-sub-history-badge.is-paid {
    background: #ebfbee;
    color: #2b8a3e;
}

.hgr-sub-history-badge.is-pending {
    background: #fff9db;
    color: #e67700;
}

.hgr-sub-history-badge.is-failed {
    background: #fff5f5;
    color: #c92a2a;
}

.hgr-sub-info-list {
    margin: 0;
    padding-left: 1.1rem;
    color: var(--hgr-sub-muted);
    font-size: 13px;
}

.hgr-sub-info-list li {
    margin-bottom: 0.55rem;
}

.hgr-sub-empty {
    padding: 1.5rem;
    text-align: center;
    color: var(--hgr-sub-muted);
    font-size: 13px;
    border: 1px dashed var(--hgr-sub-border);
    border-radius: 10px;
    background: #fafbfc;
}

.hgr-sub-history-grid {
    padding: 1rem 1.25rem 1.25rem;
}

.hgr-sub-history-grid .mlist-card {
    margin-bottom: 0;
}

@media (max-width: 991px) {
    .hgr-sub-overview-row > [class*="col-"] + [class*="col-"] {
        margin-top: 1rem;
    }
}

@media (max-width: 991px) {
    .hgr-sub-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hgr-sub-detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575px) {
    .hgr-sub-hero {
        padding: 1.25rem;
    }

    .hgr-sub-hero__title {
        font-size: 1.35rem;
    }

    .hgr-sub-stat-grid {
        grid-template-columns: 1fr;
    }
}
