:root {
    --bg: #f6f7f9;
    --bg-accent: #eef2f6;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --surface-muted: #eef2f6;
    --border: #dce3ea;
    --border-strong: #c8d2dc;
    --text: #17202a;
    --text-soft: #334155;
    --muted: #687587;
    --muted-strong: #4b5563;
    --primary: #2557d6;
    --primary-dark: #1d43aa;
    --primary-soft: #e9efff;
    --accent: #0f766e;
    --accent-soft: #e5f4f2;
    --warning-bg: #fff7e6;
    --warning-border: #f0c36a;
    --warning-text: #895200;
    --danger-bg: #fff0f0;
    --danger-border: #efb3b3;
    --danger-text: #a11f1f;
    --info-bg: #edf5ff;
    --info-border: #bbd6f5;
    --info-text: #174f7f;
    --success-bg: #ecf8f1;
    --success-border: #a9d8b9;
    --success-text: #1f6638;
    --sidebar-bg: #171a20;
    --sidebar-muted: #9aa6b5;
    --sidebar-text: #f8fafc;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    --shadow-strong: 0 18px 48px rgba(15, 23, 42, 0.13);
    --radius: 8px;
    --sidebar-width: 236px;
    --topbar-height: 66px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100%;
    color: var(--text);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.82) 0, rgba(246, 247, 249, 0) 280px),
        var(--bg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    text-rendering: optimizeLegibility;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

a:hover {
    color: var(--primary-dark);
    text-decoration: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(37, 87, 214, 0.2);
    outline-offset: 2px;
}

button,
input,
select,
textarea {
    font: inherit;
}

/* App shell */

.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-height: 100vh;
    padding: 18px 14px;
    color: var(--sidebar-text);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0) 260px),
        var(--sidebar-bg);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 4px 6px;
    color: var(--sidebar-text);
}

.brand:hover {
    color: var(--sidebar-text);
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius);
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.22);
    font-size: 12px;
    font-weight: 800;
}

.brand-logo-frame {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius);
    background: #ffffff;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.18);
    padding: 0px;
}

.brand-logo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-copy {
    display: grid;
    gap: 0;
    min-width: 0;
}

.brand-copy strong {
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.08;
    white-space: normal;
}

.brand-copy strong span {
    display: block;
}

.brand-copy small {
    color: var(--sidebar-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.nav {
    display: grid;
    gap: 4px;
}

.nav a {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 38px;
    border-radius: var(--radius);
    color: #cfd8e3;
    padding: 9px 11px;
    font-size: 13px;
    font-weight: 700;
}

.nav a::before {
    content: "";
    width: 6px;
    height: 6px;
    margin-right: 10px;
    border-radius: 999px;
    background: rgba(207, 216, 227, 0.45);
}

.nav a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.nav a.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.nav a.active::before {
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.16);
}

.main-area {
    min-width: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--topbar-height);
    padding: 12px 24px;
    border-bottom: 1px solid rgba(220, 227, 234, 0.9);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: saturate(160%) blur(14px);
    gap: 16px;
}

.topbar-title {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.topbar-brand-logo {
    display: inline-flex;
}

.topbar-brand-logo .brand-logo-frame {
    width: 42px;
    height: 42px;
    border-color: var(--border);
    box-shadow: var(--shadow-sm);
}

.topbar-brand-logo .brand-mark {
    width: 34px;
    height: 30px;
    border-color: var(--border);
    color: #ffffff;
    box-shadow: var(--shadow-sm);
}

.topbar-title strong {
    overflow: hidden;
    color: var(--text);
    font-size: 16px;
    font-weight: 800;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-label {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
    text-transform: uppercase;
}

.topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.icon-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--muted-strong);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}

.icon-button:disabled {
    cursor: default;
    opacity: 0.78;
}

.icon-button:hover {
    border-color: rgba(37, 87, 214, 0.34);
    color: var(--primary);
    background: #fbfdff;
}

.notifications {
    position: relative;
}

.notification-icon {
    position: relative;
    width: 15px;
    height: 17px;
    border: 2px solid currentColor;
    border-bottom-width: 0;
    border-radius: 9px 9px 3px 3px;
}

.notification-icon::before {
    content: "";
    position: absolute;
    left: 4px;
    bottom: -5px;
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: currentColor;
}

.notification-icon::after {
    content: "";
    position: absolute;
    left: -4px;
    right: -4px;
    bottom: -1px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    display: none;
    width: 8px;
    height: 8px;
    border: 2px solid var(--surface);
    border-radius: 999px;
    background: var(--warning-text);
}

.notifications.has-new .notification-dot {
    display: block;
}

.notification-dropdown {
    position: absolute;
    top: calc(100% + 9px);
    right: 0;
    z-index: 30;
    width: min(360px, calc(100vw - 28px));
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-strong);
}

.notification-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 13px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #ffffff, var(--surface-soft));
}

.notification-dropdown-header strong {
    color: var(--text);
    font-size: 13px;
}

.notification-dropdown-header span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.notification-list {
    display: grid;
    max-height: 390px;
    overflow: auto;
}

.notification-item {
    display: grid;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    color: var(--text-soft);
    padding: 10px 13px;
}

.notification-item:last-child {
    border-bottom: 0;
}

.notification-item:hover {
    color: var(--text);
    background: var(--primary-soft);
}

.notification-item-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.notification-item strong {
    color: var(--warning-text);
    font-size: 12px;
    font-weight: 900;
}

.notification-item span,
.notification-item small {
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notification-item small {
    color: var(--muted);
}

.notification-empty {
    color: var(--muted);
    padding: 18px 13px;
    text-align: center;
}

.user-chip {
    display: grid;
    gap: 1px;
    min-width: 130px;
    max-width: 210px;
    padding: 5px 11px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.user-chip strong {
    overflow: hidden;
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.content {
    max-width: 1680px;
    margin: 0 auto;
    padding: 22px 24px 32px;
}

/* Typography and reusable layout */

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 14px;
}

.page-header h1,
.panel h1,
.panel h2,
.auth-heading h1 {
    margin: 0;
    color: var(--text);
}

.page-header h1 {
    font-size: 25px;
    line-height: 1.15;
}

.page-header p,
.panel p,
.auth-heading p {
    color: var(--muted);
    margin: 5px 0 0;
}

.page-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 8px 11px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--muted-strong);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
}

.page-meta strong {
    color: var(--text);
}

.dashboard-page-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
}

.live-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
    line-height: 1.2;
}

.live-status span {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--muted);
}

.live-status.is-live span {
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.live-status.is-loading span {
    background: var(--primary);
    animation: live-pulse 900ms ease-in-out infinite;
}

.live-status.is-error span {
    background: var(--danger-text);
}

.panel {
    margin-bottom: 14px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.panel:hover {
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.panel-narrow {
    max-width: 560px;
}

.panel-table {
    overflow: hidden;
    padding: 0;
}

.header-actions,
.detail-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.muted {
    color: var(--muted);
}

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

.nowrap {
    white-space: nowrap;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
    padding: 0;
    white-space: nowrap;
}

/* Buttons */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    padding: 8px 13px;
    color: var(--text);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    transition: transform 140ms ease, background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.button:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.button:active {
    transform: translateY(0);
}

.button-sm {
    min-height: 34px;
    padding: 7px 11px;
    font-size: 13px;
}

.button-primary {
    border-color: var(--primary);
    color: #ffffff;
    background: var(--primary);
    box-shadow: 0 8px 18px rgba(37, 87, 214, 0.2);
}

.button-primary:hover {
    color: #ffffff;
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.button-secondary {
    border-color: var(--border);
    color: var(--text-soft);
    background: var(--surface);
}

.button-secondary:hover {
    color: var(--primary);
    border-color: rgba(37, 87, 214, 0.36);
    background: #fbfdff;
}

.button-important,
.button-warning {
    border-color: var(--warning-border);
    color: var(--warning-text);
    background: var(--warning-bg);
}

.button-danger {
    border-color: var(--danger-border);
    color: var(--danger-text);
    background: var(--danger-bg);
}

.button-ghost,
.action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 5px 9px;
    color: var(--primary);
    background: var(--surface);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
}

.button-ghost:hover,
.action-link:hover {
    color: var(--primary-dark);
    border-color: rgba(37, 87, 214, 0.38);
    background: var(--primary-soft);
}

.action-link-compact {
    min-height: 28px;
    padding: 4px 8px;
}

.button.disabled {
    cursor: not-allowed;
    opacity: 0.55;
    transform: none;
}

/* Forms and filters */

.form {
    display: grid;
    gap: 14px;
}

.form-row {
    display: grid;
    gap: 6px;
}

label {
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;
    min-height: 38px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    background: #ffffff;
    padding: 8px 10px;
    transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

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

input:hover,
select:hover,
textarea:hover {
    border-color: var(--border-strong);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 87, 214, 0.14);
    outline: none;
}

.js-date-picker.flatpickr-input {
    background: #ffffff;
}

.flatpickr-calendar {
    z-index: 40;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-strong);
    font-family: inherit;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected:hover {
    border-color: var(--primary);
    background: var(--primary);
}

.flatpickr-day.today {
    border-color: var(--accent);
}

.flatpickr-day:hover {
    background: var(--primary-soft);
}

.filters-form {
    display: grid;
    align-items: end;
    grid-template-columns: repeat(6, minmax(120px, 1fr));
    gap: 11px;
}

.filters-panel {
    padding: 14px;
}

.activities-filters-form {
    grid-template-columns: repeat(auto-fit, minmax(154px, 1fr));
    gap: 12px;
}

.devices-filters-form {
    grid-template-columns: minmax(260px, 2fr) repeat(2, minmax(126px, 1fr)) auto;
}

.websites-filters-form {
    grid-template-columns: minmax(240px, 2fr) minmax(145px, 1fr) auto;
}

.audit-filters-form {
    grid-template-columns: repeat(2, minmax(130px, 1fr)) minmax(260px, 2fr) minmax(110px, 0.8fr) auto;
}

.audit-filters-panel {
    padding: 14px;
}

.audit-filter-search {
    grid-column: auto;
}

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

.admin-users-edit-grid {
    grid-template-columns: minmax(220px, 1.4fr) repeat(2, minmax(160px, 1fr));
}

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

.admin-users-form-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-search {
    grid-column: span 2;
}

.activities-filters-form .filter-search {
    grid-column: span 2;
}

.devices-filters-form .filter-search {
    grid-column: auto;
}

.filters-actions {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 8px;
}

.activities-filters-form .filters-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
    padding-top: 3px;
}

.activities-filters-form .button {
    min-width: 110px;
}

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

.inline-edit-form {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 7px;
}

.inline-edit-form input {
    min-width: 138px;
    min-height: 34px;
    padding: 7px 9px;
}

.inline-edit-form .button {
    min-height: 34px;
    padding: 7px 10px;
}

/* Flash and status */

.alert {
    margin-bottom: 14px;
    border-radius: var(--radius);
    padding: 11px 13px;
    font-weight: 700;
}

.alert a {
    font-weight: 800;
}

.alert-error {
    border: 1px solid var(--danger-border);
    color: var(--danger-text);
    background: var(--danger-bg);
}

.alert-info {
    border: 1px solid var(--info-border);
    color: var(--info-text);
    background: var(--info-bg);
}

.alert-success {
    border: 1px solid var(--success-border);
    color: var(--success-text);
    background: var(--success-bg);
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}

.badge-important {
    border-color: var(--warning-border);
    color: var(--warning-text);
    background: var(--warning-bg);
}

.badge-neutral {
    border-color: #cfd8e3;
    color: #475569;
    background: #f2f5f8;
}

.badge-default {
    border-color: var(--success-border);
    color: var(--success-text);
    background: var(--success-bg);
}

.badge-status-active {
    border-color: var(--success-border);
    color: var(--success-text);
    background: var(--success-bg);
}

.badge-status-inactive {
    border-color: #d7dee7;
    color: #536173;
    background: #f4f6f9;
}

.status-badge-compact {
    min-width: 104px;
}

/* Tables */

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    padding: 12px 14px;
    color: var(--muted);
    background: linear-gradient(180deg, #ffffff, var(--surface-soft));
    border-bottom: 1px solid var(--border);
    gap: 12px;
}

.table-toolbar strong {
    color: var(--text);
}

.table-toolbar .muted {
    margin-left: 6px;
    font-size: 12px;
}

.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    border-bottom: 1px solid var(--border);
    padding: 9px 11px;
    text-align: left;
    vertical-align: top;
}

.table th {
    color: var(--muted-strong);
    background: var(--surface-soft);
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.table tbody tr {
    transition: background-color 140ms ease;
}

.table tbody tr:hover {
    background: #fbfdff;
}

.activities-table tbody tr.row-important {
    background: #fffbf1;
}

.activities-table tbody tr.row-important td:first-child {
    box-shadow: inset 3px 0 0 var(--warning-border);
}

.activities-table tbody tr.row-important:hover {
    background: #fff7e6;
}

.table tbody tr:last-child td {
    border-bottom: 0;
}

.sort-link {
    color: var(--text-soft);
}

.sort-link:hover {
    color: var(--primary);
}

.sort-options {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 2px;
    font-size: 11px;
    font-weight: 700;
}

.dashboard-table,
.statistics-table,
.activities-table,
.devices-table,
.websites-table,
.admins-table,
.context-table {
    font-size: 12px;
}

.dashboard-table {
    min-width: 730px;
}

.summary-table {
    min-width: 500px;
}

.statistics-table {
    min-width: 540px;
}

.statistics-wide-table {
    min-width: 720px;
}

.statistics-hour-table {
    min-width: 300px;
}

.statistics-entity-table {
    min-width: 690px;
}

.statistics-action-table {
    min-width: 620px;
}

.statistics-compact-table {
    min-width: 0;
}

.activities-table {
    min-width: 980px;
}

.activities-table .actions-column {
    width: 1%;
}

.devices-table {
    min-width: 1060px;
}

.websites-table {
    min-width: 940px;
}

.audit-table {
    min-width: 820px;
}

.admins-table {
    min-width: 900px;
}

.context-table {
    min-width: 800px;
}

.time-cell {
    min-width: 160px;
    white-space: nowrap;
}

.url-cell {
    max-width: 280px;
    overflow-wrap: anywhere;
}

.details-cell {
    max-width: 320px;
    overflow-wrap: anywhere;
}

.details-summary,
.config-summary,
.json-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.details-chip,
.details-more,
.config-badge {
    display: inline-block;
    max-width: 100%;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px 7px;
    color: var(--text-soft);
    background: var(--surface-muted);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.15;
}

.config-badge-set {
    border-color: var(--success-border);
    color: var(--success-text);
    background: var(--success-bg);
}

.config-badge-empty {
    border-color: #d7dee7;
    color: #536173;
    background: #f4f6f9;
}

.device-name-cell,
.website-domain-cell {
    min-width: 170px;
}

.device-name-cell {
    min-width: 230px;
}

.device-name-line {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.device-title,
.website-title {
    color: var(--text);
    font-weight: 850;
    overflow-wrap: anywhere;
}

.device-name-line .device-title {
    min-width: 0;
}

.device-edit-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border: 1px solid transparent;
    border-radius: 7px;
    color: var(--muted-strong);
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}

.device-edit-button:hover {
    border-color: rgba(37, 87, 214, 0.32);
    color: var(--primary);
    background: var(--primary-soft);
}

.device-code-line {
    margin-top: 3px;
    font-size: 11px;
    overflow-wrap: anywhere;
}

.device-ip-inline {
    display: none;
    margin-top: 2px;
    font-size: 11px;
    overflow-wrap: anywhere;
}

.device-inline-edit-form {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) auto;
    gap: 7px;
    max-width: 420px;
}

.device-inline-edit-form input {
    min-height: 34px;
    padding: 7px 9px;
}

.device-inline-edit-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.device-inline-edit-form.is-saving {
    opacity: 0.78;
}

.device-inline-edit-error {
    grid-column: 1 / -1;
    color: var(--danger-text);
    font-size: 12px;
    font-weight: 700;
}

.device-actions-cell {
    min-width: 94px;
    white-space: nowrap;
}

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

.device-status-form {
    display: inline-flex;
    margin: 0;
}

.device-status-form .button {
    white-space: nowrap;
}

.config-cell {
    max-width: 260px;
}

.activity-cell {
    min-width: 185px;
}

.website-activity-summary {
    display: grid;
    gap: 3px;
    justify-items: start;
}

.website-actions-cell {
    min-width: 170px;
}

.website-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.website-credentials-button {
    white-space: nowrap;
}

.admin-users-create-panel .section-heading,
.admin-users-edit-panel .section-heading {
    margin-bottom: 12px;
}

.admin-edit-summary {
    display: grid;
    gap: 3px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    background: var(--surface-soft);
}

.admin-edit-summary span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.admin-edit-summary strong {
    color: var(--text);
    overflow-wrap: anywhere;
}

.admin-password-section {
    display: grid;
    gap: 12px;
    border-top: 1px solid var(--border);
    padding-top: 14px;
}

.admin-account-cell {
    min-width: 190px;
}

.admin-account-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    color: var(--text);
    font-weight: 850;
}

