:root {
    --font-display: "Space Grotesk", "Segoe UI", sans-serif;
    --font-body: "Source Sans 3", "Segoe UI", sans-serif;
    --color-bg: #f3f7fc;
    --color-surface: #ffffff;
    --color-surface-soft: #f8fbff;
    --color-border: #d7e3f4;
    --color-text: #1d2a39;
    --color-muted: #5a6c84;
    --color-brand: #0f4c81;
    --color-brand-strong: #08325a;
    --color-accent: #0d9488;
    --color-highlight: #ec8f24;
    --color-danger: #d64545;
    --color-warning: #de8f05;
    --color-success: #198754;
    --shadow-soft: 0 16px 40px rgba(18, 52, 86, 0.08);
    --shadow-card: 0 10px 24px rgba(12, 35, 61, 0.08);
    --radius-xl: 22px;
    --radius-lg: 16px;
    --radius-md: 12px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    color: var(--color-text);
    background:
        radial-gradient(circle at 8% 12%, rgba(13, 148, 136, 0.2) 0, transparent 32%),
        radial-gradient(circle at 91% 7%, rgba(15, 76, 129, 0.22) 0, transparent 31%),
        radial-gradient(circle at 68% 84%, rgba(236, 143, 36, 0.11) 0, transparent 34%),
        linear-gradient(180deg, #fbfdff 0%, var(--color-bg) 44%, #ecf4fd 100%);
    background-attachment: fixed;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.42;
    z-index: -2;
    background-image:
        linear-gradient(rgba(102, 139, 176, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(102, 139, 176, 0.07) 1px, transparent 1px);
    background-size: 22px 22px;
}
  


.app-bg-orb {
    position: fixed;
    z-index: -1;
    border-radius: 50%;
    filter: blur(14px);
    opacity: 0.46;
    pointer-events: none;
}

.app-bg-orb.orb-a {
    width: 260px;
    height: 260px;
    top: 12%;
    left: -70px;
    background: linear-gradient(145deg, #0d9488, #81d4cb);
    animation: drift 15s ease-in-out infinite;
}

.app-bg-orb.orb-b {
    width: 360px;
    height: 360px;
    bottom: -120px;
    right: -100px;
    background: linear-gradient(145deg, #0f4c81, #7ca5ce);
    animation: drift 19s ease-in-out infinite reverse;
}

@keyframes drift {
    0% { transform: translate(0, 0); }
    50% { transform: translate(12px, -14px); }
    100% { transform: translate(0, 0); }
}

.topbar {
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.6);
    background: linear-gradient(100deg, rgba(9, 35, 62, 0.95), rgba(12, 86, 126, 0.95), rgba(18, 96, 148, 0.95));
    box-shadow: 0 5px 20px rgba(7, 26, 44, 0.28);
    position: relative;
    overflow: hidden;
}

.topbar::after {
    content: "";
    position: absolute;
    inset: auto -110px -55px auto;
    width: 320px;
    height: 180px;
    background: radial-gradient(circle at center, rgba(236, 143, 36, 0.34), transparent 62%);
    pointer-events: none;
}

.topbar .container {
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
}

.topbar-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.topbar-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.45rem;
}

.header-links {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.header-link-btn {
    text-decoration: none;
    color: #ebf5ff;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 10px;
    padding: 0.28rem 0.72rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.header-link-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.22);
}

.header-link-btn.active {
    color: #102f4f;
    background: linear-gradient(145deg, #f1f8ff, #cbe5ff);
    border-color: #d9ecff;
}

.brand-link {
    text-decoration: none;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(145deg, #0d9488, #0f4c81);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.brand-title {
    display: block;
    font-family: var(--font-display);
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.brand-subtitle {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.82rem;
}

.topbar-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.topbar-user {
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
}

.topbar-role {
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #fff;
    padding: 0.33rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.38);
    background-color: rgba(255, 255, 255, 0.14);
}

.btn-ghost {
    border: 1px solid rgba(255, 255, 255, 0.56);
    color: #ffffff;
    border-radius: 10px;
    padding: 0.35rem 0.8rem;
    font-size: 0.86rem;
}

.btn-ghost:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
}

.page-shell {
    max-width: 1180px;
    margin: 1.25rem auto 2rem;
    padding: 0 0.9rem;
}

.flash-stack {
    margin-bottom: 1rem;
}

.flash-item {
    border: 0;
    border-left: 4px solid #7ca5ce;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
}

.flash-item.alert-success { border-left-color: var(--color-success); }
.flash-item.alert-danger { border-left-color: var(--color-danger); }
.flash-item.alert-warning { border-left-color: var(--color-warning); }

.section-header {
    margin-bottom: 1.2rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: 1rem 1.1rem;
    border-radius: 14px;
    border: 1px solid rgba(132, 161, 194, 0.34);
    background:
        linear-gradient(100deg, rgba(255, 255, 255, 0.95), rgba(243, 250, 255, 0.95));
    box-shadow: 0 10px 24px rgba(15, 43, 71, 0.08);
}

.section-header::after {
    content: "";
    position: absolute;
    right: -35px;
    top: -35px;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle at center, rgba(13, 148, 136, 0.19), transparent 68%);
    pointer-events: none;
}

.section-kicker {
    display: inline-flex;
    margin-bottom: 0.42rem;
    border-radius: 999px;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 700;
    color: #0f4c81;
    padding: 0.2rem 0.56rem;
    border: 1px solid #b7d5f1;
    background: #ebf5ff;
}

.section-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.25rem, 3vw, 1.85rem);
    font-weight: 700;
    letter-spacing: 0.01em;
}

