/* WardConnect luxury app shell, tokens: wc-semantic-system.css (Phase 1) */

body.wc-app-body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--wc-font-sans);
    font-weight: 450;
    line-height: 1.62;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    background:
        radial-gradient(ellipse 58% 48% at 8% 10%, var(--wc-lux-gold-glow), transparent 45%),
        radial-gradient(circle at top right, rgba(47, 109, 246, 0.09), transparent 26%),
        radial-gradient(circle at bottom right, rgba(13, 35, 80, 0.04), transparent 30%),
        linear-gradient(165deg, #f8fafc 0%, #f1f5f9 42%, #eef2f8 100%);
    color: var(--wc-lux-text);
}

.wc-app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 290px 1fr;
}

/* sidebar */
.wc-app-sidebar {
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.08), transparent 30%),
        linear-gradient(180deg, var(--wc-lux-sidebar-2) 0%, var(--wc-lux-sidebar-1) 100%);
    color: rgba(255, 255, 255, 0.92);
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.03);
}

.wc-sidebar-brand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}

.wc-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px 16px;
    font-size: 1.7rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.03em;
    text-decoration: none;
    flex: 1;
    min-width: 0;
}

.wc-sidebar-close-btn {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.wc-sidebar-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.wc-sidebar-brand:hover {
    color: #fff;
}

.wc-sidebar-brand-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7aa8ff, #5b8def 55%, #2f6df6);
    box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.wc-sidebar-nav {
    margin-top: 12px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-bottom: 8px;
}

.wc-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 18px;
    border-radius: 18px;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.84);
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: background 0.22s ease, color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}

.wc-nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateX(3px);
}

.wc-nav-link:active {
    transform: translateX(1px) scale(0.99);
    transition-duration: 0.08s;
}

.wc-nav-link.active {
    background: linear-gradient(135deg, rgba(215, 176, 106, 0.22), rgba(47, 109, 246, 0.28));
    color: #fff;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.14),
        0 0 0 1px rgba(255, 255, 255, 0.08),
        0 12px 28px rgba(0, 0, 0, 0.14);
}

.wc-nav-link i {
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.wc-nav-badge {
    margin-left: auto;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* sidebar footer */
.wc-sidebar-footer {
    margin-top: auto;
    padding-top: 18px;
    flex-shrink: 0;
}

.wc-sidebar-user {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.wc-sidebar-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
}

.wc-sidebar-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.wc-sidebar-user-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
}

.wc-sidebar-user-role {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.72);
}

.wc-sidebar-logout {
    width: 100%;
    border: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 16px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-weight: 700;
    transition: all 0.2s ease;
    cursor: pointer;
}

.wc-sidebar-logout:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.wc-sidebar-logout:active {
    transform: scale(0.99);
    transition-duration: 0.08s;
}

/* main area */
.wc-app-main {
    min-width: 0;
    padding: 28px 28px 36px;
    display: flex;
    flex-direction: column;
}

.wc-app-header {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.72));
    border: 1px solid rgba(223, 231, 243, 0.98);
    border-radius: var(--wc-lux-radius-lg);
    box-shadow: var(--wc-lux-shadow-sm);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 26px;
    flex-shrink: 0;
}

.wc-app-header-left {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.wc-sidebar-toggle {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    padding: 0 !important;
    min-width: 46px;
    position: relative;
    z-index: 5;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.wc-app-header-title-wrap {
    flex: 1;
    min-width: 0;
}

.wc-app-page-title {
    margin: 0;
    font-size: clamp(1.5rem, 2.4vw, 2.2rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--wc-lux-text);
    line-height: 1.12;
    overflow-wrap: anywhere;
}

.wc-app-header-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.wc-app-content {
    min-width: 0;
    flex: 1;
}

/* shared buttons */
.wc-btn-soft {
    height: 46px;
    padding: 0 18px;
    border-radius: 14px;
    border: 1px solid var(--wc-lux-line);
    background: rgba(255, 255, 255, 0.82);
    color: var(--wc-lux-primary-dark);
    font-weight: 700;
    box-shadow: var(--wc-lux-shadow-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.wc-btn-soft:hover {
    background: #fff;
    color: var(--wc-lux-primary);
}

.wc-btn-soft-muted {
    border-color: rgba(223, 231, 243, 0.8);
    background: rgba(255, 255, 255, 0.55);
}

/* global luxury card style in main content */
.wc-app-content .card:not(.border-0),
.wc-app-content .wc-card,
.wc-app-content .ui-card,
.wc-app-content .dashboard-card {
    border: 1px solid var(--wc-lux-line);
    border-radius: var(--wc-lux-radius-lg);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.86));
    box-shadow: var(--wc-lux-shadow-md);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.wc-app-content .dashboard-card:hover,
.wc-app-content .ui-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--wc-lux-shadow-lg);
}

@media (prefers-reduced-motion: reduce) {
    .wc-app-content .dashboard-card,
    .wc-app-content .ui-card {
        transition: none;
    }

    .wc-app-content .dashboard-card:hover,
    .wc-app-content .ui-card:hover {
        transform: none;
    }

    .wc-nav-link {
        transition: none;
    }

    .wc-nav-link:hover {
        transform: none;
    }

    .wc-app-content .btn-primary:hover {
        transform: none;
    }

    .wc-app-content .btn:active:not(:disabled):not(.disabled) {
        transform: none;
    }

    .wc-nav-link:active {
        transform: none;
    }

    .wc-sidebar-logout:active {
        transform: none;
    }
}

/* Bootstrap cards that should stay flat (e.g. inside groups) */
.wc-app-content .card.border-0 {
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}

/* tables */
.wc-app-content table {
    border-collapse: separate;
    border-spacing: 0;
}

.wc-app-content table th {
    color: var(--wc-lux-muted);
    font-size: 0.84rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--wc-lux-line-soft);
    padding: 12px 14px;
}