.admin-actions-cell {
    min-width: 94px;
    white-space: nowrap;
}

.audit-admin-cell,
.audit-action-cell {
    min-width: 150px;
}

.audit-description-cell {
    min-width: 260px;
    max-width: 420px;
    overflow-wrap: anywhere;
}

.audit-action-badge {
    justify-content: flex-start;
    max-width: 170px;
    line-height: 1.18;
    white-space: normal;
}

.screenshot-cell {
    min-width: 88px;
}

.screenshot-link {
    display: inline-flex;
    align-items: center;
    flex-direction: column;
    gap: 5px;
    border: 1px solid transparent;
    border-radius: 7px;
    color: var(--text-soft);
    background: transparent;
    padding: 3px;
    font-size: 11px;
    font-weight: 800;
}

.screenshot-link:hover {
    border-color: rgba(37, 87, 214, 0.28);
    color: var(--primary);
    background: var(--primary-soft);
}

.screenshot-link img {
    display: block;
    width: 70px;
    height: 48px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface-muted);
    object-fit: cover;
}

.screenshot-link.compact img {
    width: 58px;
    height: 38px;
}

.empty-state {
    border-top: 1px solid var(--border);
    color: var(--muted);
    padding: 24px 16px;
    text-align: center;
}

.empty-state.compact {
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    padding: 13px;
    background: var(--surface-soft);
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    border-top: 1px solid var(--border);
    padding: 12px 14px;
    gap: 10px;
}

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

/* Dashboard and statistics */

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

.quick-links a {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    background: var(--surface-soft);
    padding: 12px;
    font-weight: 800;
}

.quick-links a:hover {
    border-color: rgba(37, 87, 214, 0.38);
    color: var(--primary);
    background: var(--primary-soft);
}

.dashboard-period-panel {
    margin-bottom: 14px;
    padding: 10px;
}

.period-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.period-filter a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-soft);
    background: var(--surface-soft);
    padding: 7px 11px;
    font-size: 12px;
    font-weight: 850;
}

.period-filter a:hover,
.period-filter a.active {
    border-color: var(--primary);
    color: #ffffff;
    background: var(--primary);
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.statistics-cards {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.dashboard-card {
    position: relative;
    display: grid;
    align-content: space-between;
    gap: 8px;
    min-height: 118px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    background: linear-gradient(180deg, #ffffff, #fbfcfe);
    box-shadow: var(--shadow-sm);
    padding: 14px;
    overflow: hidden;
}

.dashboard-card::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, rgba(37, 87, 214, 0.2), rgba(15, 118, 110, 0.65), rgba(37, 87, 214, 0.2));
    opacity: 0.72;
}

.dashboard-card::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 66px;
    height: 66px;
    background: radial-gradient(circle at top right, rgba(37, 87, 214, 0.11), rgba(37, 87, 214, 0) 68%);
    pointer-events: none;
}