.section-subtitle {
    margin: 0.25rem 0 0;
    color: var(--color-muted);
}

.panel {
    background: var(--color-surface);
    border: 1px solid rgba(116, 146, 181, 0.22);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 26px rgba(12, 38, 65, 0.08);
    transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.panel:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(12, 38, 65, 0.12);
}

.panel.soft {
    background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.btn-brand {
    border: 0;
    border-radius: 10px;
    padding: 0.58rem 1rem;
    color: #ffffff;
    font-weight: 600;
    background: linear-gradient(145deg, var(--color-brand), #1f6cb4);
    box-shadow: 0 9px 20px rgba(15, 76, 129, 0.25);
}

.btn-brand:hover {
    color: #ffffff;
    background: linear-gradient(145deg, var(--color-brand-strong), #10518a);
}

.btn-subtle {
    border-radius: 10px;
    border: 1px solid var(--color-border);
    background: #ffffff;
    color: var(--color-text);
}

.btn-subtle:hover {
    background: #edf5ff;
}

.stats-grid {
    margin-top: 0.25rem;
    margin-bottom: 1.1rem;
}

.stat-card {
    border-radius: var(--radius-md);
    border: 1px solid rgba(125, 156, 188, 0.28);
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 9px 20px rgba(16, 43, 72, 0.1);
    padding: 1rem 1.1rem;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--color-accent), var(--color-brand), var(--color-highlight));
}

.stat-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--color-muted);
    margin-bottom: 0.4rem;
    font-weight: 700;
}

.stat-value {
    font-size: 1.8rem;
    line-height: 1;
    font-family: var(--font-display);
    margin: 0;
}

.stat-trend {
    margin-top: 0.32rem;
    font-size: 0.8rem;
    color: var(--color-muted);
}

.table-shell {
    overflow: hidden;
}

.table-modern {
    margin-bottom: 0;
}

.table-modern thead th {
    border-bottom: 1px solid rgba(149, 171, 197, 0.35);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.74rem;
    color: var(--color-muted);
    background: #f7fafe;
    font-weight: 700;
}

.table-modern td {
    vertical-align: middle;
    border-color: rgba(188, 205, 226, 0.38);
    background: rgba(255, 255, 255, 0.56);
}

.table-row-click {
    cursor: pointer;
    transition: background-color 0.14s ease-in-out;
}

.table-row-click:hover {
    background: #eef6ff;
}

.subject-title {
    font-weight: 700;
}

.subject-meta {
    color: var(--color-muted);
    font-size: 0.81rem;
}

.status-pill {
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.65rem;
    font-size: 0.76rem;
    font-weight: 700;
    border: 1px solid transparent;
}

.status-open {
    color: #a12b2b;
    background: #fdeef0;
    border-color: #f8cfd5;
}

.status-progress {
    color: #8a5d00;
    background: #fdf3df;
    border-color: #f4dfb5;
}

.status-done {
    color: #146b43;
    background: #eaf8f0;
    border-color: #c7e9d5;
}

.priority-tag {
    font-weight: 700;
    font-size: 0.82rem;
}

