:root {
    color-scheme: dark;
    --bg: #070711;
    --bg-soft: #101126;
    --card: rgba(14, 16, 34, 0.78);
    --card-strong: rgba(18, 22, 46, 0.9);
    --line: rgba(162, 104, 255, 0.18);
    --line-strong: rgba(166, 117, 255, 0.34);
    --text: #f8f7ff;
    --muted: #b8afd9;
    --muted-strong: #d7d2f1;
    --primary: #8a2bff;
    --primary-soft: #6127d7;
    --aqua: #63d5ff;
    --danger: #ff8aa5;
    --success: #84f4cf;
    --shadow: 0 30px 80px rgba(0, 0, 0, 0.42);
    --brand-feature-width: 540px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background:
        radial-gradient(circle at 12% 10%, rgba(120, 77, 255, 0.28), transparent 22%),
        radial-gradient(circle at 84% 18%, rgba(98, 54, 255, 0.22), transparent 20%),
        radial-gradient(circle at 70% 76%, rgba(60, 138, 255, 0.18), transparent 20%),
        linear-gradient(180deg, #05050c 0%, #0b0c1a 50%, #080812 100%);
    color: var(--text);
    overflow-x: hidden;
}

body[data-portal-view="login"],
body[data-portal-view="register"] {
    height: 100vh;
    overflow: hidden;
}

.page-noise {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.06), transparent 18%),
        radial-gradient(circle at 80% 30%, rgba(255, 255, 255, 0.05), transparent 16%),
        radial-gradient(circle at 14% 82%, rgba(255, 255, 255, 0.04), transparent 12%);
    filter: blur(46px);
    opacity: 0.9;
}

.shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.06fr) minmax(360px, 430px);
    gap: 22px;
    padding: 14px;
    max-width: 1540px;
    margin: 0 auto;
}

.brand-panel,
.panel-card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    box-shadow: var(--shadow);
}

.brand-panel {
    border-radius: 34px;
    background:
        radial-gradient(circle at 18% 22%, rgba(136, 83, 255, 0.18), transparent 24%),
        radial-gradient(circle at 74% 36%, rgba(99, 213, 255, 0.14), transparent 18%),
        linear-gradient(180deg, rgba(31, 18, 68, 0.94) 0%, rgba(16, 14, 37, 0.96) 54%, rgba(101, 46, 206, 0.96) 100%);
    padding: 18px 22px;
    display: flex;
    align-items: stretch;
}

.brand-watermark {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(20, 10, 48, 0.84) 0%, rgba(24, 15, 58, 0.72) 36%, rgba(20, 13, 48, 0.62) 62%, rgba(20, 13, 48, 0.74) 100%),
        url("/static/portal/left-panel-watermark.png") center right / cover no-repeat;
    opacity: 0.18;
    mix-blend-mode: screen;
    pointer-events: none;
    filter: saturate(0.9) contrast(1.05);
}

.brand-orb {
    position: absolute;
    border-radius: 999px;
    filter: blur(8px);
    opacity: 0.8;
}

.brand-orb-left {
    width: 420px;
    height: 420px;
    left: -120px;
    bottom: -150px;
    background: radial-gradient(circle, rgba(145, 79, 255, 0.78), rgba(145, 79, 255, 0));
}

.brand-orb-right {
    width: 320px;
    height: 320px;
    right: -80px;
    top: 20%;
    background: radial-gradient(circle, rgba(103, 211, 255, 0.42), rgba(103, 211, 255, 0));
}

.brand-stack {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(100%, 700px);
}

.brand-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    width: 100%;
}

.brand-stage {
    position: relative;
    min-height: 156px;
    display: flex;
    align-items: center;
    margin: 4px 0 10px;
    width: 100%;
    max-width: var(--brand-feature-width);
}

.brand-stage-glow {
    position: absolute;
    inset: 0;
    border-radius: 36px;
    background:
        radial-gradient(circle at 15% 40%, rgba(150, 88, 255, 0.26), transparent 32%),
        radial-gradient(circle at 84% 58%, rgba(99, 213, 255, 0.18), transparent 24%),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
    border: 1px solid rgba(162, 104, 255, 0.14);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 20px 50px rgba(9, 8, 24, 0.2);
}