.dashboard-card:hover {
    border-color: rgba(37, 87, 214, 0.36);
    color: var(--text);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.dashboard-card-important_actions::before {
    background: linear-gradient(90deg, rgba(137, 82, 0, 0.24), rgba(137, 82, 0, 0.86), rgba(37, 87, 214, 0.2));
}

.dashboard-card-active_devices::before,
.dashboard-card-latest_activity::before {
    background: linear-gradient(90deg, rgba(15, 118, 110, 0.2), rgba(15, 118, 110, 0.78), rgba(37, 87, 214, 0.18));
}

.dashboard-card span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.dashboard-card strong {
    color: var(--text);
    font-size: 25px;
    line-height: 1.05;
    overflow-wrap: anywhere;
}

.dashboard-card small {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.dashboard-live-updated .dashboard-card strong {
    animation: dashboard-value-refresh 520ms ease;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.dashboard-live-panel {
    padding: 0;
    overflow: hidden;
}

.dashboard-live-toolbar {
    background:
        linear-gradient(90deg, rgba(15, 118, 110, 0.06), rgba(37, 87, 214, 0.04)),
        #ffffff;
}

.dashboard-live-toolbar > div {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.dashboard-live-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--success-border);
    border-radius: 999px;
    color: var(--success-text);
    background: var(--success-bg);
    padding: 3px 8px;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.dashboard-live-pill span,
.dashboard-live-timeline-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.dashboard-live-timeline-list {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0;
}

.dashboard-live-timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-content: start;
    gap: 6px 8px;
    min-height: 116px;
    border-top: 1px solid var(--border);
    border-right: 1px solid var(--border);
    color: var(--text);
    background: #ffffff;
    padding: 12px;
}

.dashboard-live-timeline-item:last-child {
    border-right: 0;
}

.dashboard-live-timeline-item:hover {
    color: var(--text);
    background: #fbfdff;
}

.dashboard-live-timeline-item.is-important {
    background: linear-gradient(180deg, #fffaf0, #ffffff);
}

.dashboard-live-timeline-item.is-important .dashboard-live-timeline-dot {
    background: var(--warning-text);
    box-shadow: 0 0 0 4px rgba(137, 82, 0, 0.12);
}

.dashboard-live-timeline-main {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.dashboard-live-timeline-main strong {
    overflow: hidden;
    color: var(--text);
    font-size: 12px;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-live-timeline-main small,
.dashboard-live-timeline-meta {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.25;
}

.dashboard-live-timeline-meta {
    grid-column: 1 / -1;
    overflow-wrap: anywhere;
}

.dashboard-live-timeline-flag {
    grid-column: 1 / -1;
    justify-self: start;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted-strong);
    background: var(--surface-soft);
    padding: 2px 7px;
    font-size: 10px;
    font-weight: 900;
}

.dashboard-table tbody tr.row-important {
    background: #fffaf0;
}

.dashboard-table tbody tr.row-important:hover {
    background: #fff6df;
}

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

.dashboard-summary-count-cell {
    min-width: 130px;
}

.dashboard-summary-count-line {
    margin-bottom: 5px;
    color: var(--text);
    font-weight: 850;
}

.dashboard-mini-bar {
    display: block;
    width: 100%;
    max-width: 140px;
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--surface-muted);
}

.dashboard-mini-bar > span {
    display: block;
    width: var(--bar-width, 0%);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.statistics-timeline-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(360px, 0.82fr);
    gap: 14px;
    margin-bottom: 14px;
}

.statistics-chart-card {
    min-width: 0;
}

.statistics-chart-body {
    display: grid;
    gap: 12px;
    padding: 14px;
}

.statistics-chart-legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 11px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
}

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

.statistics-chart-legend i {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

.statistics-legend-total {
    background: var(--primary);
}

.statistics-legend-important {
    background: var(--warning-text);
}

.statistics-bars {
    display: grid;
    align-items: end;
    min-height: 178px;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background:
        linear-gradient(180deg, rgba(37, 87, 214, 0.045), rgba(37, 87, 214, 0)),
        var(--surface-soft);
    padding: 12px 8px 8px;
    -webkit-overflow-scrolling: touch;
}

.statistics-day-bars {
    grid-auto-flow: column;
    grid-auto-columns: minmax(36px, 1fr);
    gap: 7px;
}

.statistics-hour-bars {
    grid-template-columns: repeat(24, minmax(18px, 1fr));
    gap: 4px;
    min-width: 520px;
}

.statistics-vbar {
    display: grid;
    grid-template-rows: 128px auto;
    gap: 6px;
    min-width: 0;
    color: var(--muted);
    font-size: 10px;
    font-weight: 850;
    text-align: center;
}

a.statistics-vbar:hover {
    color: var(--primary);
}

.statistics-vbar-track {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    height: 128px;
    border-bottom: 1px solid var(--border-strong);
}

.statistics-vbar-total,
.statistics-vbar-important {
    position: absolute;
    bottom: 0;
    display: block;
    width: 70%;
    border-radius: 5px 5px 2px 2px;
}

.statistics-vbar-total {
    height: var(--bar-height, 0%);
    background: linear-gradient(180deg, rgba(37, 87, 214, 0.9), rgba(37, 87, 214, 0.68));
}

.statistics-vbar-important {
    height: var(--bar-accent-height, 0%);
    background: linear-gradient(180deg, rgba(137, 82, 0, 0.9), rgba(137, 82, 0, 0.64));
}

.statistics-hour-bars .statistics-vbar-total {
    background: linear-gradient(180deg, rgba(15, 118, 110, 0.9), rgba(15, 118, 110, 0.66));
}

.statistics-vbar-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.statistics-chart-table {
    max-height: 260px;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    -webkit-overflow-scrolling: touch;
}

.statistics-hour-table-wrap {
    max-height: 220px;
}

.statistics-compact-table th,
.statistics-compact-table td {
    padding: 7px 9px;
}

.statistics-entity-cell {
    min-width: 190px;
}

.statistics-entity-title {
    color: var(--text);
    font-weight: 850;
    overflow-wrap: anywhere;
}

.statistics-entity-subtle {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.statistics-metric-cell {
    min-width: 130px;
}

.statistics-count-line,
.statistics-count-cell {
    color: var(--text);
    font-weight: 850;
}

.statistics-count-line {
    margin-bottom: 5px;
}

.statistics-hbar {
    display: block;
    width: 100%;
    max-width: 150px;
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--surface-muted);
}

.statistics-hbar > span {
    display: block;
    width: var(--bar-width, 0%);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.statistics-share-cell {
    min-width: 180px;
}

.statistics-share {
    display: grid;
    grid-template-columns: minmax(90px, 1fr) auto;
    align-items: center;
    gap: 8px;
}

.statistics-share .muted {
    font-size: 12px;
    font-weight: 850;
    white-space: nowrap;
}

@keyframes live-pulse {
    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(0.72);
        opacity: 0.64;
    }
}

@keyframes dashboard-value-refresh {
    0% {
        color: var(--primary);
    }

    100% {
        color: var(--text);
    }
}

.toast-region {
    position: fixed;
    top: calc(var(--topbar-height) + 14px);
    right: 18px;
    z-index: 60;
    display: grid;
    gap: 8px;
    width: min(360px, calc(100vw - 28px));
    pointer-events: none;
}

.admin-toast {
    display: grid;
    gap: 4px;
    border: 1px solid var(--warning-border);
    border-radius: var(--radius);
    color: var(--warning-text);
    background: var(--warning-bg);
    box-shadow: var(--shadow-strong);
    padding: 11px 13px;
    opacity: 0;
    pointer-events: auto;
    transform: translateY(-8px);
    transition: opacity 180ms ease, transform 180ms ease;
}

.admin-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.admin-toast:hover {
    color: var(--warning-text);
    border-color: #dfa836;
    background: #fff3d1;
}

.admin-toast-success {
    border-color: var(--success-border);
    color: var(--success-text);
    background: var(--success-bg);
}

.admin-toast-success:hover {
    border-color: #81c296;
    color: var(--success-text);
    background: #e2f5ea;
}

.admin-toast-error {
    border-color: var(--danger-border);
    color: var(--danger-text);
    background: var(--danger-bg);
}

.admin-toast-error:hover {
    border-color: #e28d8d;
    color: var(--danger-text);
    background: #ffe5e5;
}

.admin-toast-info {
    border-color: var(--info-border);
    color: var(--info-text);
    background: var(--info-bg);
}

.admin-toast-info:hover {
    border-color: #99c3ee;
    color: var(--info-text);
    background: #e4f1ff;
}

.admin-toast strong {
    font-size: 13px;
    line-height: 1.25;
}

.admin-toast span {
    color: #6f4a07;
    font-size: 12px;
    line-height: 1.35;
}

/* Detail page */

.activity-page-header {
    align-items: center;
}

.activity-header-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.detail-summary-card {
    padding: 12px;
}

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

.summary-grid div {
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-soft);
    padding: 9px 10px;
}

.summary-grid dt {
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.summary-grid dd {
    margin: 0;
    color: var(--text);
    font-size: 13px;
    font-weight: 750;
    overflow-wrap: anywhere;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
    gap: 14px;
}

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

.detail-card-header h2 {
    margin: 2px 0 0;
    font-size: 22px;
}

.kicker {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

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

.detail-grid div {
    border-top: 1px solid var(--border);
    padding-top: 9px;
}

.detail-grid dt {
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.detail-grid dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.evidence-card {
    align-self: start;
}

.evidence-card h2,
.panel > h2,
.context-grid h3,
.section-heading h2 {
    margin: 0 0 10px;
}

.evidence-shell {
    padding: 0;
    overflow: hidden;
}

.evidence-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(270px, 340px);
    gap: 0;
}

.evidence-main {
    min-width: 0;
    border-right: 1px solid var(--border);
}

.evidence-section,
.evidence-side-card {
    padding: 14px;
}

.evidence-section + .evidence-section,
.evidence-side-card + .evidence-side-card {
    border-top: 1px solid var(--border);
}

.section-heading {
    margin-bottom: 9px;
}

.section-heading h2 {
    margin-bottom: 0;
    font-size: 16px;
    line-height: 1.2;
}

.evidence-url {
    display: block;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-soft);
    padding: 9px 10px;
    color: var(--text-soft);
    font-size: 12px;
    line-height: 1.45;
}

.evidence-url:hover {
    border-color: rgba(37, 87, 214, 0.34);
    color: var(--primary);
    background: #fbfdff;
}

.evidence-json-summary {
    margin-bottom: 9px;
}

.evidence-side {
    min-width: 0;
    background: var(--surface-soft);
}

.evidence-preview {
    display: block;
    overflow: hidden;
    margin-bottom: 9px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-muted);
}

.evidence-preview img {
    display: block;
    width: 100%;
    max-height: 260px;
    object-fit: contain;
}

.screenshot-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.screenshot-gallery-single {
    grid-template-columns: 1fr;
}

.screenshot-gallery-item {
    display: grid;
    gap: 6px;
    margin-bottom: 0;
    padding: 6px;
}

.screenshot-gallery-item img {
    min-height: 92px;
    border-radius: 6px;
    background: #ffffff;
}

.screenshot-gallery-time {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-align: center;
}

.screenshot-gallery-unavailable {
    display: grid;
    gap: 4px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface-soft);
    padding: 10px;
}

.screenshot-gallery-unavailable strong {
    color: var(--text);
    font-size: 12px;
}

.screenshot-gallery-unavailable span,
.screenshot-gallery-unavailable small {
    color: var(--muted);
    font-size: 11px;
}

.quick-action-list {
    display: grid;
    gap: 7px;
}

.quick-action-list .button {
    justify-content: flex-start;
    width: 100%;
    text-align: left;
}

.compact-alert {
    margin-bottom: 0;
    padding: 10px;
    font-size: 12px;
}

.full-url,
.details-block {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.details-block {
    max-height: 360px;
    margin: 11px 0 0;
    overflow: auto;
    border-radius: var(--radius);
    color: #e7eef8;
    background: #121821;
    padding: 13px;
    font-size: 12px;
    line-height: 1.45;
    white-space: pre-wrap;
}

.raw-details-panel {
    margin-top: 10px;
}

.raw-details-panel summary {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--primary);
    background: var(--surface);
    cursor: pointer;
    padding: 5px 9px;
    font-size: 12px;
    font-weight: 850;
    line-height: 1.2;
}

.raw-details-panel summary:hover {
    border-color: rgba(37, 87, 214, 0.38);
    background: var(--primary-soft);
}

.raw-details-panel .details-block {
    max-height: 300px;
}

.context-grid {
    display: grid;
    gap: 10px;
}

.context-grid h3 {
    color: var(--text);
    font-size: 14px;
}

.current-context {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    border: 1px solid var(--info-border);
    border-radius: var(--radius);
    color: var(--info-text);
    background: var(--info-bg);
    padding: 9px 11px;
}

.context-panel {
    padding: 14px;
}

.context-group {
    min-width: 0;
}

.context-table th,
.context-table td {
    padding: 7px 9px;
}

/* Auth */

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(246, 247, 249, 0.8)),
        radial-gradient(circle at 20% 10%, rgba(37, 87, 214, 0.12), transparent 28%),
        radial-gradient(circle at 84% 16%, rgba(15, 118, 110, 0.11), transparent 26%),
        var(--bg);
}

.auth-card {
    width: 100%;
    max-width: 430px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow-strong);
    padding: 26px;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.auth-brand .brand-mark {
    width: 38px;
    height: 38px;
}

.auth-brand .brand-logo-frame {
    width: 62px;
    height: 42px;
    border-color: var(--border);
    box-shadow: var(--shadow-sm);
}

.auth-brand strong {
    display: block;
    color: var(--text);
    font-size: 16px;
    font-weight: 900;
    line-height: 1.1;
}

.auth-brand span:last-child {
    display: grid;
    gap: 2px;
}

.auth-brand small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.auth-heading {
    margin-bottom: 18px;
}

.auth-heading h1 {
    font-size: 24px;
    line-height: 1.15;
}

.auth-card .button {
    width: 100%;
}

/* Modal */

body.has-modal-open {
    overflow: hidden;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.66);
}

.modal-backdrop.is-open {
    display: flex;
}

.screenshot-modal-backdrop {
    z-index: 80;
}

.modal {
    width: min(920px, 100%);
    max-height: min(760px, calc(100vh - 40px));
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-strong);
}

.screenshot-modal {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    width: min(1180px, 100%);
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}

.modal-header h2 {
    margin: 2px 0 0;
    font-size: 18px;
    line-height: 1.2;
}

.screenshot-modal-meta {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.modal-close {
    flex: 0 0 auto;
    font-size: 19px;
    font-weight: 900;
    line-height: 1;
}

.credentials-modal {
    width: min(560px, 100%);
}

.credentials-form {
    display: grid;
}

.credentials-form.is-saving {
    opacity: 0.78;
}

.credentials-modal-body {
    display: grid;
    gap: 13px;
    padding: 16px;
}

.credentials-domain-preview {
    display: grid;
    gap: 3px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    background: var(--surface-soft);
}

.credentials-domain-preview span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.credentials-domain-preview strong {
    color: var(--text);
    overflow-wrap: anywhere;
}

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

.credentials-error {
    border: 1px solid var(--danger-border);
    border-radius: var(--radius);
    color: var(--danger-text);
    background: var(--danger-bg);
    padding: 9px 10px;
    font-size: 12px;
    font-weight: 800;
}

.credentials-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    background: var(--surface-soft);
}

.screenshot-modal-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    overflow: auto;
    padding: 12px;
    background: #101722;
}

.screenshot-modal-body img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 220px);
    border-radius: 6px;
    background: #ffffff;
    object-fit: contain;
}

.screenshot-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    background: var(--surface-soft);
}

.screenshot-modal-nav,
.screenshot-modal-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Print report */

.print-body {
    min-height: 100vh;
    background: #ffffff;
}

