﻿:root {
    --app-sidebar: 280px;
    --app-surface: rgba(255, 255, 255, 0.82);
    --app-stroke: rgba(255, 255, 255, 0.7);
}

body.app-page,
body.auth-page,
body.wizard-page,
body.admin-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(240, 100, 24, 0.18), transparent 32%),
        radial-gradient(circle at top right, rgba(110, 231, 183, 0.2), transparent 28%),
        linear-gradient(180deg, #fcfcfd 0%, #f4f7fb 100%);
}

.app-backdrop {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.app-backdrop::before,
.app-backdrop::after {
    content: '';
    position: absolute;
    border-radius: 9999px;
    filter: blur(72px);
    opacity: 0.55;
}

.app-backdrop::before {
    width: 22rem;
    height: 22rem;
    top: 7rem;
    left: -5rem;
    background: rgba(240, 100, 24, 0.22);
}

.app-backdrop::after {
    width: 26rem;
    height: 26rem;
    right: -6rem;
    top: 16rem;
    background: rgba(110, 231, 183, 0.2);
}

.auth-main,
.app-main,
.admin-main,
.wizard-main {
    position: relative;
    z-index: 1;
}

.header.app-header {
    margin: 1rem auto 0;
    width: calc(100% - 2rem);
    max-width: 1320px;
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 1.25rem;
    box-shadow: 0 20px 60px -42px rgba(15, 23, 42, 0.35);
    overflow: visible;
}

.auth-main {
    padding: 3rem 0 4rem;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: 2rem;
    align-items: stretch;
}

.auth-hero,
.auth-card,
.app-panel,
.wizard-panel,
.admin-panel {
    background: var(--app-surface);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--app-stroke);
    box-shadow: 0 28px 80px -50px rgba(17, 24, 39, 0.45);
}

.auth-hero {
    border-radius: 2rem;
    padding: 3rem;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 42rem;
}

.auth-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(240, 100, 24, 0.18), transparent 55%),
        linear-gradient(220deg, rgba(110, 231, 183, 0.16), transparent 45%);
    pointer-events: none;
}

.auth-hero > * {
    position: relative;
    z-index: 1;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    width: fit-content;
    padding: 0.45rem 0.85rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.7);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.auth-title {
    font-size: clamp(2.75rem, 5vw, 4.5rem);
    line-height: 0.98;
    letter-spacing: -0.04em;
    margin: 1.5rem 0 1rem;
}

.auth-copy {
    max-width: 34rem;
    font-size: 1.125rem;
    line-height: 1.8;
}

.auth-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 2.5rem;
}

.auth-metric {
    padding: 1.15rem 1.25rem;
    border-radius: 1.25rem;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(255, 255, 255, 0.75);
}

.auth-metric strong {
    display: block;
    font-size: 1.6rem;
    color: var(--text-primary);
}

.auth-metric span {
    display: block;
    font-size: 0.92rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.auth-card {
    border-radius: 2rem;
    padding: 2.25rem;
}

.auth-card-header {
    margin-bottom: 1.75rem;
}

.auth-card-header h1 {
    font-size: 2.3rem;
    margin-bottom: 0.5rem;
}

.app-main,
.admin-main {
    padding: 2rem 0 4rem;
}

.app-shell,
.admin-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
}

.app-hero-card,
.admin-hero-card {
    border-radius: 2rem;
    padding: 2rem 2rem 1.6rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.7));
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 28px 80px -52px rgba(17, 24, 39, 0.48);
}

.app-hero-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
}

.app-hero-card h1,
.admin-hero-card h1 {
    font-size: clamp(2.2rem, 4vw, 3.4rem);
    margin-bottom: 0.5rem;
}

.app-hero-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.app-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.dashboard-stat,
.app-stat-card {
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 1.5rem;
    padding: 1.4rem 1.5rem;
    box-shadow: 0 24px 64px -48px rgba(17, 24, 39, 0.4);
}

.dashboard-stat::before,
.app-stat-card::before {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 3px;
    background: var(--primary-gradient);
    opacity: 0.9;
}

.dashboard-stat-value,
.app-stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text-primary);
    margin-bottom: 0.45rem;
}

