:root {
    color-scheme: light;
    --bg-surface: #f4f6fd;
    --bg-card: #ffffff;
    --bg-hero: linear-gradient(135deg, #f6f3ff 0%, #eef6ff 100%);
    --primary: #6e5cf6;
    --primary-dark: #4f3fd4;
    --ghost: rgba(110, 92, 246, 0.1);
    --text: #1f2643;
    --text-muted: #5f6786;
    --border: #e2e6f4;
    --shadow-soft: 0 20px 45px rgba(31, 38, 67, 0.08);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 16px;
    --radius-sm: 10px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', 'Manrope', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-surface);
    color: var(--text);
}

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

p {
    color: var(--text-muted);
    line-height: 1.6;
}

.top-nav {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 3rem;
    background: rgba(244, 246, 253, 0.8);
    backdrop-filter: blur(22px);
    border-bottom: 1px solid rgba(226, 230, 244, 0.6);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.brand-logo {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(110, 92, 246, 0.95), rgba(78, 204, 250, 0.95));
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.04em;
}

.brand-text {
    display: flex;
    flex-direction: column;
    font-weight: 700;
    color: var(--text);
}

.brand-name {
    font-size: 1.05rem;
}

.brand-sub {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
}

.nav-links {
    display: flex;
    gap: 1.2rem;
    font-weight: 500;
}

.nav-links a {
    padding: 0.65rem 1rem;
    border-radius: 999px;
    color: var(--text-muted);
    transition: background 0.25s ease, color 0.25s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
    background: rgba(110, 92, 246, 0.08);
}

.nav-actions .user-pill {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.8rem;
    background: #fff;
    border-radius: 999px;
    box-shadow: 0 12px 24px rgba(31, 38, 67, 0.08);
}

.user-avatar {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: rgba(110, 92, 246, 0.12);
    color: var(--primary);
    font-weight: 700;
}

.user-info {
    display: flex;
    flex-direction: column;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.user-info strong {
    color: var(--text);
}

.page-shell {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    gap: 3.5rem;
}

.hero-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 2.4rem;
    padding: 3rem;
    background: var(--bg-hero);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.hero-panel::before {
    content: '';
    position: absolute;
    inset: -80px;
    background: radial-gradient(circle at top left, rgba(110, 92, 246, 0.15), transparent 60%),
        radial-gradient(circle at 80% 20%, rgba(78, 179, 250, 0.18), transparent 55%);
    opacity: 0.8;
    z-index: 0;
}

.hero-panel > * {
    position: relative;
    z-index: 1;
}

.duck-cloud {
    position: absolute;
    inset: -80px;
    z-index: 0;
    pointer-events: none;
}

.duck-cloud .duck-layer {
    position: absolute;
    inset: 0;
    background-image: url('../img/duck.png');
    background-repeat: repeat;
    opacity: 0.45;
    mix-blend-mode: multiply;
    filter: saturate(1.3);
}

.duck-cloud .duck-layer-a {
    background-size: 180px;
    background-position: 0 0;
    filter: hue-rotate(0deg) saturate(1.4);
}

.duck-cloud .duck-layer-b {
    background-size: 200px;
    background-position: 90px 60px;
    filter: hue-rotate(65deg) saturate(1.5);
    opacity: 0.5;
}

.duck-cloud .duck-layer-c {
    background-size: 160px;
    background-position: 120px 10px;
    filter: hue-rotate(140deg) saturate(1.6);
    opacity: 0.42;
}

.duck-cloud .duck-layer-d {
    background-size: 220px;
    background-position: 40px 110px;
    filter: hue-rotate(215deg) saturate(1.6);
    opacity: 0.46;
}

body.ducks-off .duck-cloud {
    display: none;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(78, 204, 250, 0.12);
    color: #2f74c0;
}

.hero-panel h1 {
    margin: 1rem 0 1.2rem;
    font-size: clamp(2.5rem, 2.9vw, 3.2rem);
    font-weight: 800;
    color: #1e1c3d;
    line-height: 1.05;
}

.hero-subtitle {
    font-size: 1.05rem;
    max-width: 34rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.4rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn.primary {
    color: #fff;
    background: linear-gradient(135deg, #6e5cf6 0%, #4eb3fa 100%);
    box-shadow: 0 14px 32px rgba(110, 92, 246, 0.25);
}

.btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(110, 92, 246, 0.28);
}

.btn.ghost {
    background: rgba(110, 92, 246, 0.1);
    color: var(--primary);
}

.btn.ghost:hover {
    background: rgba(110, 92, 246, 0.16);
}

.btn.danger {
    color: #f45c6e;
}

.hero-card {
    background: #fff;
    border-radius: 26px;
    padding: 2.2rem;
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
    box-shadow: var(--shadow-soft);
}

.hero-card-header strong {
    display: block;
    font-size: 2.35rem;
    font-weight: 800;
    margin-top: 0.6rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.badge-soft {
    background: rgba(110, 92, 246, 0.12);
    color: var(--primary);
}

.hero-metrics {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.hero-metrics li {
    display: flex;
    justify-content: space-between;
    border-radius: 16px;
    padding: 1rem 1.2rem;
    background: rgba(244, 246, 253, 0.75);
}

.metric-label {
    color: var(--text-muted);
    font-weight: 500;
}

.metric-value {
    font-weight: 700;
    color: var(--text);
}

.metric-value.positive {
    color: #37c875;
}

.apps-section,
.workflow-section,
.form-section,
.admin-section {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.section-header {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    max-width: 52rem;
}

.section-header h2,
.section-header h1 {
    font-weight: 800;
    font-size: 2.1rem;
    color: #1e1c3d;
}

.section-search {
    position: relative;
    margin-top: 0.8rem;
}

.section-search input {
    width: 100%;
    padding: 1rem 1.2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    font-size: 0.95rem;
    padding-right: 3rem;
    background: #fff;
}

.search-icon {
    position: absolute;
    top: 50%;
    right: 1.2rem;
    transform: translateY(-50%);
    color: rgba(31, 38, 67, 0.35);
    font-size: 1rem;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.6rem;
}

.app-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.8rem;
    border-radius: var(--radius-xl);
    background: #fff;
    box-shadow: var(--shadow-soft);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.app-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 26px 50px rgba(31, 38, 67, 0.12);
}

.card-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-weight: 700;
    color: #fff;
}

.gradient-blue {
    background: linear-gradient(135deg, #6e5cf6 0%, #7f9bff 100%);
}

.gradient-orange {
    background: linear-gradient(135deg, #f19745 0%, #f6b676 100%);
}

.gradient-green {
    background: linear-gradient(135deg, #36c996 0%, #6de9c0 100%);
}

.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    background: rgba(110, 92, 246, 0.12);
    color: var(--primary);
    font-weight: 600;
    font-size: 0.8rem;
}

.chip-soft {
    background: rgba(31, 38, 67, 0.08);
    color: #2f3d6a;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.75rem;
}

.status-pill.available {
    background: rgba(55, 200, 117, 0.15);
    color: #1f934f;
}

.status-pill.beta {
    background: rgba(241, 151, 69, 0.18);
    color: #d86b18;
}

.link-arrow {
    font-weight: 600;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.link-arrow::after {
    content: '→';
    font-size: 1rem;
}

.workflow-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.4rem;
}

.workflow-card {
    padding: 1.8rem;
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.step-number {
    font-size: 1.8rem;
    font-weight: 800;
    color: rgba(110, 92, 246, 0.35);
}

.form-section .support-form {
    background: #fff;
    border-radius: var(--radius-xl);
    padding: 2.4rem;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
}

.support-form label {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text);
}

.support-form label span {
    font-size: 0.9rem;
}

.support-form input,
.support-form textarea,
.support-form select {
    border: 1px solid rgba(110, 92, 246, 0.18);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
    font-family: inherit;
    background: rgba(246, 247, 254, 0.8);
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

.support-form input:focus,
.support-form textarea:focus,
.support-form select:focus {
    outline: none;
    border-color: rgba(110, 92, 246, 0.6);
    box-shadow: 0 0 0 3px rgba(110, 92, 246, 0.2);
}

.support-form textarea {
    resize: vertical;
}

.form-grid {
    display: grid;
    gap: 1.4rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.support-form .full {
    width: 100%;
}

.pill-select {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    background: rgba(31, 38, 67, 0.04);
    padding: 0.6rem;
    border-radius: var(--radius-lg);
}

.pill-select input {
    display: none;
}

.pill-select label {
    padding: 0.45rem 1rem;
    border-radius: 999px;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.pill-select label.is-active {
    background: linear-gradient(135deg, rgba(110, 92, 246, 0.85), rgba(78, 179, 250, 0.85));
    color: #fff;
}

.form-footer {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    flex-wrap: wrap;
}

.form-note {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.error {
    color: #f0566c;
    font-size: 0.8rem;
}

.success-card {
    display: flex;
    gap: 1.4rem;
    align-items: center;
    background: linear-gradient(135deg, rgba(55, 200, 117, 0.12), rgba(55, 200, 117, 0.05));
    border-radius: var(--radius-lg);
    padding: 1.4rem 1.6rem;
    border: 1px solid rgba(55, 200, 117, 0.2);
}

.success-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: #37c875;
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 1.4rem;
}

.empty-state {
    margin-top: 2rem;
    background: #fff;
    border-radius: var(--radius-xl);
    padding: 2.6rem;
    text-align: center;
    box-shadow: var(--shadow-soft);
}

.empty-icon {
    font-size: 2rem;
}

.tickets-list {
    display: grid;
    gap: 1.8rem;
}

.ticket-card,
.ticket-admin-card {
    background: #fff;
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.ticket-card header,
.ticket-admin-card header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.2rem;
}

.ticket-meta {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.ticket-id {
    font-weight: 700;
    color: rgba(31, 38, 67, 0.6);
    font-size: 0.9rem;
}

.ticket-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    background: rgba(110, 92, 246, 0.08);
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--text);
}

.ticket-status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--status-color, var(--primary));
    box-shadow: 0 0 0 4px rgba(110, 92, 246, 0.12);
}

.ticket-tags {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.ticket-description {
    background: rgba(31, 38, 67, 0.04);
    border-radius: var(--radius-md);
    padding: 1.2rem;
    color: var(--text);
    line-height: 1.6;
}

.ticket-dates {
    display: flex;
    gap: 2rem;
    margin: 0;
}

.ticket-dates div {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.ticket-dates dt {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.ticket-dates dd {
    margin: 0;
    font-weight: 600;
    color: var(--text);
}

.updates-timeline {
    margin-top: 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.updates-timeline h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.updates-timeline ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.updates-timeline li {
    background: rgba(110, 92, 246, 0.08);
    border-radius: var(--radius-lg);
    padding: 1rem 1.2rem;
}

.updates-timeline .update-time {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(31, 38, 67, 0.6);
}

.updates-timeline.compact li {
    background: rgba(31, 38, 67, 0.05);
}

.admin-login {
    background: #fff;
    padding: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
    width: min(420px, 100%);
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
}

.error-block {
    margin: 0;
    padding: 0.8rem 1rem;
    border-radius: var(--radius-md);
    background: rgba(244, 92, 110, 0.12);
    color: #f0566c;
}

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

.filters-form {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.filters-group {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.filters-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.filters-group select,
.filters-group input {
    padding: 0.65rem 0.9rem;
    border-radius: 12px;
    border: 1px solid rgba(31, 38, 67, 0.12);
    background: #fff;
    font-family: inherit;
    font-size: 0.9rem;
}

.filters-group.search {
    position: relative;
}

.filters-group.search .search-icon {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
}

.filters-group.search input {
    padding-left: 2.2rem;
}

.flash-message {
    background: linear-gradient(135deg, rgba(110, 92, 246, 0.12), rgba(78, 179, 250, 0.1));
    border-radius: var(--radius-lg);
    padding: 1rem 1.2rem;
    font-weight: 600;
}

.meta-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    background: rgba(31, 38, 67, 0.04);
    border-radius: var(--radius-md);
    padding: 1.2rem;
}

.ticket-update-form {
    margin-top: 0.6rem;
    border-top: 1px solid rgba(31, 38, 67, 0.08);
    padding-top: 1.4rem;
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.ticket-update-form label {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text);
}

.ticket-update-form textarea {
    min-height: 120px;
}

.ticket-admin-card.highlighted {
    border: 2px solid rgba(110, 92, 246, 0.5);
    box-shadow: 0 0 0 6px rgba(110, 92, 246, 0.12), var(--shadow-soft);
}

.admin-list {
    display: grid;
    gap: 1.8rem;
}

.page-footer {
    padding: 2.4rem 3rem 3.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    gap: 1rem;
    font-weight: 600;
}

.duck-toggle {
    background: transparent;
    border: 1px solid rgba(31, 38, 67, 0.15);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    color: rgba(31, 38, 67, 0.45);
    opacity: 0.4;
    transition: opacity 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.duck-toggle:hover,
.duck-toggle:focus-visible {
    opacity: 0.9;
    color: #1f2643;
    transform: translateY(-2px);
    outline: none;
}

body.ducks-off .duck-toggle {
    opacity: 0.25;
    color: rgba(31, 38, 67, 0.35);
}

.is-hidden {
    display: none !important;
}

@media (max-width: 1100px) {
    .hero-panel {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .top-nav {
        flex-wrap: wrap;
        gap: 1.2rem;
    }

    .hero-panel {
        padding: 2.2rem;
    }

    .page-shell {
        padding: 2rem;
    }
}

@media (max-width: 640px) {
    .top-nav {
        padding: 1rem 1.5rem;
    }

    .nav-links {
        width: 100%;
        justify-content: space-between;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .page-shell {
        padding: 1.5rem;
    }

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

    .duck-cloud {
        inset: -40px;
    }

    .duck-cloud .duck-layer {
        background-size: 140px;
    }

    .duck-cloud .duck-layer-b {
        background-position: 60px 40px;
    }

    .duck-cloud .duck-layer-c {
        background-position: 80px 0;
    }

    .duck-cloud .duck-layer-d {
        background-position: 30px 80px;
    }

    .duck-toggle {
        align-self: flex-start;
    }
}
