/* ictVoIP client theme — twenty-one inspired reskin over Huraga.
   Loaded after huraga.css in layout_default.html.twig; override-only.
   All colors use Bootstrap body vars so light/dark follow data-bs-theme. */

/* ---- Grid supplement ----
   huraga's vendor.css is purge-built; several column classes were dropped
   (col-lg-6, col-xl-*, etc.). Restore the standard Bootstrap grid widths
   for breakpoints the build omitted, so overrides can use normal markup. */
@media (min-width: 576px) {
    .col-sm-1 { flex: 0 0 auto; width: 8.33333333%; }
    .col-sm-5 { flex: 0 0 auto; width: 41.66666667%; }
    .col-sm-7 { flex: 0 0 auto; width: 58.33333333%; }
    .col-sm-11 { flex: 0 0 auto; width: 91.66666667%; }
}

@media (min-width: 768px) {
    .col-md-1 { flex: 0 0 auto; width: 8.33333333%; }
    .col-md-3 { flex: 0 0 auto; width: 25%; }
    .col-md-11 { flex: 0 0 auto; width: 91.66666667%; }
}

@media (min-width: 992px) {
    .col-lg-1 { flex: 0 0 auto; width: 8.33333333%; }
    .col-lg-2 { flex: 0 0 auto; width: 16.66666667%; }
    .col-lg-3 { flex: 0 0 auto; width: 25%; }
    .col-lg-4 { flex: 0 0 auto; width: 33.33333333%; }
    .col-lg-5 { flex: 0 0 auto; width: 41.66666667%; }
    .col-lg-6 { flex: 0 0 auto; width: 50%; }
    .col-lg-7 { flex: 0 0 auto; width: 58.33333333%; }
    .col-lg-8 { flex: 0 0 auto; width: 66.66666667%; }
    .col-lg-9 { flex: 0 0 auto; width: 75%; }
    .col-lg-10 { flex: 0 0 auto; width: 83.33333333%; }
    .col-lg-11 { flex: 0 0 auto; width: 91.66666667%; }
    .col-lg-12 { flex: 0 0 auto; width: 100%; }
    .col-lg-auto { flex: 0 0 auto; width: auto; }
}

@media (min-width: 1200px) {
    .col-xl-1 { flex: 0 0 auto; width: 8.33333333%; }
    .col-xl-2 { flex: 0 0 auto; width: 16.66666667%; }
    .col-xl-3 { flex: 0 0 auto; width: 25%; }
    .col-xl-4 { flex: 0 0 auto; width: 33.33333333%; }
    .col-xl-5 { flex: 0 0 auto; width: 41.66666667%; }
    .col-xl-6 { flex: 0 0 auto; width: 50%; }
    .col-xl-7 { flex: 0 0 auto; width: 58.33333333%; }
    .col-xl-8 { flex: 0 0 auto; width: 66.66666667%; }
    .col-xl-9 { flex: 0 0 auto; width: 75%; }
    .col-xl-10 { flex: 0 0 auto; width: 83.33333333%; }
    .col-xl-11 { flex: 0 0 auto; width: 91.66666667%; }
    .col-xl-12 { flex: 0 0 auto; width: 100%; }
    .col-xl-auto { flex: 0 0 auto; width: auto; }
}

/* Utility classes dropped by the same purge */
.position-absolute { position: absolute !important; }
.top-0 { top: 0 !important; }
.start-100 { left: 100% !important; }
.translate-middle { transform: translate(-50%, -50%) !important; }
.rounded-pill { border-radius: 50rem !important; }
.overflow-x-auto { overflow-x: auto !important; }
.py-0 { padding-top: 0 !important; padding-bottom: 0 !important; }
.ms-4 { margin-left: 1.5rem !important; }

.g-2 {
    --bs-gutter-x: .5rem;
    --bs-gutter-y: .5rem;
    margin-top: calc(-1 * var(--bs-gutter-y));
    margin-right: calc(-.5 * var(--bs-gutter-x));
    margin-left: calc(-.5 * var(--bs-gutter-x));
}

.g-2 > * {
    padding-right: calc(var(--bs-gutter-x) * .5);
    padding-left: calc(var(--bs-gutter-x) * .5);
    margin-top: var(--bs-gutter-y);
}

/* ---- Topbar (account status strip) ---- */
.iv-topbar {
    background: var(--bs-dark);
    color: rgba(255, 255, 255, .85);
    font-size: .8rem;
    padding: .4rem 0;
}

.iv-topbar-label {
    color: rgba(255, 255, 255, .5);
    text-transform: uppercase;
    letter-spacing: .05em;
    font-size: .7rem;
    margin-right: .4rem;
}