.print-page {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px;
}

.print-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--border-strong);
}

.print-header h1 {
    margin: 0;
    color: var(--text);
    font-size: 26px;
    line-height: 1.15;
}

.print-header p {
    margin: 5px 0 0;
    color: var(--muted);
}

.print-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.print-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 8px;
    margin-bottom: 14px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-soft);
}

.print-summary div {
    min-width: 0;
    color: var(--text-soft);
}

.print-summary strong {
    color: var(--text);
}

.print-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 12px;
}

.print-table th,
.print-table td {
    border: 1px solid var(--border);
    padding: 7px 8px;
    text-align: left;
    vertical-align: top;
    overflow-wrap: anywhere;
}

.print-table th {
    color: var(--muted-strong);
    background: var(--surface-muted);
    font-size: 11px;
    font-weight: 900;
}

.print-table th:nth-child(1) {
    width: 13%;
}

.print-table th:nth-child(2),
.print-table th:nth-child(3),
.print-table th:nth-child(4) {
    width: 11%;
}

.print-table th:nth-child(5) {
    width: 10%;
}

.print-table th:nth-child(6) {
    width: 17%;
}

.print-table th:nth-child(7) {
    width: 19%;
}

.print-table th:nth-child(8) {
    width: 8%;
}

.print-url-cell,
.print-details-cell,
.print-screenshot-cell {
    word-break: break-word;
}

.print-detail-page {
    max-width: 1040px;
}

.print-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 12px;
    margin-bottom: 14px;
}

.print-detail-section {
    margin-bottom: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #ffffff;
    padding: 12px;
}

.print-detail-section h2 {
    margin: 0 0 9px;
    color: var(--text);
    font-size: 15px;
}

.print-detail-kv {
    display: grid;
    gap: 8px;
    margin: 0;
}

.print-detail-kv div {
    min-width: 0;
}

.print-detail-kv dt {
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.print-detail-kv dd {
    margin: 0;
    color: var(--text-soft);
    overflow-wrap: anywhere;
}

.print-full-url,
.print-details-block {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.print-details-block {
    max-height: 520px;
    overflow: auto;
    margin: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-soft);
    padding: 10px;
    white-space: pre-wrap;
}

.print-screenshot-preview {
    display: block;
    margin-top: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-soft);
    padding: 8px;
}

.print-screenshot-preview img {
    display: block;
    width: 100%;
    max-height: 680px;
    object-fit: contain;
}

.print-screenshot-gallery {
    display: grid;
    gap: 14px;
}

.print-screenshot-item {
    display: grid;
    gap: 5px;
    break-inside: avoid;
}

.print-screenshot-item > strong {
    color: var(--text);
}

.print-screenshot-item > span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

@page {
    margin: 12mm;
}

@media print {
    body.print-body {
        color: #111111;
        background: #ffffff;
        font-size: 11px;
    }

    body.print-body .print-page {
        max-width: none;
        padding: 0;
    }

    body.print-body .print-actions {
        display: none !important;
    }

    body.print-body .print-header {
        margin-bottom: 10px;
        padding-bottom: 8px;
        border-bottom: 1px solid #9ca3af;
        break-inside: avoid;
    }

    body.print-body .print-header h1 {
        font-size: 20px;
    }

    body.print-body .print-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 4px 10px;
        margin-bottom: 10px;
        padding: 8px;
        border-color: #cbd5e1;
        background: #ffffff;
        break-inside: avoid;
    }

    body.print-body .alert,
    body.print-body .empty-state {
        break-inside: avoid;
    }

    body.print-body .print-table {
        table-layout: fixed;
        font-size: 9.5px;
    }

    body.print-body .print-table th,
    body.print-body .print-table td {
        border-color: #cbd5e1;
        padding: 4px 5px;
    }

    body.print-body .print-table th {
        color: #111111;
        background: #f1f5f9;
    }

    body.print-body .print-table tr {
        break-inside: avoid;
    }

    body.print-body a {
        color: #111111;
        text-decoration: none;
    }

    body.print-body .print-detail-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-bottom: 8px;
    }

    body.print-body .print-detail-section {
        margin-bottom: 8px;
        border-color: #cbd5e1;
        padding: 8px;
        break-inside: avoid;
    }

    body.print-body .print-detail-section h2 {
        font-size: 13px;
    }

    body.print-body .print-details-block {
        max-height: none;
        border-color: #cbd5e1;
        background: #ffffff;
        font-size: 9.5px;
    }

    body.print-body .print-screenshot-preview {
        border-color: #cbd5e1;
        break-inside: avoid;
    }

    body.print-body .print-screenshot-preview img {
        max-height: 180mm;
    }
}

/* Responsive */

@media (max-width: 1180px) {
    .dashboard-cards,
    .statistics-cards {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

    .dashboard-live-timeline-item:nth-child(3n) {
        border-right: 0;
    }

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

@media (max-width: 980px) {
    :root {
        --sidebar-width: 1fr;
    }

    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: relative;
        min-height: auto;
        padding: 12px;
    }

    .brand {
        padding: 2px 4px 8px;
    }

    .nav {
        grid-template-columns: repeat(auto-fit, minmax(106px, 1fr));
        gap: 6px;
    }

    .nav a {
        justify-content: center;
        min-height: 36px;
        padding: 8px 8px;
        text-align: center;
    }

    .nav a::before {
        display: none;
    }

    .topbar {
        position: relative;
        padding: 12px 18px;
    }

    .content {
        padding: 18px;
    }

    .filters-form,
    .devices-filters-form,
    .websites-filters-form,
    .audit-filters-form,
    .admin-users-form-grid,
    .admin-users-edit-grid,
    .admin-password-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-search {
        grid-column: span 2;
    }

    .devices-filters-form .filter-search {
        grid-column: span 2;
    }

    .audit-filter-search {
        grid-column: span 2;
    }

    .devices-table {
        min-width: 960px;
    }

    .devices-table .column-android,
    .devices-table .column-ip {
        display: none;
    }

    .device-ip-inline {
        display: block;
    }

    .detail-layout,
    .detail-grid,
    .evidence-layout,
    .statistics-timeline-grid,
    .dashboard-grid-secondary {
        grid-template-columns: 1fr;
    }

    .evidence-main {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }
}

@media (max-width: 760px) {
    .activities-table {
        min-width: 680px;
    }

    .dashboard-live-timeline-list,
    .print-detail-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-live-timeline-item,
    .dashboard-live-timeline-item:nth-child(3n) {
        border-right: 0;
    }

    .activities-table th:nth-child(5),
    .activities-table td:nth-child(5),
    .activities-table th:nth-child(6),
    .activities-table td:nth-child(6) {
        display: none;
    }

    .devices-table-scroll {
        overflow-x: visible;
    }

    .devices-table {
        display: block;
        min-width: 0;
    }

    .devices-table thead {
        display: none;
    }

    .devices-table tbody {
        display: grid;
        gap: 10px;
        padding: 12px;
    }

    .devices-table tr {
        display: grid;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        background: var(--surface);
        box-shadow: var(--shadow-sm);
        overflow: hidden;
    }

    .devices-table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        border-bottom: 1px solid var(--border);
        padding: 9px 11px;
        text-align: right;
    }

    .devices-table td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        color: var(--muted);
        font-size: 11px;
        font-weight: 900;
        text-align: left;
        text-transform: uppercase;
    }

    .devices-table td:last-child {
        border-bottom: 0;
    }

    .devices-table tbody tr:last-child td {
        border-bottom: 1px solid var(--border);
    }

    .devices-table tbody tr:last-child td:last-child {
        border-bottom: 0;
    }

    .devices-table .device-name-cell {
        display: block;
        min-width: 0;
        text-align: left;
    }

    .devices-table .device-name-cell::before {
        display: none;
    }

    .devices-table .column-model,
    .devices-table .column-android,
    .devices-table .column-ip,
    .devices-table .column-website {
        display: none;
    }

    .devices-table .column-actions {
        justify-content: flex-start;
        text-align: left;
    }

    .devices-table .column-actions::before {
        display: none;
    }

    .websites-table-scroll {
        overflow-x: visible;
    }

    .websites-table {
        display: block;
        min-width: 0;
    }

    .websites-table thead {
        display: none;
    }

    .websites-table tbody {
        display: grid;
        gap: 10px;
        padding: 12px;
    }

    .websites-table tr {
        display: grid;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        background: var(--surface);
        box-shadow: var(--shadow-sm);
        overflow: hidden;
    }

    .websites-table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        border-bottom: 1px solid var(--border);
        padding: 9px 11px;
        text-align: right;
    }

    .websites-table td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        color: var(--muted);
        font-size: 11px;
        font-weight: 900;
        text-align: left;
        text-transform: uppercase;
    }

    .websites-table td:last-child {
        border-bottom: 0;
    }

    .websites-table tbody tr:last-child td {
        border-bottom: 1px solid var(--border);
    }

    .websites-table tbody tr:last-child td:last-child {
        border-bottom: 0;
    }

    .websites-table .website-domain-cell {
        display: block;
        min-width: 0;
        text-align: left;
    }

    .websites-table .website-domain-cell::before {
        display: none;
    }

    .websites-table .activity-cell .website-activity-summary {
        justify-items: end;
        text-align: right;
    }

    .websites-table .website-actions-cell {
        justify-content: flex-start;
        text-align: left;
    }

    .websites-table .website-actions-cell::before {
        display: none;
    }

    .admins-table-scroll {
        overflow-x: visible;
    }

    .admins-table {
        display: block;
        min-width: 0;
    }

    .admins-table thead {
        display: none;
    }

    .admins-table tbody {
        display: grid;
        gap: 10px;
        padding: 12px;
    }

    .admins-table tr {
        display: grid;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        background: var(--surface);
        box-shadow: var(--shadow-sm);
        overflow: hidden;
    }

    .admins-table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        border-bottom: 1px solid var(--border);
        padding: 9px 11px;
        text-align: right;
    }

    .admins-table td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        color: var(--muted);
        font-size: 11px;
        font-weight: 900;
        text-align: left;
        text-transform: uppercase;
    }

    .admins-table td:last-child {
        border-bottom: 0;
    }

    .admins-table tbody tr:last-child td {
        border-bottom: 1px solid var(--border);
    }

    .admins-table tbody tr:last-child td:last-child {
        border-bottom: 0;
    }

    .admins-table .admin-account-cell {
        display: block;
        min-width: 0;
        text-align: left;
    }

    .admins-table .admin-account-cell::before {
        display: none;
    }

    .admins-table .admin-actions-cell {
        justify-content: flex-start;
        text-align: left;
    }

    .admins-table .admin-actions-cell::before {
        display: none;
    }

    .audit-table-scroll {
        overflow-x: visible;
    }

    .audit-table {
        display: block;
        min-width: 0;
    }

    .audit-table thead {
        display: none;
    }

    .audit-table tbody {
        display: grid;
        gap: 10px;
        padding: 12px;
    }

    .audit-table tr {
        display: grid;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        background: var(--surface);
        box-shadow: var(--shadow-sm);
        overflow: hidden;
    }

    .audit-table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        border-bottom: 1px solid var(--border);
        padding: 9px 11px;
        text-align: right;
    }

    .audit-table td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        color: var(--muted);
        font-size: 11px;
        font-weight: 900;
        text-align: left;
        text-transform: uppercase;
    }

    .audit-table td:last-child {
        border-bottom: 0;
    }

    .audit-table tbody tr:last-child td {
        border-bottom: 1px solid var(--border);
    }

    .audit-table tbody tr:last-child td:last-child {
        border-bottom: 0;
    }

    .audit-table .audit-admin-cell,
    .audit-table .audit-description-cell {
        align-items: flex-start;
        flex-direction: column;
        min-width: 0;
        max-width: none;
        text-align: left;
    }

    .audit-table .audit-admin-cell::before,
    .audit-table .audit-description-cell::before {
        margin-bottom: 4px;
    }

    .statistics-wide-table th:nth-child(4),
    .statistics-wide-table td:nth-child(4),
    .statistics-wide-table th:nth-child(5),
    .statistics-wide-table td:nth-child(5) {
        display: none;
    }
}