.brand-badge,
.brand-lang,
.panel-chip,
.preview-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid rgba(172, 122, 255, 0.35);
    background: rgba(63, 20, 110, 0.5);
    color: var(--muted-strong);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.brand-badge,
.brand-lang {
    min-width: 150px;
}

.brand-lang {
    margin-left: auto;
}

.brand-logo {
    width: min(100%, 300px);
    height: auto;
    object-fit: contain;
    margin-bottom: 10px;
    filter:
        drop-shadow(0 0 24px rgba(255, 255, 255, 0.08))
        drop-shadow(0 0 48px rgba(143, 76, 255, 0.12));
    mix-blend-mode: screen;
    opacity: 0.96;
    position: relative;
    z-index: 1;
}

.brand-signal-card {
    position: absolute;
    z-index: 1;
    min-width: 170px;
    padding: 12px 14px;
    border-radius: 18px;
    border: 1px solid rgba(173, 129, 255, 0.2);
    background: linear-gradient(180deg, rgba(24, 21, 54, 0.82), rgba(19, 17, 41, 0.74));
    box-shadow:
        0 22px 46px rgba(8, 8, 22, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.brand-signal-card-top {
    top: 6px;
    right: 58px;
}

.brand-signal-card-side {
    right: 0;
    bottom: 18px;
}

.brand-signal-label {
    display: block;
    margin-bottom: 4px;
    color: #cdbdf4;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.brand-signal-card strong {
    font-size: 14px;
    line-height: 1.3;
}

.eyebrow,
.panel-kicker {
    margin: 0 0 6px;
    color: #d3c9ff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.brand-stack h1 {
    margin: 0;
    max-width: 540px;
    font-size: clamp(24px, 2.45vw, 40px);
    line-height: 1.02;
    font-weight: 700;
    letter-spacing: -0.03em;
    text-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.brand-subtitle {
    margin: 10px 0 14px;
    max-width: 520px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.brand-insight-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 14px;
}

.brand-insight-pill {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid rgba(173, 129, 255, 0.18);
    background: rgba(255, 255, 255, 0.04);
    color: #ece7ff;
    font-size: 12px;
    font-weight: 600;
}

.brand-card,
.brand-preview {
    border-radius: 26px;
    border: 1px solid rgba(162, 104, 255, 0.15);
    background: linear-gradient(180deg, rgba(18, 23, 53, 0.7), rgba(17, 14, 34, 0.76));
}

.brand-card {
    padding: 16px 18px;
    margin-bottom: 14px;
    width: 100%;
    max-width: var(--brand-feature-width);
    min-height: 156px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: linear-gradient(180deg, rgba(22, 25, 60, 0.82), rgba(24, 17, 49, 0.88));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 18px 40px rgba(0, 0, 0, 0.18);
}

.brand-card-title {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 700;
}

.brand-points {
    display: grid;
    gap: 10px;
}

.brand-points p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-point-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    flex: 0 0 auto;
    background: linear-gradient(180deg, rgba(148, 101, 255, 1), rgba(99, 213, 255, 0.9));
    box-shadow: 0 0 0 5px rgba(118, 68, 224, 0.12);
}

.brand-preview {
    margin-top: auto;
    padding: 14px 16px;
    max-width: 500px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    background: linear-gradient(180deg, rgba(30, 28, 82, 0.78), rgba(53, 30, 114, 0.72));
}

.preview-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

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

.preview-kicker {
    color: #cdbdf4;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.preview-title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.2;
}

.preview-pill {
    min-height: 28px;
    padding: 6px 12px;
    background: rgba(89, 44, 181, 0.38);
    font-size: 11px;
    box-shadow: 0 8px 18px rgba(98, 54, 255, 0.14);
}

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

.preview-metric {
    border-radius: 18px;
    padding: 14px;
    background: linear-gradient(135deg, rgba(47, 63, 131, 0.96), rgba(110, 56, 214, 0.72));
    border: 1px solid rgba(178, 148, 255, 0.2);
    box-shadow: 0 14px 28px rgba(28, 18, 65, 0.26);
}

.preview-metric span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 11px;
}

.preview-metric strong {
    font-size: 22px;
    letter-spacing: -0.03em;
}

.preview-rail {
    position: relative;
    height: 8px;
    margin-top: 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.preview-rail-fill {
    width: 68%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(107, 82, 255, 0.95), rgba(99, 213, 255, 0.88));
    box-shadow: 0 0 18px rgba(111, 170, 255, 0.28);
}

.content-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-right: 0;
}