.wc-app-content table td {
    border-bottom: 1px solid var(--wc-lux-line-soft);
    color: var(--wc-lux-text);
    padding: 12px 14px;
    vertical-align: middle;
}

/* forms */
.wc-app-content .form-control,
.wc-app-content .form-select {
    min-height: 46px;
    border-radius: 14px;
    border: 1px solid var(--wc-lux-line);
    background: rgba(255, 255, 255, 0.88);
    color: var(--wc-lux-text);
    box-shadow: inset 0 1px 2px rgba(17, 34, 68, 0.02);
}

.wc-app-content .form-control:focus,
.wc-app-content .form-select:focus {
    border-color: rgba(47, 109, 246, 0.38);
    box-shadow:
        0 0 0 4px var(--wc-lux-gold-glow),
        0 0 0 1px rgba(47, 109, 246, 0.08);
}

.wc-app-content .btn {
    border-radius: var(--wc-lux-radius-sm);
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.wc-app-content .btn:focus-visible {
    outline: 2px solid rgba(47, 109, 246, 0.55);
    outline-offset: 2px;
}

.wc-app-content .btn:focus:not(:focus-visible) {
    outline: none;
}

.wc-app-content .btn:active:not(:disabled):not(.disabled) {
    transform: scale(0.98);
    transition-duration: 0.08s;
}

.wc-app-content .btn-primary:hover:active:not(:disabled):not(.disabled) {
    transform: scale(0.98);
}

.wc-app-content .btn-primary {
    background: var(--wc-btn-primary-bg);
    border: none;
    box-shadow: var(--wc-btn-primary-shadow);
}

.wc-app-content .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--wc-btn-primary-shadow-hover);
}

.wc-app-content .btn-outline-secondary,
.wc-app-content .btn-outline-primary {
    background: rgba(255, 255, 255, 0.78);
    border-color: var(--wc-lux-line);
    color: var(--wc-lux-primary-dark);
    box-shadow: var(--wc-lux-shadow-sm);
}

.wc-app-content .btn-outline-secondary:hover,
.wc-app-content .btn-outline-primary:hover {
    background: #fff;
    border-color: #c9d7eb;
    color: var(--wc-lux-primary);
}

/* flashes inside shell */
.wc-app-content .app-flash {
    border-radius: var(--wc-lux-radius-md);
    box-shadow: var(--wc-lux-shadow-sm);
}

/* compact legal footer in shell */
.wc-app-footer-mini {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--wc-lux-line-soft);
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--wc-lux-muted);
}

.wc-app-footer-mini a {
    color: var(--wc-lux-muted);
    text-decoration: none;
    font-weight: 600;
}

.wc-app-footer-mini a:hover {
    color: var(--wc-lux-primary);
}

/* sidebar overlay (mobile / tablet) */
.wc-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: rgba(15, 27, 61, 0.48);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

body.wc-sidebar-open .wc-sidebar-backdrop {
    display: block;
}

body.wc-sidebar-open {
    overflow: hidden;
}

/* responsive */
@media (max-width: 991.98px) {
    .wc-app-shell {
        grid-template-columns: 1fr;
    }

    .wc-app-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: min(304px, 92vw);
        max-width: 100%;
        height: 100%;
        height: 100dvh;
        min-height: -webkit-fill-available;
        z-index: 1045;
        border-right: none;
        border-radius: 0;
        transform: translateX(-102%);
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 8px 0 40px rgba(0, 0, 0, 0.18);
        padding-top: max(12px, env(safe-area-inset-top, 0px));
        padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
        padding-left: max(14px, env(safe-area-inset-left, 0px));
        padding-right: max(14px, env(safe-area-inset-right, 0px));
    }

    body.wc-sidebar-open .wc-app-sidebar {
        transform: translateX(0);
    }

    .wc-app-header {
        align-items: center;
        flex-wrap: nowrap;
        gap: 10px;
        padding: max(14px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 14px max(14px, env(safe-area-inset-left, 0px));
    }

    .wc-app-page-title {
        font-size: clamp(1.15rem, 4.5vw, 1.65rem);
    }

    .wc-app-header-right {
        flex-shrink: 0;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 8px;
    }

    .wc-app-main {
        padding: 12px max(12px, env(safe-area-inset-right, 0px)) max(20px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
    }

    .wc-app-content .table-responsive {
        -webkit-overflow-scrolling: touch;
        border-radius: var(--wc-lux-radius-md);
    }

    .wc-app-footer-mini {
        padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
    }
}

@media (max-width: 575.98px) {
    .wc-header-action-book {
        min-width: 0;
    }

    .wc-app-header {
        flex-wrap: wrap;
    }

    .wc-app-header-left {
        flex: 1 1 calc(100% - 120px);
        min-width: 0;
    }

    .wc-app-header-right {
        flex: 1 1 100%;
        justify-content: stretch;
    }

    .wc-app-header-right .wc-btn-soft {
        flex: 1;
        min-width: 0;
    }
}
