:root {
    --bg: #f3f6fb;
    --bg-secondary: #e8eef8;
    --surface: #ffffff;
    --surface-alt: #f7fafe;
    --text: #13253f;
    --muted: #5f738f;
    --border: #d8e1ef;
    --primary: #488EB5;
    --primary-strong: #2f7398;
    --primary-soft: #e8f2f8;
    --success: #0d8f64;
    --warning: #c67f06;
    --danger: #bf3f3f;
    --shadow: 0 12px 30px rgba(17, 44, 86, 0.09);
    --radius: 16px;
    --radius-sm: 10px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at 12% 10%, rgba(72, 142, 181, 0.16), transparent 34%),
        radial-gradient(circle at 88% 0%, rgba(72, 142, 181, 0.1), transparent 30%),
        var(--bg);
    color: var(--text);
    font-family: "Cairo", "Segoe UI", Tahoma, sans-serif;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

.admin-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    background: linear-gradient(160deg, #ffffff, #f8fcff 60%, #edf6ff);
    border-inline-end: 1px solid var(--border);
    padding: 24px 18px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.sidebar-logo {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    object-fit: contain;
    padding: 7px;
}

.sidebar-title {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
}

.sidebar-subtitle {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.sidebar-brand-logo {
    display: block;
    width: 100%;
    max-width: 180px;
    margin: 0 0 18px auto;
    opacity: 0.9;
}

.sidebar-nav {
    display: grid;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    color: #2f4a6c;
    transition: 0.2s ease;
}

.nav-link:hover {
    background: #eaf4ff;
    transform: translateY(-1px);
}

.nav-link.active {
    background: linear-gradient(130deg, var(--primary), #68a7ca);
    color: #fff;
    box-shadow: var(--shadow);
}

.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

.sidebar-note {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 12px;
}

.logout-btn {
    width: 100%;
}

.content {
    min-width: 0;
    padding: 24px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 20px;
}

.page-title {
    margin: 0;
    font-size: clamp(24px, 2.4vw, 34px);
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.page-subtitle {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.btn {
    border: 0;
    border-radius: 11px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: 0.2s ease;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(130deg, var(--primary), #68a7ca);
    color: #fff;
}

.btn-soft {
    background: var(--primary-soft);
    color: var(--primary-strong);
}

.btn-danger {
    background: #ffe4e4;
    color: #8d2121;
}

.btn-success {
    background: #def5ec;
    color: #0d6a4a;
}

.btn-warning {
    background: #ffefcf;
    color: #8f6207;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
}

.card h3 {
    margin-top: 0;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.stat-card {
    border-radius: 14px;
    padding: 16px;
    background: linear-gradient(140deg, #ffffff, #f2f8ff);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: "";
    position: absolute;
    top: -18px;
    left: -18px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(72, 142, 181, 0.12);
}

.stat-label {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.stat-value {
    margin: 10px 0 4px;
    font-size: 28px;
    font-weight: 900;
    line-height: 1;
}

.stat-hint {
    margin: 0;
    color: #4e6891;
    font-size: 12px;
}

.filters {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.filters-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.field {
    display: grid;
    gap: 6px;
}

.field label {
    font-size: 12px;
    font-weight: 700;
    color: #466389;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="datetime-local"],
input[type="number"],
input[type="url"],
select,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 10px 12px;
    background: #fff;
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #8bb5cd;
    box-shadow: 0 0 0 3px rgba(72, 142, 181, 0.16);
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-row input {
    width: 16px;
    height: 16px;
}

.table-wrap {
    overflow: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 740px;
}

th,
td {
    text-align: right;
    padding: 12px 10px;
    border-bottom: 1px solid #e6edf7;
    font-size: 13px;
    vertical-align: top;
}

th {
    color: #466389;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    background: #f9fbff;
    position: sticky;
    top: 0;
}

tr:hover td {
    background: #fbfdff;
}

.badge {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.badge-success {
    background: #def5ec;
    color: #0b7f58;
}

.badge-danger {
    background: #ffe5e5;
    color: #9f2d2d;
}

.badge-warning {
    background: #ffefcf;
    color: #8f6207;
}

.badge-primary {
    background: #e3f4fb;
    color: #0b6588;
}

.actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.permissions-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.permission-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: linear-gradient(145deg, #ffffff, #f6fbff);
    padding: 12px;
    display: grid;
    gap: 8px;
}

.permission-card label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

.permission-card input {
    width: 18px;
    height: 18px;
}

.permission-card p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

.permissions-summary {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.alert {
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 14px;
    font-size: 13px;
    font-weight: 700;
}

.alert-success {
    background: #e5f7ef;
    border: 1px solid #bee8d6;
    color: #0d6a4a;
}

.alert-error {
    background: #ffe8e8;
    border: 1px solid #f5c8c8;
    color: #9d2f2f;
}

.helper {
    color: var(--muted);
    font-size: 12px;
}

.empty-state {
    text-align: center;
    padding: 34px 16px;
    background: linear-gradient(145deg, #fff, #f6fbff);
    border: 1px dashed #c9d8ea;
    border-radius: 14px;
    color: #567091;
    font-size: 14px;
    font-weight: 700;
}

.section-title {
    margin: 0 0 8px;
    font-size: 17px;
    font-weight: 800;
}

.phone-export-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 14px;
    margin: 14px 0;
}

.inline-tools {
    display: flex;
    align-items: end;
    gap: 10px;
    flex-wrap: wrap;
}

.compact-field {
    min-width: 180px;
}

.selection-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: linear-gradient(145deg, #ffffff, #f6fbff);
    border: 1px solid var(--border);
    font-size: 13px;
    font-weight: 700;
}

.selection-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.table-checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.phone-cell {
    display: grid;
    gap: 4px;
}

.phone-link {
    color: var(--primary-strong);
    font-weight: 800;
}

.mono-text {
    direction: ltr;
    unicode-bidi: plaintext;
    font-family: "Segoe UI", Tahoma, sans-serif;
}

.btn-micro {
    padding: 7px 10px;
    font-size: 11px;
}

.article-tip-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.article-tip-item {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    padding: 10px;
    display: grid;
    gap: 4px;
}

.article-tip-k {
    font-size: 12px;
    font-weight: 800;
    color: #4f6788;
}

.article-tip-v {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.article-switches {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.article-admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.article-admin-card {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: linear-gradient(145deg, #ffffff, #f7fbff);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.article-admin-cover {
    height: 178px;
    background: linear-gradient(135deg, #edf5ff, #dfeefb);
    display: grid;
    place-items: center;
    color: #4d6789;
    font-weight: 800;
    font-size: 13px;
}

.article-admin-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-admin-body {
    padding: 12px;
}

.article-admin-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.article-admin-top h3 {
    margin: 0;
    font-size: 16px;
    line-height: 1.3;
}

.article-admin-excerpt {
    margin: 10px 0 0;
    color: #4f6583;
    font-size: 13px;
    line-height: 1.7;
    min-height: 68px;
}

.article-admin-meta {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.article-admin-meta span {
    border-radius: 999px;
    background: #ecf4fd;
    color: #426488;
    font-size: 11px;
    font-weight: 800;
    padding: 5px 9px;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 170px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
    margin-bottom: 8px;
    width: 100%;
    min-width: 0;
}

.bar-group {
    display: grid;
    gap: 7px;
    flex: 1 1 0;
    min-width: 0;
}

.bar {
    background: linear-gradient(180deg, #6ba9cc, #488eb5);
    border-radius: 9px 9px 5px 5px;
    min-height: 2px;
    transform-origin: bottom;
    animation: growBar 0.8s ease both;
}

.bar-duration {
    background: linear-gradient(180deg, #3ab685, #0d8f64);
}

.bar-label {
    text-align: center;
    color: #567091;
    font-size: 11px;
    font-weight: 700;
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.app-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    padding: 12px;
}

.app-card h4 {
    margin: 0 0 4px;
    font-size: 14px;
}

.app-meta {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 22px;
}

.login-card {
    width: min(460px, 100%);
    background: linear-gradient(160deg, #ffffff, #f4f9ff);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    border-radius: 20px;
    padding: 26px 22px;
}

.login-logo {
    display: block;
    width: 70px;
    height: 70px;
    border-radius: 18px;
    margin: 0 auto 10px;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    object-fit: contain;
    padding: 10px;
}

.login-brand-logo {
    width: min(230px, 100%);
    margin: 0 auto 6px;
    opacity: 0.95;
}

.login-title {
    margin: 0;
    text-align: center;
    font-size: 24px;
}

.login-subtitle {
    margin: 6px 0 18px;
    color: var(--muted);
    text-align: center;
    font-size: 13px;
}

.login-footer {
    margin: 14px 0 0;
    color: #607694;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
}

.mobile-toggle {
    display: none;
}

[data-sidebar-close] {
    display: none;
    margin-bottom: 12px;
}

.pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
}

.pager-info {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

[data-animate] {
    opacity: 0;
    transform: translateY(16px);
    transition: 0.5s ease;
}

[data-animate].in-view {
    opacity: 1;
    transform: translateY(0);
}

@keyframes growBar {
    from {
        transform: scaleY(0.12);
    }
    to {
        transform: scaleY(1);
    }
}

@media (max-width: 1200px) {
    .grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 960px) {
    .admin-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        right: 0;
        top: 0;
        width: min(300px, 86vw);
        transform: translateX(110%);
        transition: 0.25s ease;
        z-index: 60;
        box-shadow: var(--shadow);
        overflow: auto;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .mobile-toggle {
        display: inline-flex;
    }

    [data-sidebar-close] {
        display: inline-flex;
    }

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

    .filters-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grid-3,
    .grid-2,
    .phone-export-grid,
    .app-grid,
    .article-admin-grid,
    .article-tip-grid,
    .permissions-grid {
        grid-template-columns: 1fr;
    }

    .selection-toolbar,
    .selection-summary {
        align-items: stretch;
        flex-direction: column;
    }

    .content {
        padding: 18px;
    }
}

@media (max-width: 640px) {
    .filters,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .filters-4 {
        grid-template-columns: 1fr;
    }

    .btn {
        width: 100%;
    }
}

body.sidebar-open {
    overflow: hidden;
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(11, 29, 53, 0.42);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 45;
}

.sidebar-backdrop.visible {
    opacity: 1;
    visibility: visible;
}

.admin-shell {
    grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
}

.sidebar {
    padding: 20px 16px 18px;
    gap: 16px;
    overflow-y: auto;
    overscroll-behavior: contain;
    box-shadow: inset -1px 0 0 rgba(216, 225, 239, 0.9);
}

.sidebar-top {
    display: grid;
    gap: 14px;
}

.sidebar-brand-link {
    display: inline-flex;
    width: fit-content;
}

.sidebar-brand-logo {
    margin: 0;
    max-width: 185px;
}

.sidebar-user-card {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(232, 242, 248, 0.95), rgba(255, 255, 255, 0.98));
    border: 1px solid rgba(216, 225, 239, 0.95);
}

.sidebar-user-card strong {
    font-size: 14px;
    font-weight: 900;
}

.sidebar-user-card span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.sidebar-nav {
    flex: 1 1 auto;
    align-content: start;
}

.nav-link {
    min-height: 48px;
}

.sidebar-footer {
    margin-top: 0;
    position: sticky;
    bottom: 0;
    background: linear-gradient(180deg, rgba(248, 252, 255, 0.4), #f8fcff 34%, #f2f8ff 100%);
    padding-top: 14px;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.sidebar-close-btn {
    display: none;
}

.content {
    padding: 28px 28px 34px;
}

.topbar {
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
}

.topbar-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.topbar-user-chip {
    display: inline-grid;
    gap: 2px;
    min-width: 156px;
    padding: 11px 14px;
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(237, 246, 255, 0.94));
    border: 1px solid rgba(216, 225, 239, 0.95);
    box-shadow: 0 10px 22px rgba(17, 44, 86, 0.06);
}

.topbar-user-chip strong {
    font-size: 13px;
    font-weight: 900;
}

.topbar-user-chip span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(72, 142, 181, 0.12);
    color: var(--primary-strong);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.report-tabs {
    display: inline-flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.report-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.82);
    color: #335372;
    font-size: 13px;
    font-weight: 800;
    transition: 0.2s ease;
}

.report-tab:hover {
    background: #eef6fd;
    transform: translateY(-1px);
}

.report-tab.active {
    background: linear-gradient(130deg, var(--primary), #68a7ca);
    color: #fff;
    border-color: transparent;
    box-shadow: var(--shadow);
}

.report-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
    gap: 18px;
    align-items: start;
    background:
        radial-gradient(circle at 88% 14%, rgba(72, 142, 181, 0.14), transparent 34%),
        linear-gradient(145deg, #ffffff, #f6fbff);
}

.report-hero h3 {
    margin: 10px 0 8px;
    font-size: 24px;
}

.report-hero p {
    margin: 0;
    color: #4d6788;
    line-height: 1.8;
    font-size: 14px;
}

.filters-report {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 0;
}

.report-actions {
    align-self: end;
}

.report-metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.report-metric-card {
    border-radius: 18px;
    padding: 18px;
    background:
        radial-gradient(circle at 100% 0%, rgba(72, 142, 181, 0.14), transparent 32%),
        linear-gradient(150deg, #ffffff, #f4f9ff);
    border: 1px solid rgba(216, 225, 239, 0.95);
    box-shadow: var(--shadow);
}

.report-chart-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.chart-bars-compact {
    height: 160px;
}

.chart-scroll {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 2px 8px;
    margin: 0 -2px -8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(72, 142, 181, 0.55) rgba(232, 238, 248, 0.9);
}

.chart-scroll::-webkit-scrollbar {
    height: 8px;
}

.chart-scroll::-webkit-scrollbar-track {
    background: rgba(232, 238, 248, 0.9);
    border-radius: 999px;
}

.chart-scroll::-webkit-scrollbar-thumb {
    background: rgba(72, 142, 181, 0.55);
    border-radius: 999px;
}

.chart-bars-dense {
    justify-content: flex-start;
    gap: 6px;
    min-width: max(100%, calc(var(--chart-points, 7) * 42px));
}

.chart-bars-dense .bar-group {
    flex: 0 0 36px;
    min-width: 36px;
}

.chart-bars-dense .bar-label {
    font-size: 10px;
    line-height: 1.2;
    white-space: nowrap;
}

.bar-secondary {
    background: linear-gradient(180deg, #8c86f4, #5971dc);
}

.application-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.application-card {
    display: grid;
    gap: 14px;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background:
        radial-gradient(circle at 100% 0%, rgba(72, 142, 181, 0.12), transparent 32%),
        linear-gradient(145deg, #ffffff, #f7fbff);
    box-shadow: var(--shadow);
}

.application-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.application-card-top h3 {
    margin: 0;
    font-size: 19px;
}

.application-card-top p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.application-platforms {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.application-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.application-stat {
    display: grid;
    gap: 6px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(243, 248, 255, 0.8);
    border: 1px solid rgba(216, 225, 239, 0.88);
}

.application-stat span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.application-stat strong {
    font-size: 18px;
    line-height: 1.1;
}

.report-list-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stack-list {
    display: grid;
    gap: 10px;
}

.stack-card {
    display: grid;
    gap: 8px;
    padding: 12px;
    border-radius: 14px;
    background: linear-gradient(145deg, #ffffff, #f8fbff);
    border: 1px solid var(--border);
}

.stack-card p {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
}

.stack-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

@media (max-width: 1200px) {
    .report-metrics-grid,
    .report-chart-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 960px) {
    .sidebar-backdrop {
        display: block;
    }

    .sidebar {
        width: min(340px, 88vw);
        padding: 18px 14px 16px;
        transform: translateX(115%);
        transition: transform 0.25s ease;
        z-index: 60;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-close-btn {
        display: inline-flex;
    }

    .content {
        padding: 18px 16px 28px;
    }

    .topbar {
        flex-direction: column;
    }

    .topbar-tools {
        width: 100%;
        justify-content: space-between;
    }

    .topbar-user-chip {
        min-width: 0;
        flex: 1 1 auto;
    }

    .mobile-toggle {
        display: inline-flex;
    }

    .filters-report,
    .application-grid,
    .application-stats,
    .report-list-grid {
        grid-template-columns: 1fr;
    }

    .report-hero {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .report-metrics-grid,
    .report-chart-grid {
        grid-template-columns: 1fr;
    }

    .topbar-tools {
        flex-direction: column;
        align-items: stretch;
    }

    .report-tabs {
        display: grid;
    }

    .actions .btn,
    .report-actions .btn,
    .report-tab {
        width: 100%;
    }
}

.card,
.report-metric-card,
.application-card,
.stack-card,
.report-hero > div,
.report-hero > form,
.table-wrap,
.section-head > div,
.topbar > div,
.topbar-tools {
    min-width: 0;
}

.table-wrap {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
}

.table-wrap table {
    width: 100%;
}

.table-wrap td,
.table-wrap th,
.table-wrap code,
.stack-card strong,
.stack-card p,
.application-card h3,
.application-card p {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.report-hero,
.report-metrics-grid,
.report-list-grid,
.report-chart-grid,
.application-grid,
.application-stats {
    max-width: 100%;
}

.report-tab,
.badge,
.topbar-user-chip,
.sidebar-user-card {
    max-width: 100%;
}