.panel-card {
    width: min(100%, 420px);
    max-height: calc(100vh - 28px);
    border-radius: 30px;
    background:
        linear-gradient(180deg, rgba(13, 15, 31, 0.96), rgba(10, 11, 25, 0.92)),
        linear-gradient(145deg, rgba(139, 52, 255, 0.1), rgba(90, 225, 255, 0.06));
    padding: 18px;
    overflow: auto;
}

.panel-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top right, rgba(128, 51, 255, 0.14), transparent 32%),
        radial-gradient(circle at bottom left, rgba(99, 213, 255, 0.1), transparent 28%);
    pointer-events: none;
}

.panel-view {
    position: relative;
    z-index: 1;
    display: none;
}

.panel-view.is-active {
    display: block;
}

.dashboard-screen {
    display: none;
}

.dashboard-screen.is-active {
    display: block;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.compact-head {
    margin-bottom: 10px;
}

h2,
h3 {
    margin: 0;
    font-weight: 700;
    letter-spacing: -0.03em;
}

h2 {
    font-size: 20px;
}

h3 {
    font-size: 20px;
}

.stack-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.stack-form.compact {
    gap: 14px;
}

label span {
    display: block;
    margin-bottom: 6px;
    color: #f1efff;
    font-size: 13px;
    font-weight: 600;
}

input,
textarea {
    width: 100%;
    border: 1px solid rgba(160, 118, 255, 0.2);
    border-radius: 16px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font: inherit;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

input {
    height: 42px;
}

textarea {
    min-height: 118px;
    resize: vertical;
    line-height: 1.55;
}

input::placeholder,
textarea::placeholder {
    color: #8d89a6;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: rgba(144, 83, 255, 0.9);
    box-shadow: 0 0 0 4px rgba(138, 43, 255, 0.12);
}

.check-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    margin-top: -2px;
}

.check-row input {
    width: 18px;
    height: 18px;
    border-radius: 6px;
}

.form-link-row {
    display: flex;
    justify-content: flex-end;
    margin-top: -8px;
}

.text-link-btn {
    border: 0;
    background: transparent;
    color: #d9ceff;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    padding: 4px 0;
    cursor: pointer;
    text-decoration: none;
}

.text-link-btn:hover,
.text-link-btn:focus-visible {
    color: #ffffff;
    outline: none;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.last-login-card,
.verify-card,
.info-card,
.table-card {
    border: 1px solid rgba(160, 118, 255, 0.15);
    border-radius: 20px;
    padding: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.025));
}

.verify-card {
    margin-top: 18px;
}

.password-reset-card {
    margin-top: 16px;
}

.password-reset-card .muted-text {
    margin: 0 0 14px;
}

.last-login-title,
.info-title {
    margin-bottom: 4px;
    color: #f3efff;
    font-weight: 700;
}

.last-login-text,
.muted-text {
    color: var(--muted);
    line-height: 1.55;
    font-size: 13px;
}

.action-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.action-row.right {
    justify-content: flex-end;
}

.primary-btn,
.secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border-radius: 16px;
    border: 1px solid transparent;
    padding: 12px 18px;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

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