.dashboard-stat-label,
.app-stat-label {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.app-section-card {
    border-radius: 1.75rem;
    padding: 1.5rem;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.section-head h2 {
    margin: 0;
    font-size: 1.6rem;
}

.project-card {
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 1.5rem;
    padding: 1.4rem;
    box-shadow: 0 20px 60px -48px rgba(17, 24, 39, 0.38);
}

.project-card + .project-card {
    margin-top: 1rem;
}

.project-card-header,
.project-card-footer,
.project-card-meta,
.project-card-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}

.project-card-meta {
    justify-content: flex-start;
    margin: 0.9rem 0;
}

.project-card-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.8rem;
    background: rgba(249, 250, 251, 0.92);
    border: 1px solid rgba(229, 231, 235, 0.95);
    border-radius: 9999px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.project-card-title {
    font-size: 1.25rem;
    margin: 0;
}

.project-card-description {
    margin-bottom: 0;
}

.user-menu {
    position: relative;
}

.user-menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.45rem 0.7rem 0.45rem 0.45rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(229, 231, 235, 0.95);
    cursor: pointer;
}

.avatar {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient);
    color: white;
    font-weight: 700;
    box-shadow: 0 10px 22px -12px rgba(240, 100, 24, 0.8);
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0;
    min-width: 220px;
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid rgba(229, 231, 235, 0.92);
    border-radius: 1rem;
    padding: 0.45rem;
    box-shadow: 0 24px 60px -38px rgba(17, 24, 39, 0.45);
    display: none;
}

.user-menu-dropdown.open {
    display: block;
}

.user-menu-item {
    display: block;
    padding: 0.8rem 0.9rem;
    border-radius: 0.8rem;
    text-decoration: none;
    color: var(--text-primary);
}

.user-menu-item:hover {
    background: var(--gray-50);
}

.empty-state {
    background: rgba(255, 255, 255, 0.84);
    border: 1px dashed rgba(209, 213, 219, 0.95);
    border-radius: 1.5rem;
    padding: 2.5rem 1.5rem;
    text-align: center;
}

.empty-state-icon {
    font-size: 2.6rem;
    margin-bottom: 0.75rem;
}

.wizard-main {
    position: relative;
    z-index: 1;
    padding: 2rem 0 4rem;
}

.wizard-container {
    width: min(1160px, calc(100% - 2rem));
    margin: 0 auto;
}

.wizard-progress,
.wizard-content {
    background: rgba(255, 255, 255, 0.84);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.78);
    box-shadow: 0 30px 84px -56px rgba(17, 24, 39, 0.48);
}

.wizard-progress {
    border-radius: 1.75rem;
    padding: 1.4rem;
    margin-bottom: 1.25rem;
}

.wizard-progress-bar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.wizard-step {
    text-align: center;
    padding: 0.85rem 0.5rem;
    border-radius: 1rem;
    background: rgba(249, 250, 251, 0.9);
    border: 1px solid rgba(229, 231, 235, 0.92);
}

.wizard-step.active {
    background: rgba(243, 232, 255, 0.9);
    border-color: rgba(240, 100, 24, 0.4);
}

.wizard-step.completed {
    background: rgba(209, 250, 229, 0.78);
    border-color: rgba(110, 231, 183, 0.5);
}

.wizard-step-number {
    width: 2rem;
    height: 2rem;
    margin: 0 auto 0.45rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    font-weight: 700;
}

.wizard-step.active .wizard-step-number {
    background: var(--primary-gradient);
    color: white;
}

.wizard-content {
    border-radius: 1.75rem;
    padding: 2rem;
}

.wizard-title {
    font-size: clamp(2rem, 3vw, 3rem);
    margin-bottom: 0.65rem;
}

.wizard-subtitle {
    margin-bottom: 1.6rem;
}