.iv-topbar-balance { color: #fff; }

.iv-topbar-link {
    color: rgba(255, 255, 255, .9);
    text-decoration: none;
}

.iv-topbar-link:hover { color: #fff; text-decoration: underline; }

.iv-topbar-signout { margin-left: .5rem; }

/* ---- Brand bar ---- */
.iv-brandbar {
    background: var(--bs-body-bg);
    padding: .85rem 0;
}

.iv-brandbar .navbar-brand img { height: 72px; width: auto; max-height: none; }

/* ---- Main navbar (twenty-one signature bar) ---- */
.iv-mainnav {
    background: var(--bs-tertiary-bg);
    border-top: 1px solid var(--bs-border-color);
    border-bottom: 2px solid var(--bs-border-color);
    padding: 0;
}

.iv-mainnav .navbar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: .45rem;
    padding: .85rem 1.15rem;
    border-right: 1px solid var(--bs-border-color-translucent);
    color: var(--bs-body-color);
    font-size: .9rem;
    font-weight: 500;
}

.iv-mainnav .navbar-nav .nav-item:first-child .nav-link {
    border-left: 1px solid var(--bs-border-color-translucent);
}

.iv-mainnav .navbar-nav .nav-link .icon {
    width: 1rem;
    height: 1rem;
    opacity: .7;
}

.iv-mainnav .navbar-nav .nav-link:hover {
    color: var(--bs-primary);
    background: rgba(var(--bs-primary-rgb), .07);
}

.iv-mainnav .navbar-nav .nav-link.active {
    color: var(--bs-primary);
    background: var(--bs-body-bg);
    box-shadow: inset 0 -3px 0 var(--bs-primary);
    font-weight: 600;
}

.iv-mainnav .navbar-nav .nav-link.active .icon { opacity: 1; }

/* collapsed (mobile) — links go full-width */
@media (max-width: 767.98px) {
    .iv-mainnav .navbar-nav .nav-link {
        border-right: 0;
        border-left: 0;
        border-bottom: 1px solid var(--bs-border-color-translucent);
        padding: .65rem .75rem;
    }
    .iv-mainnav .navbar-nav .nav-item:first-child .nav-link { border-left: 0; }
    .iv-mainnav .navbar-nav .nav-link.active {
        box-shadow: inset 3px 0 0 var(--bs-primary);
        background: rgba(var(--bs-primary-rgb), .08);
    }
}

/* ---- Breadcrumb strip ---- */
.iv-breadcrumb {
    background: var(--bs-tertiary-bg);
    border-bottom: 1px solid var(--bs-border-color);
    padding: .6rem 0;
    font-size: .85rem;
}

.iv-breadcrumb .breadcrumb { margin-bottom: 0; }

/* ---- Main body ---- */
#iv-main-body { padding: 1.5rem 0 2rem; }

/* ---- Cards — twenty-one panel look ---- */
.card {
    border: 1px solid var(--bs-border-color);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
}

[data-bs-theme="dark"] .card {
    border-color: rgba(98, 105, 118, .35);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}

.card-header {
    background: var(--bs-tertiary-bg);
    border-bottom: 1px solid var(--bs-border-color);
}

/* compact panel titles, twenty-one style — small medium-weight headers */
.card .card-header h1,
.card .card-header .h1,
.card .card-header h2,
.card .card-header .h2,
.card .card-header h3,
.card .card-header .h3,
.card .card-header .card-title {
    font-size: .92rem;
    font-weight: 600;
    line-height: 1.3;
}

.card .card-header .card-title .icon,
.card .card-header h1 .icon,
.card .card-header h3 .icon {
    width: 1rem;
    height: 1rem;
    opacity: .55;
    vertical-align: -2px;
}

/* ---- Sidebar cards (twenty-one left column) ---- */
.iv-sidebar-card .card-title { font-size: .95rem; }

#iv-sidebar .list-group-item {
    font-size: .85rem;
    padding: .55rem 1rem;
    display: flex;
    align-items: center;
}

#iv-sidebar .list-group-item .icon {
    width: 1rem;
    height: 1rem;
    opacity: .55;
}

#iv-sidebar .list-group-item:hover .icon { opacity: 1; }

/* ---- VoIP panel tile launcher ---- */
.iv-voip-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.iv-voip-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .8rem;
    min-height: 130px;
    padding: 1.15rem 1.35rem;
    text-align: center;
    color: var(--bs-body-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    border: 1px solid var(--bs-border-color);
    border-bottom-width: 3px;
    border-radius: var(--bs-border-radius);
    background: var(--bs-body-bg);
    transition: transform .12s ease, box-shadow .12s ease;
}