.primary-btn {
    background: linear-gradient(90deg, #651fff 0%, #9334ff 52%, #b15dff 100%);
    color: #fff;
    box-shadow: 0 16px 34px rgba(128, 39, 255, 0.28);
}

.secondary-btn {
    border-color: rgba(162, 104, 255, 0.26);
    background: rgba(255, 255, 255, 0.045);
    color: var(--text);
}

.primary-btn:disabled,
.secondary-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.status-text {
    min-height: 20px;
    margin: 0;
    color: var(--danger);
    white-space: pre-wrap;
    line-height: 1.55;
}

.status-text.success {
    color: var(--success);
}

.hidden {
    display: none;
}

.dashboard-header,
.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 20px 0;
}

.info-card p {
    margin: 0 0 10px;
    color: var(--muted);
}

.info-card strong {
    color: #f4f0ff;
}

.table-wrap {
    overflow: auto;
}

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

th,
td {
    text-align: left;
    padding: 14px 10px;
    border-bottom: 1px solid rgba(160, 118, 255, 0.12);
    vertical-align: top;
}

th {
    color: #c8c1eb;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

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

.ticket-count {
    color: var(--muted);
    font-size: 13px;
}

.empty-state {
    text-align: center;
    color: var(--muted);
}

.app-dashboard {
    min-height: calc(100vh - 24px);
    display: grid;
    grid-template-columns: 252px minmax(0, 1fr);
    gap: 20px;
    padding: 12px;
    border-radius: 28px;
    background:
        radial-gradient(circle at 20% 10%, rgba(124, 86, 255, 0.16), transparent 25%),
        radial-gradient(circle at 80% 0%, rgba(99, 213, 255, 0.14), transparent 22%),
        linear-gradient(180deg, rgba(26, 34, 74, 0.96), rgba(17, 22, 51, 0.96) 55%, rgba(18, 17, 39, 0.98));
    border: 1px solid rgba(151, 132, 255, 0.14);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.dashboard-sidebar,
.dashboard-hero,
.analytics-card,
.metric-card {
    border: 1px solid rgba(146, 127, 255, 0.14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.dashboard-sidebar {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 18px 16px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(22, 27, 61, 0.96), rgba(15, 19, 43, 0.98));
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 4px 2px 10px;
}

.sidebar-logo-wrap {
    width: auto;
    height: auto;
    display: grid;
    place-items: center;
    background: transparent;
    flex: 0 0 auto;
}

.sidebar-logo {
    width: 74px;
    height: auto;
    display: block;
    filter:
        brightness(1.22)
        drop-shadow(0 8px 20px rgba(0, 0, 0, 0.22));
}

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

.sidebar-brand-copy strong {
    font-size: 20px;
    line-height: 1.05;
}

.sidebar-brand-copy span {
    color: var(--muted);
    font-size: 17px;
    margin-top: 4px;
}

.sidebar-group {
    display: grid;
    gap: 10px;
}

.sidebar-title {
    font-weight: 700;
    color: #f0ecff;
}

.nav-link {
    min-height: 44px;
    border-radius: 14px;
    border: 1px solid rgba(135, 125, 255, 0.16);
    background: rgba(255, 255, 255, 0.03);
    color: #e7e2ff;
    text-align: left;
    padding: 10px 14px;
    font: inherit;
    cursor: pointer;
}

.nav-link.is-active {
    background: linear-gradient(90deg, rgba(123, 112, 255, 0.22), rgba(99, 213, 255, 0.12));
}

.dashboard-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.dashboard-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-radius: 22px;
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.08), transparent 36%),
        linear-gradient(90deg, rgba(83, 142, 255, 0.32), rgba(111, 231, 255, 0.28));
}

