/* ReportIT WSS Professional V4 — dashboard analytics and area reporting */
:root {
    --rit-v4-red: #b91c1c;
    --rit-v4-red-dark: #7f1d1d;
    --rit-v4-blue: #2563eb;
    --rit-v4-green: #16a34a;
    --rit-v4-amber: #f59e0b;
    --rit-v4-purple: #7e22ce;
    --rit-v4-ink: #0f172a;
    --rit-v4-muted: #64748b;
    --rit-v4-line: #e2e8f0;
    --rit-v4-surface: #ffffff;
    --rit-v4-soft: #f8fafc;
    --rit-v4-shadow: 0 14px 40px rgba(15, 23, 42, .08);
}

.rit-page-header-v4 {
    align-items: center;
}

.rit-page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.rit-page-actions .btn {
    border-radius: 11px;
    min-height: 42px;
    font-size: 12px;
    font-weight: 700;
    padding: 9px 15px;
}

.rit-dashboard-filter-card {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
    padding: 17px 18px;
    border: 1px solid var(--rit-v4-line);
    border-radius: 16px;
    background: linear-gradient(135deg, #fff, #f8fafc);
    box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
}

.rit-dashboard-filter-copy,
.rit-filter-heading > div,
.rit-filter-heading {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rit-dashboard-filter-copy strong,
.rit-dashboard-filter-copy span,
.rit-filter-heading strong,
.rit-filter-heading span {
    display: block;
}

.rit-dashboard-filter-copy strong,
.rit-filter-heading strong {
    color: var(--rit-v4-ink);
    font-size: 13px;
}

.rit-dashboard-filter-copy span,
.rit-filter-heading span {
    color: var(--rit-v4-muted);
    font-size: 11px;
    margin-top: 2px;
}

.rit-filter-icon {
    display: inline-flex;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, var(--rit-v4-red), var(--rit-v4-red-dark));
    box-shadow: 0 8px 18px rgba(185, 28, 28, .2);
}

.rit-dashboard-filter-form {
    display: grid;
    grid-template-columns: minmax(170px, 230px) minmax(170px, 220px) auto;
    align-items: end;
    gap: 10px;
}

.rit-dashboard-filter-form label {
    margin-bottom: 4px;
}

.rit-dashboard-filter-form .btn {
    min-height: 42px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
}

.rit-stat-grid-v4 .rit-stat-card {
    min-height: 152px;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.rit-stat-grid-v4 .rit-stat-card:hover {
    transform: translateY(-3px);
    border-color: currentColor;
    box-shadow: 0 16px 34px rgba(15, 23, 42, .11);
}

.rit-stat-foot {
    display: block;
    margin-top: 10px;
    color: var(--rit-v4-muted);
    font-size: 10px;
    font-weight: 500;
}

.rit-analytics-card {
    border: 1px solid var(--rit-v4-line);
    border-radius: 18px;
    background: var(--rit-v4-surface);
    box-shadow: var(--rit-v4-shadow);
    overflow: hidden;
}

.rit-analytics-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 21px 22px 17px;
    border-bottom: 1px solid var(--rit-v4-line);
}

.rit-analytics-header.compact {
    padding-bottom: 15px;
}

.rit-analytics-header h2 {
    margin: 3px 0 4px;
    color: var(--rit-v4-ink);
    font-size: 16px;
    font-weight: 800;
}

.rit-analytics-header p {
    margin: 0;
    color: var(--rit-v4-muted);
    font-size: 11px;
    line-height: 1.6;
}

.rit-card-kicker {
    color: var(--rit-v4-red);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.3px;
    text-transform: uppercase;
}

.rit-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: var(--rit-v4-muted);
    font-size: 10px;
    white-space: nowrap;
}

