﻿/* plans.css - shared styles of the Plans & Packages, Census and usage pages (Iris SMS theme).
   Classes are prefixed "ip-" so they do not clash with the scoped CSS of the other pages. */

/* ***** Page ***** */
.ip-page {
    height: calc(100vh - 70px);
    display: flex;
    flex-direction: column;
}

.ip-page-scroll {
    min-height: calc(100vh - 70px);
}

.ip-status {
    display: flex;
    gap: 20px;
    align-items: center;
    white-space: nowrap;
}

    .ip-status strong {
        color: var(--bs-dark);
    }

.ip-table-container {
    flex: 1;
    overflow: auto;
    border: 1px solid #dee2e6;
    border-radius: .375rem;
}

    .ip-table-container table {
        margin-bottom: 0;
    }

    .ip-table-container thead th {
        position: sticky;
        top: 0;
        z-index: 2;
        background: var(--iris-navy);
        color: #fff;
        border-bottom: 2px solid var(--iris-orange);
        white-space: nowrap;
    }

    .ip-table-container tbody tr:hover {
        background: rgba(var(--iris-peach-rgb), 0.15);
    }

.ip-table-sm {
    border: 1px solid #dee2e6;
    border-radius: .375rem;
    overflow: auto;
}

    .ip-table-sm table {
        margin-bottom: 0;
        font-size: .875rem;
    }

    .ip-table-sm thead th {
        background: #f6f8fb;
        color: var(--iris-navy);
        font-weight: 600;
        white-space: nowrap;
    }

.ip-sortable {
    cursor: pointer;
}

.ip-sub-text {
    font-size: .8rem;
    color: var(--bs-secondary-color, #6c757d);
}

.ip-code {
    display: inline-block;
    margin-right: .35rem;
    padding: 0 .4rem;
    border-radius: .25rem;
    font-size: .75rem;
    font-weight: 700;
    color: var(--iris-navy);
    background: #eef1f6;
}

.ip-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* ***** Badges ***** */
.ip-badge {
    display: inline-block;
    min-width: 84px;
    padding: .2rem .75rem;
    border-radius: .3rem;
    color: #fff;
    text-align: center;
    line-height: 1.4;
    white-space: nowrap;
}

.ip-badge-active { background-color: #4CAF50; }
.ip-badge-inactive, .ip-badge-danger { background-color: #FF0000; }
.ip-badge-pending { background-color: #E69500; }
.ip-badge-muted { background-color: #8a96a3; }
.ip-badge-info { background-color: var(--iris-indigo); }

.ip-pill {
    display: inline-block;
    padding: .05rem .5rem;
    border-radius: 1rem;
    font-size: .72rem;
    font-weight: 600;
    white-space: nowrap;
    color: var(--iris-navy);
    background: #eef1f6;
}

.ip-pill-warn {
    color: #8a4b00;
    background: rgba(var(--iris-peach-rgb), .45);
}

.ip-pill-danger {
    color: #fff;
    background: #d9363e;
}

.ip-pill-ok {
    color: #1d6b21;
    background: #e3f4e4;
}

/* Row added / updated: highlighted for a few seconds */
.ip-row-saved > td {
    animation: ipRowSaved 3s ease-out;
}

@keyframes ipRowSaved {
    0%, 40% { background-color: rgba(var(--iris-peach-rgb), .55); }
    100% { background-color: transparent; }
}

/* ***** Drawer (same as the other Iris SMS drawers) ***** */
.ip-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.2);
    z-index: 1040;
}

.ip-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(560px, 100vw);
    height: 100vh;
    background: white;
    box-shadow: -3px 0 10px rgba(0,0,0,.25);
    display: flex;
    flex-direction: column;
    z-index: 1050;
    animation: ipSlideIn .25s;
}

.ip-drawer-wide {
    width: min(860px, 100vw);
}

.ip-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    border-bottom: 3px solid var(--iris-orange);
}

.ip-drawer-title {
    margin: 0;
}

.ip-drawer-body {
    flex: 1;
    overflow: auto;
    padding: 1.5rem;
}

.ip-drawer-footer {
    border-top: 1px solid #ddd;
    padding: 16px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

@keyframes ipSlideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.ip-section-title {
    margin: 1.5rem 0 .75rem;
    padding-bottom: .35rem;
    border-bottom: 1px solid #eef0f3;
    font-weight: 700;
    font-size: .78rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--iris-indigo);
}

    .ip-section-title:first-child {
        margin-top: 0;
    }

.ip-drawer .form-label,
.ip-card .form-label {
    font-weight: 600;
    font-size: .9rem;
    color: var(--iris-navy);
}

.ip-drawer .nav-tabs {
    margin-bottom: 1rem;
}

/* ***** Cards and meters ***** */
.ip-card {
    border: 1px solid #e3e7ee;
    border-radius: .5rem;
    background: #fff;
    padding: 1rem 1.25rem;
}

.ip-card-title {
    font-weight: 700;
    color: var(--iris-navy);
    margin-bottom: .5rem;
}

.ip-kv {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .25rem 1rem;
    font-size: .9rem;
}

    .ip-kv dt {
        font-weight: 600;
        color: var(--iris-slate);
    }

    .ip-kv dd {
        margin: 0;
    }

.ip-stat {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--iris-navy);
    line-height: 1.2;
}

.ip-stat-label {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--iris-slate);
}

.ip-meter {
    height: .6rem;
    border-radius: 1rem;
    background: #eef1f6;
    overflow: hidden;
}

    .ip-meter > div {
        height: 100%;
        background: var(--iris-navy);
        transition: width .3s;
    }

    .ip-meter.ip-meter-warn > div {
        background: var(--iris-orange);
    }

    .ip-meter.ip-meter-danger > div {
        background: #d9363e;
    }

.ip-split {
    display: flex;
    height: .8rem;
    border-radius: 1rem;
    overflow: hidden;
    background: #eef1f6;
}

    .ip-split > span {
        height: 100%;
    }

.ip-split-allowance { background: var(--iris-navy); }
.ip-split-addon { background: var(--iris-slate); }
.ip-split-prepaid { background: #4CAF50; }
.ip-split-excess { background: var(--iris-orange); }

.ip-legend {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .78rem;
    margin-right: .75rem;
}

    .ip-legend i {
        display: inline-block;
        width: .7rem;
        height: .7rem;
        border-radius: .15rem;
    }

.ip-empty {
    color: var(--bs-secondary-color, #6c757d);
    text-align: center;
    padding: 1.5rem 0;
}

.ip-form-check-orange .form-check-input:checked {
    background-color: var(--iris-orange);
    border-color: var(--iris-orange);
}