.hero-title {
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.hero-subtitle {
    color: #caeaff;
    margin-top: 4px;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hero-icon,
.hero-refresh {
    min-width: 96px;
    min-height: 42px;
    border-radius: 12px;
    border: 1px solid rgba(73, 93, 152, 0.28);
    background: rgba(24, 36, 73, 0.88);
    color: #f6f2ff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font: inherit;
}

.hero-icon-btn {
    cursor: pointer;
    font: inherit;
}

.hero-icon-btn:hover,
.hero-icon-btn:focus-visible,
.hero-refresh:hover,
.hero-refresh:focus-visible,
.portal-modal-close:hover,
.portal-modal-close:focus-visible,
.modal-tab-btn:focus-visible {
    outline: none;
    border-color: rgba(154, 183, 255, 0.34);
    box-shadow: 0 0 0 3px rgba(117, 87, 255, 0.16);
}

.hero-refresh {
    padding: 0 18px;
    cursor: pointer;
}

.hero-icon {
    padding: 0 18px;
}

.hero-logout {
    min-width: 96px;
    min-height: 42px;
    padding: 0 18px;
    border-radius: 12px;
    border: 1px solid rgba(73, 93, 152, 0.28);
    background: rgba(24, 36, 73, 0.88);
    color: #ff8da3;
    font: inherit;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.hero-logout:hover,
.hero-logout:focus-visible {
    outline: none;
    transform: translateY(-1px);
    border-color: rgba(154, 183, 255, 0.34);
    background: rgba(31, 45, 88, 0.96);
    box-shadow: 0 0 0 3px rgba(255, 123, 160, 0.12);
}

.hero-bell-wrap {
    position: relative;
}

.hero-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ef5b74;
    color: #fff;
    font-size: 11px;
    display: grid;
    place-items: center;
}

.overview-panel {
    display: grid;
    gap: 14px;
}

.overview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.overview-head h3,
.analytics-card h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

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

.metric-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.metric-card {
    border-radius: 18px;
    padding: 16px;
    background: linear-gradient(180deg, rgba(30, 35, 71, 0.95), rgba(18, 22, 45, 0.95));
}

.interactive-analytics-card {
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.interactive-analytics-card:hover,
.interactive-analytics-card:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(154, 183, 255, 0.34);
    box-shadow:
        inset 0 -2px 0 rgba(255, 255, 255, 0.18),
        0 16px 34px rgba(18, 28, 61, 0.24);
    outline: none;
}

.metric-card span {
    display: block;
    color: #d2cff0;
    font-size: 13px;
    margin-bottom: 8px;
}

.metric-card strong {
    font-size: 46px;
    line-height: 1;
    letter-spacing: -0.04em;
}

.accent-blue { box-shadow: inset 0 -2px 0 rgba(99, 213, 255, 0.7); }
.accent-cyan { box-shadow: inset 0 -2px 0 rgba(106, 232, 255, 0.7); }
.accent-green { box-shadow: inset 0 -2px 0 rgba(102, 220, 145, 0.7); }
.accent-purple { box-shadow: inset 0 -2px 0 rgba(192, 108, 255, 0.7); }
.accent-violet { box-shadow: inset 0 -2px 0 rgba(162, 121, 255, 0.7); }
.accent-pink { box-shadow: inset 0 -2px 0 rgba(255, 142, 164, 0.7); }

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

.analytics-card {
    border-radius: 20px;
    padding: 18px;
    background: linear-gradient(180deg, rgba(26, 31, 64, 0.96), rgba(18, 21, 44, 0.98));
}

.state-banner {
    border-radius: 18px;
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.55;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.05);
}

.state-banner.success {
    color: #d8ffed;
    background: linear-gradient(90deg, rgba(45, 125, 91, 0.42), rgba(68, 177, 119, 0.24));
    border-color: rgba(132, 244, 207, 0.36);
}

.state-banner.warning {
    color: #fff0bd;
    background: linear-gradient(90deg, rgba(151, 90, 24, 0.42), rgba(245, 158, 11, 0.18));
    border-color: rgba(255, 211, 121, 0.32);
}

.state-banner.danger {
    color: #ffd6de;
    background: linear-gradient(90deg, rgba(130, 28, 48, 0.42), rgba(229, 62, 100, 0.18));
    border-color: rgba(255, 138, 165, 0.28);
}

.status-distribution {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.status-row {
    display: grid;
    grid-template-columns: 108px 1fr 24px;
    gap: 12px;
    align-items: center;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 14px;
    transition: background 0.18s ease, transform 0.18s ease;
}

.status-row:hover,
.status-row:focus-visible {
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(-1px);
    outline: none;
}

.status-label,
.status-value {
    font-size: 13px;
    color: #e4defe;
}

.status-bar-track {
    height: 14px;
    border-radius: 999px;
    background: rgba(164, 165, 224, 0.16);
    overflow: hidden;
}

.status-bar {
    height: 100%;
    border-radius: 999px;
}

.status-open { background: linear-gradient(90deg, #7bbcff, #5fd8ff); }
.status-progress { background: linear-gradient(90deg, #ffbe3d, #ff9b26); }
.status-hold { background: linear-gradient(90deg, #a66bff, #d184ff); }
.status-closed { background: linear-gradient(90deg, #5ed08c, #83ec9a); }

.monthly-bars {
    height: 220px;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
    align-items: end;
    margin-top: 16px;
}

.month-col {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: end;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    border-radius: 14px;
    padding: 10px 6px;
    transition: background 0.18s ease, transform 0.18s ease;
}

.month-col:hover,
.month-col:focus-visible {
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(-1px);
    outline: none;
}

.month-bar-wrap {
    width: 100%;
    height: 170px;
    display: flex;
    align-items: end;
    justify-content: center;
}

.month-bar {
    width: 34px;
    min-height: 12px;
    border-radius: 10px 10px 4px 4px;
    background: linear-gradient(180deg, rgba(143, 203, 255, 1), rgba(85, 151, 255, 0.72));
    box-shadow: 0 12px 24px rgba(68, 127, 255, 0.22);
}

.month-label,
.month-value {
    color: var(--muted);
    font-size: 12px;
}

.wide-chart {
    grid-column: 1 / -1;
}

.account-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 14px;
}

.account-strip div {
    border-radius: 16px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.03);
}

.account-strip span {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 8px;
}

.account-strip strong {
    font-size: 15px;
    color: #fff;
}

.tickets-card {
    grid-column: 1 / -1;
}

.dashboard-table-wrap {
    max-height: 260px;
}

.dashboard-section {
    display: none;
}

.dashboard-section.is-active {
    display: block;
}

.account-strip-wide {
    margin-bottom: 18px;
}

.account-form {
    max-width: 620px;
}

.device-section {
    display: grid;
    gap: 12px;
    margin-top: 4px;
}

.device-section .table-header {
    align-items: center;
}

.device-section .table-header h4 {
    margin: 0;
}

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

.device-row {
    display: grid;
    grid-template-columns: 180px 1fr 110px;
    gap: 10px;
}

.device-row select,
.device-row input {
    width: 100%;
    height: 44px;
    border: 1px solid rgba(160, 118, 255, 0.2);
    border-radius: 16px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font: inherit;
}

.device-row select {
    color-scheme: dark;
    background-color: #202443;
}

.device-row select option {
    background-color: #202443;
    color: #f8f7ff;
}

.raise-description-field {
    margin-top: 2px;
}

.table-link-btn {
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 10px;
    border: 1px solid rgba(162, 104, 255, 0.26);
    background: rgba(255, 255, 255, 0.045);
    color: var(--text);
    cursor: pointer;
    font: inherit;
}

.tall-table {
    max-height: 420px;
}

.table-link-btn:hover,
.table-link-btn:focus-visible {
    border-color: rgba(162, 104, 255, 0.44);
    background: rgba(255, 255, 255, 0.08);
    outline: none;
}

.portal-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 18px;
}

.portal-modal.hidden {
    display: none;
}

.portal-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 6, 19, 0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.portal-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 980px);
    max-height: min(92vh, 920px);
    display: grid;
    grid-template-rows: auto 1fr auto;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid rgba(146, 127, 255, 0.18);
    background: linear-gradient(180deg, rgba(14, 18, 39, 0.98), rgba(12, 15, 33, 0.98));
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.42);
}

.portal-modal-header,
.portal-modal-footer {
    padding: 18px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.portal-modal-footer {
    border-bottom: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.portal-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.portal-modal-header h3 {
    margin: 0;
    font-size: 24px;
}

.portal-modal-subtitle {
    margin: 6px 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.portal-modal-close {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid rgba(162, 104, 255, 0.2);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.portal-modal-body {
    overflow: auto;
    padding: 22px;
}

.modal-detail-layout {
    display: grid;
    gap: 18px;
}

.modal-tab-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.modal-tab-btn {
    min-height: 40px;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid rgba(162, 104, 255, 0.2);
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted-strong);
    cursor: pointer;
    font: inherit;
    font-weight: 600;
}

.modal-tab-btn.is-active {
    background: linear-gradient(90deg, rgba(101, 31, 255, 0.86), rgba(143, 52, 255, 0.86));
    color: #fff;
    border-color: rgba(177, 93, 255, 0.56);
}

.modal-panel {
    display: none;
}

.modal-panel.is-active {
    display: block;
}

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

.detail-field {
    border-radius: 18px;
    padding: 16px;
    border: 1px solid rgba(160, 118, 255, 0.14);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
}

.detail-field.full {
    grid-column: 1 / -1;
}

.detail-label {
    display: block;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.detail-value {
    color: var(--text);
    line-height: 1.6;
    word-break: break-word;
    white-space: pre-wrap;
}

.log-timeline {
    display: grid;
    gap: 14px;
}

.log-card {
    padding: 16px;
    border-radius: 18px;
    border: 1px solid rgba(160, 118, 255, 0.12);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
}

.log-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
    color: var(--muted-strong);
    font-size: 13px;
}

.log-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(160, 118, 255, 0.2);
    background: rgba(255, 255, 255, 0.04);
}

.log-body {
    color: var(--muted);
    line-height: 1.65;
    white-space: pre-wrap;
}

.modal-ticket-list {
    display: grid;
    gap: 12px;
}

.modal-ticket-card {
    padding: 16px;
    border-radius: 18px;
    border: 1px solid rgba(160, 118, 255, 0.12);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.modal-ticket-card:hover,
.modal-ticket-card:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(162, 104, 255, 0.34);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
    outline: none;
}

.modal-ticket-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 10px;
}

.modal-ticket-top strong {
    font-size: 16px;
}

.modal-ticket-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.modal-ticket-meta div,
.modal-ticket-summary {
    color: var(--muted);
    line-height: 1.55;
}

.modal-empty {
    padding: 30px 16px;
    text-align: center;
    color: var(--muted);
}

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

.notification-card {
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(160, 118, 255, 0.12);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
}

.notification-time {
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 12px;
}

.notification-message {
    color: var(--text);
    line-height: 1.55;
}

.modal-actions-row {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

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

@media (max-width: 1280px) {
    body[data-portal-view="dashboard"] .shell {
        display: block;
        max-width: none;
        padding: 10px;
    }

    body[data-portal-view="dashboard"] .brand-panel,
    body[data-portal-view="dashboard"] .content-panel {
        display: none;
    }

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

    .dashboard-sidebar {
        order: 2;
    }

    .metric-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .analytics-grid,
    .account-strip {
        grid-template-columns: 1fr;
    }

    .device-row {
        grid-template-columns: 1fr;
    }
}

body[data-portal-view="dashboard"] .shell {
    display: block;
    max-width: none;
    padding: 10px;
}

body[data-portal-view="dashboard"] .brand-panel,
body[data-portal-view="dashboard"] .content-panel {
    display: none;
}

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

    .content-panel {
        padding-bottom: 20px;
    }
}

@media (max-height: 920px) {
    .shell {
        gap: 18px;
        padding: 10px;
        grid-template-columns: minmax(0, 1.02fr) minmax(340px, 408px);
    }

    .brand-panel {
        padding: 16px 20px;
    }

    .brand-logo {
        width: min(100%, 250px);
        margin-bottom: 8px;
    }

    .brand-stage {
        min-height: 166px;
    }

    .brand-stage-glow {
        inset: 0;
    }

    .brand-signal-card {
        min-width: 150px;
        padding: 10px 12px;
    }

    .brand-stack h1 {
        font-size: clamp(22px, 2.15vw, 34px);
    }

    .brand-subtitle {
        margin: 8px 0 12px;
        font-size: 12.5px;
    }

    .brand-card,
    .brand-preview,
    .panel-card {
        border-radius: 24px;
    }

    .brand-card,
    .brand-preview {
        padding: 14px 16px;
    }

    .brand-card {
        min-height: 166px;
    }

    .panel-card {
        padding: 16px;
    }
}

@media (max-height: 820px) {
    .brand-preview {
        display: none;
    }

    .brand-card {
        margin-bottom: 0;
    }

    .panel-head {
        margin-bottom: 14px;
    }

    .stack-form {
        gap: 12px;
    }

    .last-login-card,
    .verify-card {
        padding: 14px;
    }

    .brand-signal-card-side {
        display: none;
    }
}

@media (max-width: 980px) {
    .dashboard-hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .modal-ticket-meta,
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    body[data-portal-view="login"],
    body[data-portal-view="register"] {
        height: auto;
        min-height: 100dvh;
        overflow-y: auto;
    }

    .shell {
        min-height: 100dvh;
        padding: 16px;
        gap: 18px;
    }

    body[data-portal-view="login"] .shell,
    body[data-portal-view="register"] .shell {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    body[data-portal-view="login"] .brand-panel,
    body[data-portal-view="register"] .brand-panel {
        display: none;
    }

    body[data-portal-view="login"] .content-panel,
    body[data-portal-view="register"] .content-panel {
        width: 100%;
        min-height: calc(100dvh - 32px);
        padding: 0;
    }

    .brand-panel,
    .panel-card {
        border-radius: 24px;
    }

    .brand-panel,
    .panel-card {
        padding: 22px;
    }

    .brand-stack h1 {
        font-size: 30px;
    }

    .brand-subtitle {
        font-size: 16px;
    }

    .preview-grid,
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .panel-head,
    .dashboard-header,
    .table-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .app-dashboard {
        min-height: auto;
        padding: 8px;
    }

    .dashboard-main,
    .dashboard-sidebar {
        padding: 0;
    }

    .dashboard-sidebar {
        gap: 12px;
    }

    .metric-row,
    .analytics-grid,
    .account-strip {
        grid-template-columns: 1fr;
    }

    .monthly-bars {
        height: auto;
        grid-template-columns: repeat(3, 1fr);
    }

    .month-bar-wrap {
        height: 110px;
    }

    .dashboard-table-wrap,
    .tall-table {
        max-height: none;
    }

    .portal-modal {
        padding: 10px;
    }

    .portal-modal-dialog {
        width: 100%;
        max-height: 96vh;
        border-radius: 20px;
    }

    .portal-modal-header,
    .portal-modal-body,
    .portal-modal-footer {
        padding: 16px;
    }

    .portal-modal-header h3 {
        font-size: 21px;
    }
}

@media (max-width: 520px) {
    .page-noise {
        opacity: 0.55;
        filter: blur(34px);
    }

    body[data-portal-view="login"] .shell,
    body[data-portal-view="register"] .shell {
        padding: 10px;
    }

    body[data-portal-view="login"] .content-panel,
    body[data-portal-view="register"] .content-panel {
        min-height: calc(100dvh - 20px);
    }

    .panel-card {
        width: 100%;
        max-height: none;
        padding: 18px;
        border-radius: 20px;
    }

    .panel-head {
        gap: 10px;
    }

    .panel-chip {
        min-height: 32px;
        padding: 6px 10px;
        font-size: 11px;
        white-space: nowrap;
    }

    h2,
    h3 {
        font-size: 19px;
    }

    input {
        height: 46px;
        border-radius: 14px;
        font-size: 16px;
    }

    textarea {
        min-height: 130px;
        border-radius: 14px;
        font-size: 16px;
    }

    .primary-btn,
    .secondary-btn {
        width: 100%;
        min-height: 46px;
        border-radius: 14px;
    }

    .action-row,
    .action-row.right {
        width: 100%;
        justify-content: stretch;
    }

    .form-link-row {
        justify-content: center;
        margin-top: -4px;
    }

    .last-login-card,
    .verify-card {
        border-radius: 16px;
        padding: 14px;
    }
}