.rit-chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.rit-chart-legend i,
.rit-donut-legend i {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.rit-chart-legend .is-active { background: linear-gradient(135deg, #dc2626, #f97316); }
.rit-chart-legend .is-closed { background: linear-gradient(135deg, #16a34a, #22c55e); }

.rit-waroeng-chart {
    max-height: 630px;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 13px 20px 18px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.rit-waroeng-chart::-webkit-scrollbar { width: 7px; }
.rit-waroeng-chart::-webkit-scrollbar-thumb { border-radius: 99px; background: #cbd5e1; }

.rit-chart-row {
    display: grid;
    grid-template-columns: minmax(150px, 220px) minmax(230px, 1fr) 62px;
    align-items: center;
    gap: 14px;
    min-height: 69px;
    padding: 10px 3px;
    border-bottom: 1px solid #eef2f7;
    color: inherit;
}

.rit-chart-row:last-child { border-bottom: 0; }
.rit-chart-row:hover {
    color: inherit;
    text-decoration: none;
    background: linear-gradient(90deg, rgba(185,28,28,.035), transparent);
}

.rit-chart-row.is-zero { opacity: .55; }

.rit-chart-label strong,
.rit-chart-label span {
    display: block;
}

.rit-chart-label strong {
    overflow: hidden;
    color: var(--rit-v4-ink);
    font-size: 11px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rit-chart-label span {
    margin-top: 3px;
    color: var(--rit-v4-muted);
    font-size: 9px;
}

.rit-chart-track {
    height: 15px;
    overflow: hidden;
    border-radius: 99px;
    background: #eef2f7;
    box-shadow: inset 0 1px 2px rgba(15,23,42,.05);
}

.rit-chart-total {
    display: flex;
    height: 100%;
    min-width: 0;
    overflow: hidden;
    border-radius: inherit;
    animation: ritBarGrow .65s cubic-bezier(.2,.75,.3,1) both;
    transform-origin: left center;
}

.rit-chart-active {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #b91c1c, #ef4444, #f97316);
}

.rit-chart-closed {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #16a34a, #4ade80);
}

@keyframes ritBarGrow {
    from { transform: scaleX(0); opacity: .35; }
    to { transform: scaleX(1); opacity: 1; }
}

.rit-chart-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 10px;
    margin-top: 6px;
    color: var(--rit-v4-muted);
    font-size: 8px;
}

.rit-chart-value {
    text-align: right;
}

.rit-chart-value strong,
.rit-chart-value span {
    display: block;
}

.rit-chart-value strong {
    color: var(--rit-v4-ink);
    font-size: 19px;
    font-weight: 800;
    line-height: 1;
}

.rit-chart-value span {
    margin-top: 3px;
    color: var(--rit-v4-muted);
    font-size: 8px;
    text-transform: uppercase;
}

.rit-chart-empty {
    min-height: 310px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.rit-donut-layout {
    display: grid;
    grid-template-columns: 150px 1fr;
    align-items: center;
    gap: 22px;
    padding: 24px 22px;
}

.rit-donut {
    position: relative;
    width: 148px;
    height: 148px;
    border-radius: 50%;
    box-shadow: 0 16px 32px rgba(15,23,42,.1);
}

.rit-donut::after {
    content: "";
    position: absolute;
    inset: 25px;
    border-radius: 50%;
    background: #fff;
    box-shadow: inset 0 0 0 1px #eef2f7;
}

.rit-donut-center {
    position: absolute;
    z-index: 2;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.rit-donut-center strong {
    color: var(--rit-v4-ink);
    font-size: 29px;
    font-weight: 800;
    line-height: 1;
}

.rit-donut-center span {
    margin-top: 5px;
    color: var(--rit-v4-muted);
    font-size: 9px;
    font-weight: 600;
}

.rit-donut-legend {
    display: grid;
    gap: 9px;
}

.rit-donut-legend > div {
    display: grid;
    grid-template-columns: 10px 1fr auto;
    align-items: center;
    gap: 7px;
    color: var(--rit-v4-muted);
    font-size: 10px;
}

.rit-donut-legend strong {
    color: var(--rit-v4-ink);
    font-size: 11px;
}

.rit-donut-legend .is-red { background: #dc2626; }
.rit-donut-legend .is-blue { background: #2563eb; }
.rit-donut-legend .is-amber { background: #f59e0b; }
.rit-donut-legend .is-green { background: #16a34a; }
.rit-donut-legend .is-purple { background: #7e22ce; }

.rit-resolution-strip {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-top: 1px solid var(--rit-v4-line);
    background: #f8fafc;
}

.rit-resolution-strip > div {
    padding: 13px 16px;
}

.rit-resolution-strip > div + div {
    border-left: 1px solid var(--rit-v4-line);
}

.rit-resolution-strip span,
.rit-resolution-strip strong {
    display: block;
}

.rit-resolution-strip span {
    color: var(--rit-v4-muted);
    font-size: 9px;
}

.rit-resolution-strip strong {
    margin-top: 3px;
    color: var(--rit-v4-ink);
    font-size: 17px;
}

.rit-area-ranking {
    padding: 8px 18px 15px;
}

.rit-area-ranking a {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 10px 2px;
    border-bottom: 1px solid #eef2f7;
    color: inherit;
}

.rit-area-ranking a:last-child { border-bottom: 0; }
.rit-area-ranking a:hover { text-decoration: none; transform: translateX(3px); }

.rit-rank-number {
    display: flex;
    width: 25px;
    height: 25px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--rit-v4-red);
    background: #fee2e2;
    font-size: 10px;
    font-weight: 800;
}

.rit-rank-name,
.rit-rank-name small {
    display: block;
}

.rit-rank-name {
    overflow: hidden;
    color: var(--rit-v4-ink);
    font-size: 10px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rit-rank-name small {
    margin-top: 2px;
    color: var(--rit-v4-muted);
    font-size: 8px;
    font-weight: 500;
}

.rit-area-ranking a > strong {
    color: var(--rit-v4-ink);
    font-size: 14px;
}

.rit-link-small {
    color: var(--rit-v4-red);
    font-size: 9px;
    font-weight: 700;
}

.rit-filter-card-v4 {
    padding: 0;
    overflow: hidden;
}

.rit-filter-card-v4 .rit-filter-heading {
    justify-content: space-between;
    padding: 15px 17px;
    border-bottom: 1px solid var(--rit-v4-line);
    background: linear-gradient(135deg, #fff, #f8fafc);
}

.rit-filter-card-v4 > .row {
    padding: 17px 17px 2px;
}

.rit-active-filter-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 13px 15px;
    border: 1px solid #fecaca;
    border-radius: 13px;
    background: #fff7f7;
}

.rit-active-filter-banner > span {
    display: inline-flex;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: #fff;
    background: var(--rit-v4-red);
}

.rit-active-filter-banner > div {
    flex: 1;
}

.rit-active-filter-banner strong,
.rit-active-filter-banner small {
    display: block;
}

.rit-active-filter-banner strong { color: var(--rit-v4-ink); font-size: 12px; }
.rit-active-filter-banner small { color: var(--rit-v4-muted); font-size: 9px; margin-top: 2px; }
.rit-active-filter-banner a { color: var(--rit-v4-red); font-size: 10px; font-weight: 700; }

.rit-table-toolbar-v4 {
    min-height: 70px;
}

.rit-result-count {
    display: flex;
    align-items: baseline;
    gap: 5px;
    padding: 7px 12px;
    border-radius: 10px;
    background: #f1f5f9;
}

.rit-result-count strong { color: var(--rit-v4-ink); font-size: 18px; }
.rit-result-count span { color: var(--rit-v4-muted); font-size: 9px; }

.rit-ticket-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8fafc;
}

.rit-ticket-table tbody tr {
    transition: background .15s ease;
}

.rit-ticket-table tbody tr:hover {
    background: #fffafa;
}

/* Universal refinement across detail, close, settings and legacy admin pages. */
.content .card,
.content .rit-table-wrap,
.content .rit-detail-panel,
.content .rit-close-panel {
    box-shadow: var(--rit-v4-shadow);
}

.content .btn-danger {
    border-color: var(--rit-v4-red);
    background: linear-gradient(135deg, var(--rit-v4-red), var(--rit-v4-red-dark));
    box-shadow: 0 7px 16px rgba(185, 28, 28, .16);
}

.content .btn-danger:hover {
    border-color: #991b1b;
    background: linear-gradient(135deg, #dc2626, #991b1b);
}

.content .table thead th {
    color: #475569;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .35px;
    text-transform: uppercase;
}

.content .table td {
    vertical-align: middle;
}

.main-footer {
    border-top: 1px solid var(--rit-v4-line);
    background: #fff;
    color: var(--rit-v4-muted);
    font-size: 11px;
}

/* Public interface refinements. */
.public-complaint-page .complaint-form-card,
.public-success-page .success-card {
    box-shadow: 0 26px 80px rgba(15, 23, 42, .13);
}

.public-complaint-page .complaint-type-card {
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.public-complaint-page .complaint-type-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(15, 23, 42, .08);
}

.rit-public-footer {
    min-height: 66px;
}

@media (max-width: 1199.98px) {
    .rit-dashboard-filter-card {
        align-items: stretch;
        flex-direction: column;
    }

    .rit-dashboard-filter-form {
        grid-template-columns: 1fr 1fr auto;
    }

    .rit-chart-row {
        grid-template-columns: 190px minmax(210px, 1fr) 58px;
    }
}

@media (max-width: 767.98px) {
    .content-header { padding: 17px 13px 7px; }
    .content { padding: 0 13px 18px; }

    .rit-page-actions {
        width: 100%;
    }

    .rit-page-actions .btn {
        flex: 1 1 auto;
    }

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

    .rit-dashboard-filter-form .btn {
        width: 100%;
    }

    .rit-stat-grid-v4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .rit-stat-grid-v4 .rit-stat-card {
        min-height: 140px;
    }

    .rit-analytics-header {
        flex-direction: column;
    }

    .rit-waroeng-chart {
        max-height: 560px;
        padding: 9px 14px 16px;
    }

    .rit-chart-row {
        grid-template-columns: 1fr 48px;
        gap: 9px;
        padding: 12px 1px;
    }

    .rit-chart-label {
        grid-column: 1 / 2;
    }

    .rit-chart-plot {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .rit-chart-value {
        grid-column: 2;
        grid-row: 1;
    }

    .rit-donut-layout {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .rit-donut-legend {
        width: 100%;
    }

    .rit-active-filter-banner {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .rit-active-filter-banner a {
        width: 100%;
        padding-left: 48px;
    }

    .rit-filter-card-v4 .rit-filter-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .rit-filter-card-v4 .rit-filter-heading > .btn {
        width: 100%;
    }

    .public-nav .container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .complaint-form-card {
        padding: 22px 17px !important;
    }

    .complaint-form-heading {
        align-items: flex-start !important;
        flex-direction: column;
        gap: 12px;
    }

    .rit-public-footer {
        align-items: center !important;
        flex-direction: column;
        gap: 9px;
        padding: 13px 0;
        text-align: center;
    }
}

@media (max-width: 420px) {
    .rit-stat-grid-v4 {
        grid-template-columns: 1fr;
    }

    .rit-stat-grid-v4 .rit-stat-card {
        min-height: 122px;
    }
}