.selection-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.selection-card {
    position: relative;
    border-radius: 1.5rem;
    padding: 1.35rem;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(229, 231, 235, 0.95);
    cursor: pointer;
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

.selection-card:hover,
.selection-card.selected {
    transform: translateY(-3px);
    border-color: rgba(240, 100, 24, 0.4);
    box-shadow: 0 18px 44px -28px rgba(240, 100, 24, 0.45);
}

.selection-card.selected::after {
    content: 'Vybráno';
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.3rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 700;
    color: white;
    background: var(--primary-gradient);
}

.selection-card-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.form-group {
    margin-bottom: 1.1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.45rem;
    color: var(--text-primary);
    font-weight: 600;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    border-radius: 1rem;
    border: 1px solid rgba(209, 213, 219, 0.95);
    background: rgba(255, 255, 255, 0.92);
    padding: 0.95rem 1rem;
    font: inherit;
    color: var(--text-primary);
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: rgba(240, 100, 24, 0.7);
    box-shadow: 0 0 0 4px rgba(240, 100, 24, 0.12);
}

.form-textarea {
    min-height: 9rem;
    resize: vertical;
}

.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.wizard-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

.admin-table-wrap {
    overflow: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(229, 231, 235, 0.92);
    text-align: left;
    vertical-align: top;
}

.admin-table th {
    color: var(--text-secondary);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.admin-table tbody tr:hover {
    background: rgba(249, 250, 251, 0.7);
}

.stack-sm > * + * {
    margin-top: 0.75rem;
}

/* App Responsive */
@media (max-width: 480px) {
    .header.app-header {
        width: calc(100% - 1rem);
        margin: 0.5rem auto 0;
        border-radius: 1rem;
        overflow: visible;
    }
    
    .auth-shell {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .auth-hero {
        min-height: auto;
        padding: 2rem 1.5rem;
    }
    
    .auth-card {
        padding: 1.75rem 1.5rem;
    }
    
    .auth-title {
        font-size: 2rem;
    }
    
    .auth-metrics {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .app-stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .app-hero-card h1,
    .admin-hero-card h1 {
        font-size: 1.75rem;
    }
    
    .app-hero-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .app-hero-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .app-hero-actions .btn {
        width: 100%;
    }
    
    .selection-grid {
        grid-template-columns: 1fr;
    }
    
    .wizard-progress-bar {
        grid-template-columns: 1fr;
    }
    
    .section-head {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .project-card-header,
    .project-card-footer,
    .project-card-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .user-menu-trigger > span {
        display: none;
    }
}

/* Tablet/Mobile - use hamburger menu */
@media (max-width: 1024px) {
    .header.app-header {
        overflow: visible !important;
        border-radius: 1rem !important;
    }
    
    .header.app-header .container {
        overflow: visible !important;
    }
    
    .header.app-header .header-container {
        overflow: visible !important;
    }

    /* Mobile nav styling for app pages */
    .header.app-header nav {
        position: fixed;
        top: 0;
        right: 0;
        width: 320px;
        max-width: 85vw;
        height: 100vh;
        background: white;
        box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
        z-index: 1000;
        overflow-y: auto;
        visibility: hidden;
        opacity: 0;
        transform: translateX(100%);
        transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .header.app-header nav.active {
        visibility: visible;
        opacity: 1;
        transform: translateX(0);
    }

    .header.app-header .nav-menu {
        flex-direction: column;
        padding: 80px 24px 24px;
        gap: 4px;
        align-items: stretch;
    }

    .header.app-header .nav-menu li {
        width: 100%;
    }

    .header.app-header .nav-link {
        display: block;
        padding: 14px 18px;
        border-radius: 10px;
        width: 100%;
    }

    .header.app-header .user-menu {
        width: 100%;
    }

    .header.app-header .user-menu-trigger {
        width: 100%;
        justify-content: flex-start;
    }

    .header.app-header .user-menu-dropdown {
        position: static;
        box-shadow: none;
        border: none;
        margin-top: 8px;
    }
}

/* Small tablet range */
@media (min-width: 481px) and (max-width: 768px) {
    .header.app-header {
        width: calc(100% - 1.5rem);
        margin: 0.75rem auto 0;
        overflow: visible;
    }
    
    .auth-shell {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .auth-hero {
        min-height: auto;
        padding: 2.5rem 2rem;
    }
    
    .auth-card {
        padding: 2rem;
    }
    
    .auth-metrics {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .app-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .app-hero-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .selection-grid {
        grid-template-columns: 1fr;
    }
    
    .wizard-progress-bar {
        grid-template-columns: 1fr;
    }
    
    .section-head {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .user-menu-trigger > span {
        display: inline;
    }
}

/* Larger tablet range */
@media (min-width: 769px) and (max-width: 1024px) {
    .auth-shell {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 1.5rem;
    }
    
    .app-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .selection-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .wizard-progress-bar {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

/* Desktop - normal horizontal navbar */
@media (min-width: 1025px) {
    .header.app-header nav {
        position: static !important;
        width: auto !important;
        height: auto !important;
        background: none !important;
        box-shadow: none !important;
        visibility: visible !important;
        opacity: 1 !important;
        transform: none !important;
        overflow: visible !important;
    }

    .header.app-header .nav-menu {
        flex-direction: row !important;
        padding: 0 !important;
        gap: 2rem !important;
        align-items: center !important;
    }

    .header.app-header .nav-menu li {
        width: auto !important;
    }

    .header.app-header .nav-link {
        padding: 0 !important;
        border-radius: 0 !important;
        width: auto !important;
    }

    .header.app-header .user-menu-dropdown {
        position: absolute !important;
        box-shadow: var(--shadow-lg) !important;
        border: 1px solid var(--border-color) !important;
    }
}