.priority-critical { color: #b72828; }
.priority-high { color: #b56b00; }
.priority-default { color: var(--color-muted); }

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

.empty-state .empty-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 0.55rem;
    border-radius: 16px;
    color: #ffffff;
    background: linear-gradient(145deg, #7ca5ce, #0f4c81);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.auth-page .topbar {
    box-shadow: none;
    border-bottom-color: transparent;
}

.auth-wrap {
    min-height: calc(100vh - 170px);
    display: grid;
    place-items: center;
}

.auth-card {
    width: min(920px, 100%);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: 0 26px 52px rgba(13, 41, 68, 0.16);
    border: 1px solid rgba(119, 148, 178, 0.2);
    background: #ffffff;
}

.auth-side {
    background:
        linear-gradient(150deg, rgba(13, 148, 136, 0.91), rgba(15, 76, 129, 0.96)),
        linear-gradient(0deg, #133f6c, #133f6c);
    color: #ffffff;
    padding: 2.2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.auth-side h1 {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 3vw, 2rem);
    margin-bottom: 0.8rem;
}

.auth-side p {
    margin: 0;
    opacity: 0.92;
}

.auth-kicker {
    color: #0f4c81;
    background: #e8f6ff;
    border-color: #d1ecff;
}

.auth-list {
    margin: 1.5rem 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.65rem;
    font-size: 0.94rem;
}

.auth-list li::before {
    content: ">";
    font-weight: 700;
    margin-right: 0.35rem;
    color: #d9f4f0;
}

.auth-form {
    padding: 2.2rem;
}

.auth-form h2 {
    font-family: var(--font-display);
    margin-bottom: 0.25rem;
    font-size: 1.5rem;
}

.auth-form p {
    color: var(--color-muted);
    margin-bottom: 1.2rem;
}

.auth-stats {
    display: grid;
    gap: 0.4rem;
}

.auth-stat {
    font-size: 0.8rem;
    border-radius: 10px;
    padding: 0.45rem 0.55rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.09);
}

.field-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #3f5772;
}

.form-control,
.form-select {
    border-radius: 10px;
    border-color: #c8d8ea;
    padding: 0.62rem 0.75rem;
}

.form-control:focus,
.form-select:focus {
    border-color: #5f93c8;
    box-shadow: 0 0 0 0.24rem rgba(70, 134, 193, 0.2);
}

.result-list {
    max-height: 220px;
    overflow-y: auto;
    box-shadow: var(--shadow-card);
    border-radius: 12px;
    border: 1px solid #ccdaea;
}

.result-item {
    border: 0;
    border-bottom: 1px solid #ecf3fb;
    text-align: left;
}

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

.result-item:hover {
    background: #f4f9ff;
}

.ticket-content {
    white-space: pre-wrap;
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid #dce8f6;
    background: #fafcff;
}

.meta-grid .meta-item {
    padding: 0.75rem;
    border-radius: 12px;
    border: 1px solid #d8e4f2;
    background: linear-gradient(180deg, #ffffff, #f7fbff);
}

.meta-label {
    font-size: 0.77rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-muted);
    margin-bottom: 0.35rem;
}

.meta-value {
    font-weight: 700;
}

.timeline {
    display: grid;
    gap: 0.65rem;
}

.timeline-item {
    padding: 0.75rem 0.9rem;
    border-radius: 12px;
    border: 1px solid #d5e4f3;
    background: linear-gradient(180deg, #ffffff, #f7fbff);
    border-left: 4px solid #0f4c81;
}

.timeline-head {
    display: flex;
    justify-content: space-between;
    gap: 0.6rem;
    align-items: center;
    margin-bottom: 0.22rem;
}

.timeline-name {
    font-weight: 700;
}

.timeline-time {
    color: var(--color-muted);
    font-size: 0.8rem;
}

.timeline-text {
    margin: 0;
}

.kanban-board {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
}

.kanban-col {
    border: 1px solid #d5e3f2;
    border-radius: 14px;
    padding: 0.75rem;
    background: linear-gradient(180deg, #fbfeff 0%, #f3f8ff 100%);
    min-height: 240px;
}

.kanban-col:nth-child(1) { border-top: 4px solid #7a9cc0; }
.kanban-col:nth-child(2) { border-top: 4px solid #0f4c81; }
.kanban-col:nth-child(3) { border-top: 4px solid #de8f05; }
.kanban-col:nth-child(4) { border-top: 4px solid #198754; }

.kanban-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
}

.kanban-count {
    font-size: 0.78rem;
    color: var(--color-muted);
}

.kanban-list {
    margin-top: 0.65rem;
    display: grid;
    gap: 0.6rem;
}

.kanban-card {
    border: 1px solid #d4e1f0;
    border-radius: 12px;
    background: #ffffff;
    padding: 0.72rem;
    box-shadow: 0 5px 12px rgba(20, 47, 78, 0.08);
    transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.kanban-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(20, 47, 78, 0.12);
}

.kanban-card h3 {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 700;
}

.kanban-card p {
    margin: 0.36rem 0 0;
    color: var(--color-muted);
    font-size: 0.84rem;
}

.card-meta {
    margin-top: 0.52rem;
    color: #607590;
    font-size: 0.78rem;
}

.mini-form {
    margin-top: 0.58rem;
    display: grid;
    gap: 0.38rem;
}

.mini-form .form-select,
.mini-form .form-control {
    font-size: 0.82rem;
    padding: 0.44rem 0.55rem;
}

.mini-form .btn {
    padding: 0.35rem 0.6rem;
    font-size: 0.79rem;
}

.type-pill {
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    padding: 0.24rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 700;
}

.type-feedback {
    background: #e9f8f6;
    color: #0b6f67;
    border: 1px solid #bee6e2;
}

.type-bug {
    background: #feefee;
    color: #ac2f2f;
    border: 1px solid #f3cccc;
}

.inline-filter {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    align-items: end;
}

.inline-filter .form-select {
    min-width: 170px;
}

.record-card {
    position: relative;
    overflow: hidden;
}

.record-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(180deg, var(--color-brand), var(--color-accent));
}

.copy-box {
    border: 1px solid #d7e5f5;
    border-radius: 12px;
    background: #fbfdff;
    padding: 0.6rem 0.75rem;
}

.copy-box summary {
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    color: #20476e;
}

.copy-box pre {
    margin-top: 0.55rem;
    margin-bottom: 0.2rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    padding: 0.75rem;
    border-radius: 10px;
    border: 1px solid #d9e6f5;
    background: #f7fbff;
    font-size: 0.84rem;
    color: #223547;
}

.diag-alert {
    border: 1px solid #f3d5b7;
    background: #fff5e9;
    color: #7e4f12;
    border-radius: 10px;
    padding: 0.5rem 0.6rem;
    font-size: 0.84rem;
}

.diag-check {
    border-radius: 10px;
    padding: 0.42rem 0.6rem;
    font-size: 0.82rem;
    border: 1px solid #dce6f5;
    background: #f8fbff;
    color: #39516d;
}

.diag-check.ok {
    border-color: #c5e9d6;
    background: #edf9f2;
    color: #1b6e47;
}

.diag-check.fail {
    border-color: #f3d0d0;
    background: #fff2f2;
    color: #9c2f2f;
}

.diag-item {
    border: 1px solid #d9e6f5;
    border-radius: 10px;
    padding: 0.52rem 0.62rem;
    background: #fbfdff;
}

.diag-item-empty {
    border: 1px dashed #ccdcee;
    border-radius: 10px;
    padding: 0.55rem 0.65rem;
    color: #6a7f97;
    background: #f8fbff;
}

.diag-media {
    font-size: 0.8rem;
    border-radius: 8px;
    background: #f2f8ff;
    border: 1px solid #d4e4f6;
    color: #39516d;
    padding: 0.35rem 0.48rem;
}

.page-enter {
    animation: fadeSlideIn 0.26s ease-out;
}

@keyframes fadeSlideIn {
    0% { opacity: 0; transform: translateY(6px); }
    100% { opacity: 1; transform: translateY(0); }
}

@media (max-width: 991px) {
    .auth-card {
        grid-template-columns: 1fr;
    }

    .auth-side {
        min-height: 220px;
    }

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

@media (max-width: 767px) {
    .topbar-wrap {
        align-items: flex-start;
    }

    .topbar-actions {
        align-items: stretch;
        width: 100%;
    }

    .header-links {
        justify-content: flex-start;
    }

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

    .section-header {
        align-items: flex-start;
    }

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

    .section-header .btn {
        width: 100%;
    }

    .kanban-board {
        grid-template-columns: 1fr;
    }
}