@media (max-width: 640px) {
    body {
        font-size: 13px;
    }

    .topbar,
    .page-header {
        align-items: stretch;
        flex-direction: column;
    }

    .topbar-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .notification-dropdown {
        right: auto;
        left: 0;
    }

    .user-chip {
        flex: 1 1 150px;
        max-width: none;
    }

    .nav,
    .quick-links,
    .dashboard-cards,
    .statistics-cards,
    .summary-grid {
        grid-template-columns: 1fr;
    }

    .activity-page-header {
        align-items: stretch;
    }

    .content {
        padding: 14px;
    }

    .page-header h1 {
        font-size: 22px;
    }

    .filters-form,
    .devices-filters-form,
    .websites-filters-form,
    .audit-filters-form,
    .admin-users-form-grid,
    .admin-users-edit-grid,
    .admin-password-grid,
    .filter-search {
        grid-template-columns: 1fr;
        grid-column: auto;
    }

    .devices-filters-form .filter-search {
        grid-column: auto;
    }

    .audit-filter-search {
        grid-column: auto;
    }

    .filters-actions,
    .admin-users-form-actions,
    .admin-users-form-actions .button,
    .filters-actions .button,
    .pagination .button,
    .auth-card .button {
        width: 100%;
    }

    .inline-edit-form {
        align-items: stretch;
        flex-direction: column;
    }

    .inline-edit-form input,
    .inline-edit-form .button {
        width: 100%;
    }

    .device-inline-edit-form {
        grid-template-columns: 1fr;
    }

    .device-inline-edit-controls {
        align-items: stretch;
        flex-direction: column;
    }

    .device-inline-edit-controls .button {
        width: 100%;
    }

    .table-toolbar,
    .pagination {
        align-items: stretch;
        flex-direction: column;
    }

    .statistics-chart-body {
        padding: 12px;
    }

    .statistics-bars {
        min-height: 164px;
    }

    .statistics-vbar {
        grid-template-rows: 116px auto;
    }

    .statistics-vbar-track {
        height: 116px;
    }

    .table-toolbar .muted {
        display: block;
        margin: 2px 0 0;
    }

    .auth-page {
        padding: 16px;
    }

    .auth-card {
        padding: 22px;
    }

    .toast-region {
        top: 14px;
        right: 14px;
        left: 14px;
        width: auto;
    }

    .credentials-modal-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .credentials-modal-footer .button {
        width: 100%;
    }
}

@media (max-width: 440px) {
    .brand-copy strong {
        white-space: normal;
    }

    .activities-table {
        min-width: 560px;
    }

    .activities-table th:nth-child(3),
    .activities-table td:nth-child(3),
    .activities-table th:nth-child(7),
    .activities-table td:nth-child(7) {
        display: none;
    }

    .website-actions,
    .website-actions .button,
    .website-actions .action-link {
        width: 100%;
    }
}

@media (max-width: 980px) {
    .activities-table {
        min-width: 820px;
    }
}

@media (max-width: 760px) {
    .activities-table {
        min-width: 680px;
    }

    .activities-table .url-column,
    .activities-table .details-column {
        display: none;
    }

    .screenshot-modal-body img {
        max-height: calc(100vh - 190px);
    }
}

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

    .activities-filters-form .filter-search,
    .activities-filters-form .filters-actions {
        grid-column: auto;
    }

    .activities-filters-form .button,
    .print-actions,
    .print-actions .button {
        width: 100%;
    }

    .screenshot-modal-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .screenshot-modal-footer .button {
        width: 100%;
    }

    .screenshot-modal-nav,
    .screenshot-modal-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .print-page {
        padding: 16px;
    }

    .print-header {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 440px) {
    .activities-table {
        min-width: 560px;
    }
}

/* Premium responsive redesign */

:root {
    --bg: #f4f6f9;
    --bg-accent: #e8edf4;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --surface-muted: #eef3f8;
    --border: #d8e0ea;
    --border-strong: #b7c4d4;
    --text: #111827;
    --text-soft: #253044;
    --muted: #687386;
    --muted-strong: #465366;
    --primary: #2f5fdb;
    --primary-dark: #2349aa;
    --primary-soft: #edf3ff;
    --accent: #0f766e;
    --accent-soft: #e7f6f3;
    --warning-bg: #fff7e8;
    --warning-border: #ecc46f;
    --warning-text: #7a4a08;
    --danger-bg: #fff1f1;
    --danger-border: #efb1b1;
    --danger-text: #9f1d1d;
    --info-bg: #edf5ff;
    --info-border: #b7d2f4;
    --info-text: #174f7f;
    --success-bg: #edf8f2;
    --success-border: #a7d7ba;
    --success-text: #1f6638;
    --sidebar-bg: #111722;
    --sidebar-bg-strong: #0c111b;
    --sidebar-panel: rgba(255, 255, 255, 0.055);
    --sidebar-border: rgba(255, 255, 255, 0.09);
    --sidebar-muted: #97a5b8;
    --sidebar-text: #f8fafc;
    --shadow-xs: 0 1px 1px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
    --shadow-strong: 0 22px 60px rgba(15, 23, 42, 0.18);
    --radius: 8px;
    --radius-sm: 6px;
    --sidebar-width: 248px;
    --topbar-height: 64px;
    --transition-fast: 150ms ease;
    --transition: 200ms ease;
}

html {
    background: var(--bg);
}

body {
    color: var(--text);
    background:
        linear-gradient(180deg, #fbfcfe 0, var(--bg) 310px),
        var(--bg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

body.admin-body {
    background: var(--bg);
}

::selection {
    color: #ffffff;
    background: var(--primary);
}

a,
button,
input,
select,
textarea {
    -webkit-tap-highlight-color: transparent;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
    outline: 3px solid rgba(47, 95, 219, 0.22);
    outline-offset: 2px;
}

.app-shell {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    background: var(--bg);
}

.main-area {
    min-width: 0;
}

.sidebar {
    z-index: 35;
    gap: 16px;
    height: 100vh;
    min-height: 100vh;
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.055) 0, rgba(255, 255, 255, 0) 210px),
        linear-gradient(180deg, #172033 0, var(--sidebar-bg) 72%);
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.28);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.25);
}

.sidebar-close,
.sidebar-toggle,
.sidebar-overlay {
    display: none;
}

.brand {
    min-height: 52px;
    margin-bottom: 2px;
    border: 1px solid var(--sidebar-border);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.045);
    padding: 8px;
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-color: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius);
    background: linear-gradient(135deg, #2f5fdb, #0f766e);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.26);
    font-size: 12px;
    letter-spacing: 0;
}

.brand-logo-frame-sidebar {
    width: 54px;
    height: 54px;
}

.brand-copy strong {
    font-size: 14px;
    letter-spacing: 0;
}

.nav {
    gap: 5px;
}

.nav a,
.nav-item {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 9px;
    min-height: 42px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: #d7deea;
    padding: 5px 9px;
    font-size: 13px;
    font-weight: 760;
    letter-spacing: 0;
}

.nav a::before {
    content: none;
}

.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    color: #b8c4d6;
    background: rgba(255, 255, 255, 0.055);
}

.nav-icon svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.85;
}

.nav-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav a:hover {
    border-color: var(--sidebar-border);
    color: #ffffff;
    background: rgba(255, 255, 255, 0.075);
}

.nav a:hover .nav-icon {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.nav a.active {
    border-color: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.09));
    box-shadow: inset 3px 0 0 var(--accent), 0 10px 24px rgba(0, 0, 0, 0.16);
}

.nav a.active .nav-icon {
    color: #ffffff;
    background: rgba(15, 118, 110, 0.32);
}

.topbar {
    min-height: var(--topbar-height);
    padding: 10px 24px;
    border-bottom: 1px solid rgba(216, 224, 234, 0.86);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: saturate(160%) blur(16px);
}

.topbar-start {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 10px;
}

.topbar-title strong {
    font-size: 17px;
    font-weight: 820;
    letter-spacing: 0;
}

.topbar-label {
    color: var(--muted);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 0.04em;
}

.topbar-actions {
    min-width: 0;
    gap: 8px;
}

.icon-button {
    width: 38px;
    height: 38px;
    border-color: var(--border);
    border-radius: var(--radius);
    color: var(--muted-strong);
    background: #ffffff;
    box-shadow: var(--shadow-xs);
    transition: transform var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
}

.icon-button:hover {
    border-color: rgba(47, 95, 219, 0.35);
    color: var(--primary);
    background: #fbfdff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.icon-button:active {
    transform: translateY(1px);
}