.iv-voip-tile .icon {
    width: 2.6rem;
    height: 2.6rem;
}

.iv-voip-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
    color: var(--bs-body-color);
}

.iv-tile-calls { border-bottom-color: #206bc4; }
.iv-tile-calls .icon { color: #206bc4; }

.iv-tile-recordings { border-bottom-color: #a55eea; }
.iv-tile-recordings .icon { color: #a55eea; }

.iv-tile-faxing { border-bottom-color: #d63939; }
.iv-tile-faxing .icon { color: #d63939; }

.iv-tile-voicemail { border-bottom-color: #0ca678; }
.iv-tile-voicemail .icon { color: #0ca678; }

/* ---- Dashboard stat tiles (twenty-one) ---- */
.iv-stat-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.iv-stat-tile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 130px;
    padding: 1.15rem 1.35rem;
    border: 1px solid var(--bs-border-color);
    border-bottom-width: 3px;
    border-radius: var(--bs-border-radius);
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    text-decoration: none;
    transition: transform .12s ease, box-shadow .12s ease;
}

.iv-stat-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .15);
    color: var(--bs-body-color);
}

.iv-stat-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.iv-stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.15;
    white-space: nowrap;
}

.iv-stat-label {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--bs-secondary);
    font-weight: 600;
}

.iv-stat-sub {
    font-size: .75rem;
    color: var(--bs-secondary);
}

.iv-stat-icon {
    width: 3.6rem;
    height: 3.6rem;
    flex-shrink: 0;
    opacity: .14;
}

.iv-stat-balance { border-bottom-color: #0ca678; }
.iv-stat-balance .iv-stat-value { color: #0ca678; }

.iv-stat-services { border-bottom-color: #a55eea; }
.iv-stat-services .iv-stat-value { color: #a55eea; }

.iv-stat-voip { border-bottom-color: #4299e1; }
.iv-stat-voip .iv-stat-value { color: #4299e1; }

.iv-stat-invoices { border-bottom-color: #206bc4; }
.iv-stat-invoices .iv-stat-value { color: #206bc4; }

.iv-stat-support { border-bottom-color: #fd7e14; }
.iv-stat-support .iv-stat-value { color: #fd7e14; }

/* Card top accents — twenty-one colored headers */
.iv-card-overdue { border-top: 2px solid var(--bs-danger); }
.iv-card-order { border-top: 2px solid #0ca678; }
.iv-card-products { border-top: 2px solid #fd7e14; }
.iv-card-tickets { border-top: 2px solid #206bc4; }
.iv-card-news { border-top: 2px solid #6c7a91; }

/* ---- Brandbar search + cart ---- */
.iv-ms-auto { margin-left: auto; }

.iv-brandsearch {
    flex: 0 1 420px;
    min-width: 0;
    margin-left: auto;
}

.iv-brandsearch .form-control {
    border-radius: 20px;
    font-size: .85rem;
    padding: .45rem 1rem;
}

.iv-cart-badge {
    font-size: .6rem;
    padding: .2em .45em;
}

/* ---- Dashboard welcome hero ---- */
.js-allowed-content .markdown h1,
.content-block .markdown h1:first-child { font-weight: 700; }

/* ---- VoIP CDR view (Prosper cdrs.tpl parity) ---- */
.iv-cdr-filter-label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}
.iv-cdr-filter-label .icon { color: #1f4a8a; }

.iv-cdr-results-head {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    padding: 12px 16px;
    border-bottom: 1px solid #e3e3e3;
}
.iv-cdr-results-head .icon { color: #1f4a8a; }

.iv-cdr-count {
    display: inline-block;
    background: #1f4a8a;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    border-radius: 10px;
    padding: 2px 10px;
    margin-left: 8px;
    vertical-align: middle;
}

.iv-cdr-table { font-size: 14px; }
.iv-cdr-table thead th {
    background: #f7f9fc;
    border-bottom: 2px solid #1f4a8a;
    color: #333;
}

.dispo-pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
}
.dispo-pill.dispo-answered { background: #dff0d8; color: #3c763d; }
.dispo-pill.dispo-noanswer { background: #ffe5d0; color: #d2691e; }
.dispo-pill.dispo-failed   { background: #f2dede; color: #a94442; }
.dispo-pill.dispo-busy     { background: #fcf8e3; color: #8a6d3b; }
.dispo-pill.dispo-other    { background: #e8e8e8; color: #555; }