.hamburger-icon,
.hamburger-icon::before,
.hamburger-icon::after {
    display: block;
    width: 17px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.hamburger-icon {
    position: relative;
}

.hamburger-icon::before,
.hamburger-icon::after {
    content: "";
    position: absolute;
    left: 0;
}

.hamburger-icon::before {
    top: -6px;
}

.hamburger-icon::after {
    top: 6px;
}

.notification-dot {
    background: #d97706;
}

.notification-dropdown {
    border-color: rgba(216, 224, 234, 0.95);
    border-radius: var(--radius);
    box-shadow: var(--shadow-strong);
}

.notification-dropdown-header,
.table-toolbar,
.credentials-modal-footer,
.screenshot-modal-footer {
    background: linear-gradient(180deg, #ffffff, var(--surface-soft));
}

.notification-item {
    border-color: rgba(216, 224, 234, 0.78);
}

.notification-item:hover {
    background: var(--primary-soft);
}

.user-chip {
    min-width: 124px;
    border-color: var(--border);
    border-radius: var(--radius);
    background: #ffffff;
    box-shadow: var(--shadow-xs);
}

.content {
    width: 100%;
    max-width: 1480px;
    padding: 22px 24px 34px;
}

.page-header {
    align-items: center;
    margin-bottom: 15px;
    gap: 12px;
}

.page-header h1 {
    font-size: 25px;
    font-weight: 840;
    letter-spacing: 0;
}

.page-header p,
.panel p,
.auth-heading p {
    color: var(--muted);
}

.page-meta {
    min-height: 36px;
    border-color: var(--border);
    border-radius: var(--radius);
    background: #ffffff;
    box-shadow: var(--shadow-xs);
    font-size: 12px;
    font-weight: 760;
}

.panel {
    margin-bottom: 14px;
    border-color: rgba(216, 224, 234, 0.92);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow-sm);
}

.panel:hover {
    box-shadow: var(--shadow-sm);
}

.panel-table {
    overflow: hidden;
}

.section-heading h2,
.panel > h2,
.context-grid h3 {
    color: var(--text);
    font-weight: 820;
    letter-spacing: 0;
}

.section-heading p {
    max-width: 760px;
    font-size: 13px;
}

.button,
.button-ghost,
.action-link {
    border-radius: var(--radius-sm);
    font-weight: 780;
    letter-spacing: 0;
    box-shadow: var(--shadow-xs);
}

.button {
    min-height: 38px;
    padding: 8px 13px;
}

.button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.button-primary {
    border-color: #2f5fdb;
    background: linear-gradient(180deg, #3b6fee, #2f5fdb);
    box-shadow: 0 10px 18px rgba(47, 95, 219, 0.2);
}

.button-primary:hover {
    border-color: var(--primary-dark);
    background: linear-gradient(180deg, #345fd2, #2349aa);
}

.button-secondary {
    border-color: var(--border);
    color: var(--text-soft);
    background: #ffffff;
}

.button-important,
.button-warning {
    color: var(--warning-text);
    background: linear-gradient(180deg, #fffaf0, var(--warning-bg));
}

.button-danger {
    color: var(--danger-text);
    background: linear-gradient(180deg, #fff8f8, var(--danger-bg));
}

.button.disabled,
.button:disabled {
    box-shadow: none;
}

.action-link,
.button-ghost {
    min-height: 30px;
    border-color: #d4deeb;
    background: #ffffff;
}

.action-link:hover,
.button-ghost:hover {
    border-color: rgba(47, 95, 219, 0.4);
    background: var(--primary-soft);
}

label {
    color: var(--muted-strong);
    font-size: 11px;
    font-weight: 820;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

input,
select,
textarea {
    min-height: 39px;
    border-color: var(--border);
    border-radius: var(--radius-sm);
    background: #ffffff;
    box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.02);
}

select {
    appearance: none;
    padding-right: 32px;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--muted-strong) 50%),
        linear-gradient(135deg, var(--muted-strong) 50%, transparent 50%);
    background-position:
        calc(100% - 17px) 17px,
        calc(100% - 12px) 17px;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

input:hover,
select:hover,
textarea:hover {
    border-color: var(--border-strong);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(47, 95, 219, 0.13);
}

.filters-panel,
.audit-filters-panel {
    padding: 13px;
}

.filters-form {
    gap: 10px;
}

.filters-actions {
    gap: 7px;
}

.admin-users-create-panel {
    padding: 14px;
}

.admin-users-create-panel .section-heading {
    margin-bottom: 10px;
}

.admin-users-create-panel .admin-users-form-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.admin-users-create-panel .admin-users-form-actions {
    justify-content: flex-end;
    margin-top: -2px;
    padding-top: 2px;
}

.admin-users-edit-panel {
    max-width: 980px;
}

.admin-edit-summary {
    border-color: var(--border);
    border-radius: var(--radius);
}

.alert {
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
}

.badge {
    min-height: 23px;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.02em;
}

.badge-neutral {
    border-color: #d4dce7;
    color: #465366;
    background: #f4f7fa;
}

.badge-default,
.badge-status-active {
    border-color: var(--success-border);
    color: var(--success-text);
    background: var(--success-bg);
}

.badge-important {
    border-color: var(--warning-border);
    color: var(--warning-text);
    background: var(--warning-bg);
}

.badge-status-inactive {
    border-color: #d7dee7;
    color: #536173;
    background: #f5f7fa;
}

.table-toolbar {
    min-height: 50px;
    border-bottom-color: rgba(216, 224, 234, 0.9);
    padding: 12px 14px;
}

.table-toolbar > div:first-child,
.table-toolbar strong {
    font-weight: 820;
}

.table-scroll {
    scrollbar-width: thin;
    scrollbar-color: #c6d1df transparent;
}

.table {
    border-collapse: separate;
    border-spacing: 0;
}

.table th,
.table td {
    border-bottom-color: rgba(216, 224, 234, 0.78);
    padding: 10px 12px;
}

.table th {
    color: var(--muted-strong);
    background: #f8fafc;
    font-size: 11px;
    font-weight: 880;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.table tbody tr {
    transition: background-color var(--transition-fast), box-shadow var(--transition-fast);
}

.table tbody tr:hover {
    background: #fbfdff;
}

.activities-table tbody tr.row-important {
    background: #fffaf0;
}

.activities-table tbody tr.row-important:hover {
    background: #fff6df;
}

.details-chip,
.details-more,
.config-badge {
    border-color: #d7e0ea;
    border-radius: 999px;
    background: #f6f8fb;
}

.device-edit-button {
    border-radius: var(--radius-sm);
}

.device-inline-edit-form input {
    min-width: 0;
}

.screenshot-link {
    border-radius: var(--radius-sm);
}

.screenshot-link img {
    border-radius: var(--radius-sm);
}

.empty-state {
    color: var(--muted);
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.6), rgba(255, 255, 255, 0));
}

.empty-state.compact {
    border-color: #cfd8e6;
    background: #f8fafc;
}

.pagination {
    border-top-color: rgba(216, 224, 234, 0.85);
    background: #fbfcfe;
}

.quick-links a,
.period-filter a {
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-xs);
}

.period-filter a {
    min-height: 34px;
    background: #ffffff;
}

.period-filter a.active {
    border-color: var(--primary);
    background: linear-gradient(180deg, #3b6fee, #2f5fdb);
}

.dashboard-cards {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}

.statistics-cards {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.dashboard-card {
    min-height: 116px;
    border-color: rgba(216, 224, 234, 0.95);
    border-radius: var(--radius);
    background:
        linear-gradient(180deg, #ffffff, #fbfcfe);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.dashboard-card::after {
    top: auto;
    right: 14px;
    bottom: 12px;
    width: 34px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0.42;
}

.dashboard-card:hover {
    box-shadow: var(--shadow);
}

.dashboard-card span {
    font-size: 11px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.dashboard-card strong {
    font-size: 26px;
    font-weight: 840;
}

.statistics-bars,
.statistics-chart-table,
.details-block,
.evidence-url,
.current-context,
.credentials-domain-preview {
    border-radius: var(--radius);
}

.statistics-bars {
    background:
        linear-gradient(180deg, rgba(47, 95, 219, 0.045), rgba(15, 118, 110, 0.025)),
        #f8fafc;
}

.statistics-vbar-total {
    background: linear-gradient(180deg, #3b6fee, #2f5fdb);
}

.statistics-vbar-important {
    background: linear-gradient(180deg, #b7791f, #8a5209);
}

.statistics-hour-bars .statistics-vbar-total,
.statistics-hbar > span {
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.toast-region {
    z-index: 90;
}

.admin-toast {
    border-radius: var(--radius);
}

.detail-summary-card,
.context-panel {
    padding: 14px;
}

.summary-grid div {
    border-color: var(--border);
    border-radius: var(--radius);
    background: #f8fafc;
}

.evidence-shell {
    border-radius: var(--radius);
}

.evidence-side {
    background: #f8fafc;
}

.details-block {
    background: #101724;
}

.raw-details-panel summary {
    border-radius: var(--radius-sm);
}

.modal-backdrop {
    background: rgba(15, 23, 42, 0.68);
    backdrop-filter: blur(3px);
}

.modal {
    border-color: rgba(216, 224, 234, 0.92);
    border-radius: var(--radius);
    box-shadow: var(--shadow-strong);
}

.modal-header {
    background: #ffffff;
}

.credentials-modal-body {
    gap: 12px;
}

.credentials-error {
    border-radius: var(--radius);
}

.auth-body {
    background: #eef2f7;
}

.auth-page {
    position: relative;
    isolation: isolate;
    padding: 20px;
    background:
        linear-gradient(135deg, rgba(17, 24, 39, 0.04), rgba(47, 95, 219, 0.06)),
        linear-gradient(180deg, #f8fafc 0, #e9eef6 100%);
}

.auth-page::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(17, 24, 39, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(17, 24, 39, 0.035) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.64), transparent 78%);
}

.auth-card {
    max-width: 420px;
    border-color: rgba(216, 224, 234, 0.95);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.14);
    padding: 26px;
}

.auth-brand {
    border-bottom: 1px solid var(--border);
    margin-bottom: 18px;
    padding-bottom: 16px;
}

.auth-brand strong,
.auth-heading h1 {
    letter-spacing: 0;
}

.auth-heading h1 {
    font-size: 24px;
    font-weight: 840;
}

.auth-card .form {
    gap: 13px;
}

@media (max-width: 1280px) {
    .dashboard-cards,
    .statistics-cards {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .admin-users-create-panel .admin-users-form-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1023px) {
    body.sidebar-open {
        overflow: hidden;
    }

    .app-shell {
        display: block;
        min-height: 100vh;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 70;
        width: min(304px, calc(100vw - 42px));
        height: 100dvh;
        min-height: 100dvh;
        padding: 14px 12px;
        transform: translateX(-106%);
        transition: transform var(--transition);
        box-shadow: 24px 0 70px rgba(15, 23, 42, 0.32);
        will-change: transform;
    }

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

    .sidebar-overlay:not([hidden]) {
        position: fixed;
        inset: 0;
        z-index: 65;
        display: block;
        background: rgba(15, 23, 42, 0.56);
        opacity: 0;
        transition: opacity var(--transition);
        backdrop-filter: blur(2px);
    }

    body.sidebar-open .sidebar-overlay:not([hidden]) {
        opacity: 1;
    }

    .sidebar-close {
        position: absolute;
        top: 16px;
        right: 14px;
        display: inline-flex;
        border-color: rgba(255, 255, 255, 0.16);
        color: #ffffff;
        background: rgba(255, 255, 255, 0.08);
        box-shadow: none;
    }

    .sidebar-close:hover {
        color: #ffffff;
        background: rgba(255, 255, 255, 0.14);
    }

    .brand {
        padding-right: 48px;
    }

    .nav {
        grid-template-columns: 1fr;
    }

    .nav a {
        justify-content: start;
        min-height: 42px;
        text-align: left;
    }

    .sidebar-toggle {
        display: inline-flex;
        flex: 0 0 auto;
    }

    .topbar {
        position: sticky;
        min-height: 60px;
        padding: 9px 14px;
    }

    .content {
        max-width: none;
        padding: 18px 16px 28px;
    }

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

    .activities-table {
        min-width: 760px;
    }

    .devices-table {
        min-width: 940px;
    }
}

@media (max-width: 760px) {
    .topbar {
        align-items: center;
        flex-direction: row;
        gap: 10px;
    }

    .topbar-start {
        flex: 1 1 auto;
    }

    .topbar-actions {
        flex: 0 0 auto;
        flex-wrap: nowrap;
    }

    .page-header {
        align-items: stretch;
        flex-direction: column;
    }

    .page-meta {
        align-self: flex-start;
        white-space: normal;
    }

    .content {
        padding: 16px 12px 24px;
    }

    .filters-panel,
    .audit-filters-panel,
    .panel {
        padding: 13px;
    }

    .panel-table {
        padding: 0;
    }

    .admin-users-create-panel .admin-users-form-grid,
    .admin-users-edit-grid,
    .admin-password-grid,
    .filters-form,
    .devices-filters-form,
    .websites-filters-form,
    .audit-filters-form {
        grid-template-columns: 1fr;
    }

    .filter-search,
    .activities-filters-form .filter-search,
    .activities-filters-form .filters-actions,
    .devices-filters-form .filter-search,
    .audit-filter-search {
        grid-column: auto;
    }

    .filters-actions {
        align-items: stretch;
    }

    .dashboard-cards,
    .statistics-cards,
    .dashboard-grid-secondary,
    .statistics-timeline-grid,
    .detail-layout,
    .detail-grid,
    .evidence-layout {
        grid-template-columns: 1fr;
    }

    .dashboard-card {
        min-height: 104px;
    }

    .activities-table {
        min-width: 640px;
    }

    .activities-table .url-column,
    .activities-table .details-column {
        display: none;
    }

    .devices-table,
    .websites-table,
    .admins-table,
    .audit-table {
        min-width: 0;
    }

    .devices-table tbody,
    .websites-table tbody,
    .admins-table tbody,
    .audit-table tbody {
        gap: 9px;
        padding: 10px;
    }

    .devices-table tr,
    .websites-table tr,
    .admins-table tr,
    .audit-table tr {
        border-radius: var(--radius);
        box-shadow: var(--shadow-sm);
    }

    .devices-table td,
    .websites-table td,
    .admins-table td,
    .audit-table td {
        padding: 10px 11px;
    }

    .notification-dropdown {
        right: 0;
        left: auto;
    }
}

@media (max-width: 560px) {
    body {
        font-size: 13px;
    }

    .topbar-title strong {
        font-size: 15px;
    }

    .topbar-label,
    .user-chip {
        display: none;
    }

    .topbar-actions form {
        flex: 0 0 auto;
    }

    .topbar-actions .button-sm {
        min-height: 36px;
        padding: 7px 10px;
    }

    .page-header h1 {
        font-size: 22px;
    }

    .dashboard-cards,
    .statistics-cards,
    .summary-grid {
        grid-template-columns: 1fr;
    }

    .activities-table {
        min-width: 560px;
    }

    .activities-table th:nth-child(3),
    .activities-table td:nth-child(3) {
        display: none;
    }

    .credentials-modal-footer,
    .screenshot-modal-footer,
    .pagination,
    .table-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .filters-actions .button,
    .admin-users-form-actions .button,
    .credentials-modal-footer .button,
    .screenshot-modal-footer .button,
    .pagination .button {
        width: 100%;
    }

    .auth-page {
        padding: 14px;
    }

    .auth-card {
        padding: 22px;
    }
}

/* Global mobile responsive remediation */

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

img,
svg,
video,
canvas {
    max-width: 100%;
}

.main-area,
.content,
.panel,
.panel-table,
.table-scroll,
.topbar-start,
.topbar-title,
.modal {
    min-width: 0;
}

.mobile-muted {
    color: var(--muted);
}

.mobile-card-table td {
    overflow-wrap: anywhere;
}

@media (min-width: 721px) and (max-width: 1023px) {
    .filters-form,
    .activities-filters-form,
    .devices-filters-form,
    .websites-filters-form,
    .audit-filters-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .activities-filters-form .filter-search,
    .devices-filters-form .filter-search,
    .audit-filter-search {
        grid-column: span 2;
    }

    .filters-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
}

@media (max-width: 720px) {
    .content {
        padding: 14px 10px 22px;
    }

    .topbar {
        min-height: 58px;
        padding: 8px 10px;
        gap: 8px;
    }

    .topbar-start {
        flex: 1 1 auto;
        gap: 8px;
    }

    .topbar-actions {
        flex: 0 0 auto;
        gap: 7px;
    }

    .notification-dropdown {
        position: fixed;
        top: 66px;
        right: 10px;
        left: 10px;
        width: auto;
    }

    .filters-panel,
    .audit-filters-panel {
        padding: 11px;
    }

    .filters-form,
    .activities-filters-form,
    .devices-filters-form,
    .websites-filters-form,
    .audit-filters-form {
        grid-template-columns: 1fr !important;
        gap: 9px;
        align-items: stretch;
    }

    .filter-search,
    .activities-filters-form .filter-search,
    .activities-filters-form .filters-actions,
    .devices-filters-form .filter-search,
    .audit-filter-search {
        grid-column: auto;
    }

    .filters-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
        width: 100%;
        gap: 8px;
    }

    .filters-actions .button-primary {
        grid-column: 1 / -1;
        order: -1;
    }

    .filters-actions .button,
    .period-filter a,
    .button,
    .button-sm,
    .action-link,
    input,
    select,
    textarea {
        min-height: 42px;
    }

    .filters-actions .button {
        width: 100%;
    }

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

    .period-filter a {
        padding: 8px 10px;
    }

    .table-scroll {
        max-width: 100%;
        overflow-x: visible;
    }

    .mobile-card-table {
        display: block !important;
        width: 100%;
        min-width: 0 !important;
        border-collapse: separate;
        border-spacing: 0;
    }

    .mobile-card-table thead {
        display: none !important;
    }

    .mobile-card-table tbody {
        display: grid !important;
        gap: 10px;
        padding: 10px;
    }

    .mobile-card-table tr {
        display: grid !important;
        min-width: 0;
        overflow: hidden;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        background: #ffffff;
        box-shadow: var(--shadow-sm);
    }

    .mobile-card-table tbody tr:hover {
        background: #ffffff;
    }

    .mobile-card-table tbody tr.row-important {
        background: linear-gradient(180deg, #fffaf0, #ffffff);
    }

    .mobile-card-table td,
    .mobile-card-table tbody tr:last-child td {
        display: flex !important;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        width: 100%;
        min-width: 0 !important;
        max-width: none;
        border-bottom: 1px solid var(--border);
        padding: 10px 12px;
        text-align: right;
        white-space: normal !important;
    }

    .mobile-card-table tr td:last-child,
    .mobile-card-table tbody tr:last-child td:last-child {
        border-bottom: 0;
    }

    .mobile-card-table td::before {
        content: attr(data-label);
        flex: 0 0 min(42%, 140px);
        max-width: 42%;
        color: var(--muted);
        font-size: 10px;
        font-weight: 900;
        line-height: 1.25;
        text-align: left;
        text-transform: uppercase;
    }

    .mobile-card-table td:not([data-label])::before {
        display: none;
        content: "";
    }

    .mobile-card-table td > * {
        min-width: 0;
        max-width: 100%;
    }

    .mobile-card-table td.mobile-primary,
    .mobile-card-table td:first-child {
        display: grid !important;
        justify-content: stretch;
        gap: 4px;
        background: #f8fafc;
        text-align: left;
    }

    .mobile-card-table td.mobile-primary::before,
    .mobile-card-table td:first-child::before {
        display: none;
    }

    .mobile-card-table td.mobile-actions,
    .mobile-card-table td[data-label="Akcije"],
    .mobile-card-table td[data-label="Detalji"],
    .mobile-card-table td[data-label="Link"] {
        display: flex !important;
        justify-content: flex-start;
        flex-wrap: wrap;
        background: #ffffff;
        text-align: left;
    }

    .mobile-card-table td.mobile-actions::before,
    .mobile-card-table td[data-label="Akcije"]::before,
    .mobile-card-table td[data-label="Detalji"]::before,
    .mobile-card-table td[data-label="Link"]::before {
        display: none;
    }

    .mobile-card-table td.mobile-actions .action-link,
    .mobile-card-table td.mobile-actions .button,
    .mobile-card-table td[data-label="Akcije"] .action-link,
    .mobile-card-table td[data-label="Akcije"] .button,
    .mobile-card-table td[data-label="Detalji"] .action-link,
    .mobile-card-table td[data-label="Link"] .action-link {
        flex: 1 1 150px;
        min-height: 40px;
        padding: 9px 11px;
    }

    .mobile-card-table td.mobile-hide {
        display: none !important;
    }

    .mobile-card-table .screenshot-link {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        padding: 5px 7px;
    }

    .mobile-card-table .screenshot-link img,
    .mobile-card-table .screenshot-link.compact img {
        width: 52px;
        height: 36px;
    }

    .activities-table td[data-label="Vrijeme"] {
        order: 1;
    }

    .activities-table td[data-label="Akcija"] {
        order: 2;
    }

    .activities-table td[data-label="Uređaj"] {
        order: 3;
    }

    .activities-table td[data-label="Sajt"] {
        order: 4;
    }

    .activities-table td[data-label="Screenshot"] {
        order: 5;
    }

    .activities-table td.mobile-actions {
        order: 6;
    }

    .devices-table .column-status {
        order: 2;
    }

    .devices-table .column-activity-status {
        order: 3;
    }

    .devices-table .column-last-activity {
        order: 4;
    }

    .devices-table .column-log-count {
        order: 5;
    }

    .devices-table .column-actions {
        order: 6;
    }

    .websites-table td[data-label="Korisnik"] {
        order: 2;
    }

    .websites-table td[data-label="Lozinka"] {
        order: 3;
    }

    .websites-table .activity-cell {
        order: 4;
    }

    .websites-table td[data-label="Broj logova"] {
        order: 5;
    }

    .websites-table .website-actions-cell {
        order: 6;
    }

    .admins-table td[data-label="Korisničko ime"] {
        order: 2;
    }

    .admins-table td[data-label="Status"] {
        order: 3;
    }

    .admins-table td[data-label="Zadnja prijava"] {
        order: 4;
    }

    .admins-table .admin-actions-cell {
        order: 5;
    }

    .audit-table td[data-label="Administrator"] {
        order: 2;
    }

    .audit-table td[data-label="Akcija"] {
        order: 3;
    }

    .audit-table td[data-label="Opis"] {
        order: 4;
    }

    .audit-table td[data-label="IP"] {
        order: 5;
    }

    .dashboard-summary-count-cell,
    .statistics-metric-cell,
    .statistics-share-cell {
        align-items: stretch !important;
        flex-direction: column;
        text-align: left !important;
    }

    .dashboard-summary-count-cell::before,
    .statistics-metric-cell::before,
    .statistics-share-cell::before {
        flex: none;
        max-width: none;
    }

    .statistics-chart-table {
        max-height: none;
        overflow: visible;
        border: 0;
    }

    .statistics-bars {
        max-width: 100%;
        overflow-x: auto;
    }

    .statistics-hour-bars {
        min-width: 460px;
    }

    .statistics-share {
        grid-template-columns: minmax(0, 1fr) auto;
        width: 100%;
    }

    .device-inline-edit-form {
        width: 100%;
        max-width: none;
        grid-template-columns: 1fr;
    }

    .device-inline-edit-controls {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
    }

    .device-inline-edit-controls .button {
        width: 100%;
    }

    .website-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .website-actions .button,
    .website-actions .action-link {
        width: 100%;
    }

    .modal-backdrop {
        align-items: stretch;
        padding: 10px;
    }

    .modal {
        width: 100%;
        max-height: calc(100dvh - 20px);
    }

    .credentials-modal-body,
    .modal-header,
    .credentials-modal-footer,
    .screenshot-modal-footer {
        padding-inline: 12px;
    }
}

@media (max-width: 480px) {
    .content {
        padding-right: 8px;
        padding-left: 8px;
    }

    .topbar-brand-logo {
        display: none;
    }

    .topbar-actions .button-sm {
        min-width: 0;
        padding-inline: 9px;
    }

    .filters-actions,
    .period-filter,
    .website-actions,
    .device-actions,
    .device-inline-edit-controls {
        grid-template-columns: 1fr;
    }

    .mobile-card-table tbody {
        gap: 8px;
        padding: 8px;
    }

    .mobile-card-table td,
    .mobile-card-table tbody tr:last-child td {
        flex-direction: column;
        gap: 5px;
        padding: 9px 10px;
        text-align: left;
    }

    .mobile-card-table td::before {
        flex: none;
        max-width: none;
    }

    .mobile-card-table td.mobile-actions .action-link,
    .mobile-card-table td.mobile-actions .button,
    .mobile-card-table td[data-label="Akcije"] .action-link,
    .mobile-card-table td[data-label="Akcije"] .button,
    .mobile-card-table td[data-label="Detalji"] .action-link,
    .mobile-card-table td[data-label="Link"] .action-link {
        flex-basis: 100%;
    }

    .statistics-hour-bars {
        min-width: 400px;
    }
}

/* Final responsive UX corrections */

@media (min-width: 1024px) {
    .app-shell {
        display: block;
        min-height: 100vh;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: var(--sidebar-width);
        height: 100vh;
        height: 100dvh;
        min-height: 0;
        max-height: 100dvh;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .main-area {
        min-height: 100vh;
        margin-left: var(--sidebar-width);
    }
}

.filter-toggle-row {
    display: none;
}

.filter-toggle {
    display: none;
}

@media (min-width: 721px) {
    .filter-panel.is-collapsed {
        display: block;
    }
}

.dashboard-live-timeline-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px;
    padding: 12px;
    background: #fbfcfe;
}

.dashboard-live-timeline-item,
.dashboard-live-timeline-item:nth-child(3n),
.dashboard-live-timeline-item:last-child {
    min-height: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #ffffff;
    box-shadow: var(--shadow-xs);
}

.dashboard-live-timeline-item {
    padding: 12px;
}

.dashboard-live-timeline-item:hover {
    border-color: rgba(47, 95, 219, 0.34);
    box-shadow: var(--shadow-sm);
}

@media (max-width: 720px) {
    .filter-toggle-row {
        display: flex;
        margin: 0 0 10px;
    }

    .filter-toggle {
        display: inline-flex;
        width: 100%;
    }

    .filter-panel.is-collapsed {
        display: none;
    }

    .filters-panel,
    .audit-filters-panel,
    .dashboard-period-panel.filter-panel {
        margin-bottom: 12px;
    }

    .filters-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
        gap: 8px;
    }

    .filters-actions .button-primary {
        grid-column: 1 / -1;
        order: -1;
    }

    .filters-actions .button {
        width: 100%;
        min-height: 43px;
    }

    .table-scroll {
        overflow-x: visible;
    }

    .mobile-card-table {
        display: block !important;
        width: 100%;
        min-width: 0 !important;
    }

    .mobile-card-table thead {
        display: none !important;
    }

    .mobile-card-table tbody {
        display: grid !important;
        gap: 10px;
        padding: 10px;
    }

    .mobile-card-table tr {
        display: grid !important;
        min-width: 0;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        background: #ffffff;
        box-shadow: var(--shadow-sm);
        padding: 12px;
        gap: 10px;
        overflow: hidden;
    }

    .mobile-card-table td,
    .mobile-card-table tbody tr:last-child td {
        width: 100%;
        min-width: 0 !important;
        max-width: none;
        border: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        white-space: normal !important;
    }

    .mobile-card-table td {
        display: flex !important;
        align-items: flex-start;
        justify-content: space-between;
        gap: 10px;
        text-align: right;
    }

    .mobile-card-table td::before {
        flex: 0 0 min(42%, 132px);
        max-width: 42%;
        color: var(--muted);
        font-size: 10px;
        font-weight: 900;
        line-height: 1.25;
        text-align: left;
        text-transform: uppercase;
    }

    .mobile-card-table td.mobile-primary,
    .mobile-card-table td:first-child {
        display: grid !important;
        margin: -12px -12px 0;
        border-bottom: 1px solid var(--border) !important;
        background: linear-gradient(180deg, #f8fafc, #ffffff) !important;
        padding: 12px !important;
        text-align: left;
    }

    .mobile-card-table td.mobile-actions,
    .mobile-card-table td[data-label="Akcije"],
    .mobile-card-table td[data-label="Detalji"],
    .mobile-card-table td[data-label="Link"] {
        display: flex !important;
        align-items: stretch;
        flex-direction: row !important;
        justify-content: stretch;
        flex-wrap: wrap;
        padding-top: 2px !important;
        text-align: left;
    }

    .mobile-card-table td.mobile-actions::before,
    .mobile-card-table td[data-label="Akcije"]::before,
    .mobile-card-table td[data-label="Detalji"]::before,
    .mobile-card-table td[data-label="Link"]::before {
        display: none;
    }

    .mobile-card-table td.mobile-actions .action-link,
    .mobile-card-table td.mobile-actions .button,
    .mobile-card-table td[data-label="Akcije"] .action-link,
    .mobile-card-table td[data-label="Akcije"] .button,
    .mobile-card-table td[data-label="Detalji"] .action-link,
    .mobile-card-table td[data-label="Link"] .action-link {
        flex: 1 1 150px;
        min-width: 0;
        min-height: 42px;
        padding: 10px 12px;
    }

    .mobile-card-table td.mobile-hide {
        display: none !important;
    }

    .activities-table.mobile-card-table tr,
    .dashboard-table.mobile-card-table:not(.summary-table) tr {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "time action"
            "device device"
            "site screenshot"
            "actions actions";
        align-items: start;
    }

    .activities-table.mobile-card-table td,
    .dashboard-table.mobile-card-table:not(.summary-table) td {
        margin: 0;
        border: 0 !important;
        background: transparent !important;
        padding: 0 !important;
    }

    .activities-table.mobile-card-table td[data-label="Vrijeme"],
    .dashboard-table.mobile-card-table:not(.summary-table) td[data-label="Vrijeme"] {
        grid-area: time;
        display: block !important;
        color: var(--text);
        font-size: 13px;
        font-weight: 850;
        line-height: 1.3;
        text-align: left;
    }

    .activities-table.mobile-card-table td[data-label="Vrijeme"]::before,
    .dashboard-table.mobile-card-table:not(.summary-table) td[data-label="Vrijeme"]::before,
    .activities-table.mobile-card-table td[data-label="Akcija"]::before,
    .dashboard-table.mobile-card-table:not(.summary-table) td[data-label="Akcija"]::before {
        display: none;
    }

    .activities-table.mobile-card-table td[data-label="Akcija"],
    .dashboard-table.mobile-card-table:not(.summary-table) td[data-label="Akcija"] {
        grid-area: action;
        justify-content: flex-end;
        text-align: right;
    }

    .activities-table.mobile-card-table td[data-label="Uređaj"],
    .dashboard-table.mobile-card-table:not(.summary-table) td[data-label="Uređaj"] {
        grid-area: device;
    }

    .activities-table.mobile-card-table td[data-label="Sajt"],
    .dashboard-table.mobile-card-table:not(.summary-table) td[data-label="Sajt"] {
        grid-area: site;
    }

    .activities-table.mobile-card-table td[data-label="Screenshot"],
    .dashboard-table.mobile-card-table:not(.summary-table) td[data-label="Screenshot"] {
        grid-area: screenshot;
    }

    .activities-table.mobile-card-table td[data-label="Uređaj"],
    .activities-table.mobile-card-table td[data-label="Sajt"],
    .activities-table.mobile-card-table td[data-label="Screenshot"],
    .dashboard-table.mobile-card-table:not(.summary-table) td[data-label="Uređaj"],
    .dashboard-table.mobile-card-table:not(.summary-table) td[data-label="Sajt"],
    .dashboard-table.mobile-card-table:not(.summary-table) td[data-label="Screenshot"] {
        display: grid !important;
        justify-content: stretch;
        gap: 4px;
        color: var(--text-soft);
        text-align: left;
    }

    .activities-table.mobile-card-table td[data-label="Uređaj"]::before,
    .activities-table.mobile-card-table td[data-label="Sajt"]::before,
    .activities-table.mobile-card-table td[data-label="Screenshot"]::before,
    .dashboard-table.mobile-card-table:not(.summary-table) td[data-label="Uređaj"]::before,
    .dashboard-table.mobile-card-table:not(.summary-table) td[data-label="Sajt"]::before,
    .dashboard-table.mobile-card-table:not(.summary-table) td[data-label="Screenshot"]::before {
        flex: none;
        max-width: none;
    }

    .activities-table.mobile-card-table td.mobile-actions,
    .dashboard-table.mobile-card-table:not(.summary-table) td.mobile-actions {
        display: grid !important;
        grid-area: actions;
        grid-template-columns: 1fr;
        justify-self: stretch;
        width: 100% !important;
        border-top: 1px solid var(--border) !important;
        padding-top: 10px !important;
    }

    .activities-table.mobile-card-table td.mobile-actions .action-link,
    .dashboard-table.mobile-card-table:not(.summary-table) td.mobile-actions .action-link {
        flex: 1 1 100%;
        width: 100% !important;
        max-width: none;
        border-color: rgba(47, 95, 219, 0.28);
        background: var(--primary-soft);
    }

    .activities-table.mobile-card-table .screenshot-link img,
    .dashboard-table.mobile-card-table:not(.summary-table) .screenshot-link img {
        display: none;
    }

    .activities-table.mobile-card-table .screenshot-link,
    .dashboard-table.mobile-card-table:not(.summary-table) .screenshot-link {
        display: inline-flex;
        flex-direction: row;
        justify-content: center;
        min-height: 30px;
        border-color: var(--border);
        background: var(--surface-soft);
        padding: 5px 8px;
    }

    .devices-table.mobile-card-table tr {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "device status"
            "activity activity"
            "last last"
            "website website"
            "logs logs"
            "actions actions";
    }

    .devices-table.mobile-card-table .device-name-cell {
        grid-area: device;
        margin: 0;
        border: 0 !important;
        background: transparent !important;
        padding: 0 !important;
    }

    .devices-table.mobile-card-table .column-status {
        grid-area: status;
        align-self: start;
        justify-content: flex-end;
    }

    .devices-table.mobile-card-table .column-status::before {
        display: none;
    }

    .devices-table.mobile-card-table .column-activity-status {
        grid-area: activity;
    }

    .devices-table.mobile-card-table .column-last-activity {
        grid-area: last;
    }

    .devices-table.mobile-card-table .column-website {
        grid-area: website;
    }

    .devices-table.mobile-card-table .column-log-count {
        grid-area: logs;
    }

    .devices-table.mobile-card-table .column-actions {
        grid-area: actions;
        border-top: 1px solid var(--border) !important;
        padding-top: 10px !important;
    }

    .devices-table.mobile-card-table .device-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .devices-table.mobile-card-table .device-status-form,
    .devices-table.mobile-card-table .device-status-form .button,
    .devices-table.mobile-card-table .device-actions .action-link {
        width: 100%;
    }

    .device-name-line {
        justify-content: space-between;
    }

    .websites-table.mobile-card-table tr {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-areas:
            "domain domain"
            "user password"
            "last last"
            "logs important"
            "actions actions";
    }

    .websites-table.mobile-card-table .website-domain-cell {
        grid-area: domain;
    }

    .websites-table.mobile-card-table td[data-label="Korisnik"] {
        grid-area: user;
    }

    .websites-table.mobile-card-table td[data-label="Lozinka"] {
        grid-area: password;
    }

    .websites-table.mobile-card-table .activity-cell {
        grid-area: last;
    }

    .websites-table.mobile-card-table td[data-label="Broj logova"] {
        grid-area: logs;
    }

    .websites-table.mobile-card-table td[data-label="Važne akcije"] {
        grid-area: important;
    }

    .websites-table.mobile-card-table .website-actions-cell {
        grid-area: actions;
        border-top: 1px solid var(--border) !important;
        padding-top: 10px !important;
    }

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

    .website-actions .website-credentials-button {
        order: 1;
    }

    .website-actions .action-link {
        order: 2;
    }

    .admins-table.mobile-card-table tr {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "name status"
            "username username"
            "login login"
            "actions actions";
    }

    .admins-table.mobile-card-table .admin-account-cell {
        grid-area: name;
        margin: 0;
        border: 0 !important;
        background: transparent !important;
        padding: 0 !important;
    }

    .admins-table.mobile-card-table td[data-label="Status"] {
        grid-area: status;
        justify-content: flex-end;
    }

    .admins-table.mobile-card-table td[data-label="Status"]::before {
        display: none;
    }

    .admins-table.mobile-card-table td[data-label="Korisničko ime"] {
        grid-area: username;
    }

    .admins-table.mobile-card-table td[data-label="Zadnja prijava"] {
        grid-area: login;
    }

    .admins-table.mobile-card-table .admin-actions-cell {
        grid-area: actions;
        border-top: 1px solid var(--border) !important;
        padding-top: 10px !important;
    }

    .audit-table.mobile-card-table tr {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "audit-time audit-action"
            "audit-admin audit-admin"
            "audit-desc audit-desc"
            "audit-ip audit-ip";
    }

    .audit-table.mobile-card-table td[data-label="Vrijeme"] {
        grid-area: audit-time;
        margin: 0;
        border: 0 !important;
        background: transparent !important;
        padding: 0 !important;
        color: var(--text);
        font-weight: 850;
    }

    .audit-table.mobile-card-table td[data-label="Vrijeme"]::before,
    .audit-table.mobile-card-table td[data-label="Akcija"]::before {
        display: none;
    }

    .audit-table.mobile-card-table .audit-action-cell {
        grid-area: audit-action;
        justify-content: flex-end;
    }

    .audit-table.mobile-card-table .audit-admin-cell {
        grid-area: audit-admin;
    }

    .audit-table.mobile-card-table .audit-description-cell {
        grid-area: audit-desc;
    }

    .audit-table.mobile-card-table td[data-label="IP"] {
        grid-area: audit-ip;
        color: var(--muted);
    }

    .dashboard-live-timeline-list {
        grid-template-columns: 1fr;
        gap: 9px;
        padding: 10px;
    }

    .dashboard-live-timeline-item {
        min-height: 0;
    }

    .statistics-timeline-grid,
    .dashboard-grid-secondary {
        grid-template-columns: 1fr;
    }

    .statistics-bars {
        overflow-x: visible;
        padding-inline: 6px;
    }

    .statistics-day-bars {
        grid-auto-columns: minmax(18px, 1fr);
        gap: 5px;
    }

    .statistics-hour-bars {
        min-width: 0;
        grid-template-columns: repeat(24, minmax(7px, 1fr));
        gap: 2px;
    }

    .statistics-vbar {
        grid-template-rows: 96px auto;
        font-size: 9px;
    }

    .statistics-vbar-track {
        height: 96px;
    }
}

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

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
    }
}
