/*
 * ZYNORA HR — Core Application Shell
 * Existing "nexora-" class names are temporarily retained as internal
 * compatibility hooks. All visible branding and design tokens are ZYNORA.
 */

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
    background: var(--zy-bg);
}

body {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 8% 0%, color-mix(in srgb, var(--brand-primary) 8%, transparent), transparent 28%),
        var(--zy-bg) !important;
    color: var(--zy-text) !important;
    font-family: var(--zy-font-ar) !important;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

html[lang="en"] body {
    font-family: var(--zy-font-ui) !important;
}

a {
    color: inherit;
}

button,
input,
select,
textarea {
    font: inherit;
}

.nexora-shell {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 100vh !important;
    display: grid !important;
    align-items: stretch !important;
    overflow-x: clip !important;
    background: transparent !important;
}

html[dir="rtl"] .nexora-shell {
    grid-template-columns: minmax(0, 1fr) var(--zy-sidebar-width) !important;
}

html[dir="ltr"] .nexora-shell {
    grid-template-columns: var(--zy-sidebar-width) minmax(0, 1fr) !important;
}

.nexora-sidebar {
    width: var(--zy-sidebar-width) !important;
    height: 100vh !important;
    min-height: 100vh !important;
    position: sticky !important;
    top: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: var(--zy-space-3) var(--zy-space-2) !important;
    background:
        radial-gradient(circle at 82% 0%, color-mix(in srgb, var(--brand-primary) 10%, transparent), transparent 30%),
        linear-gradient(180deg, var(--zy-midnight-navy), #06101F 100%) !important;
    border: 0 !important;
    color: var(--zy-cloud-white) !important;
    box-shadow: -8px 0 28px rgba(8, 20, 38, .20) !important;
    z-index: 30 !important;
}

html[dir="rtl"] .nexora-sidebar {
    grid-column: 2 !important;
    border-left: 1px solid rgba(217, 225, 232, .10) !important;
}

html[dir="ltr"] .nexora-sidebar {
    grid-column: 1 !important;
    border-right: 1px solid rgba(217, 225, 232, .10) !important;
}

.nexora-main {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
    overflow-x: clip !important;
    background: transparent !important;
}

html[dir="rtl"] .nexora-main {
    grid-column: 1 !important;
}

html[dir="ltr"] .nexora-main {
    grid-column: 2 !important;
}

.nexora-brand-card {
    display: block !important;
    margin: 0 var(--zy-space-1) var(--zy-space-3) !important;
    padding: var(--zy-space-2) var(--zy-space-2) var(--zy-space-3) !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(217, 225, 232, .12) !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.nexora-brand-link {
    display: block !important;
    text-decoration: none !important;
}

.nexora-brand-logo {
    display: block;
    width: min(100%, 222px);
    height: auto;
    margin-inline: auto;
}

.nexora-brand-tagline {
    display: block;
    margin-top: var(--zy-space-2);
    color: rgba(247, 249, 251, .66);
    font-family: var(--zy-font-ui);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .01em;
    text-align: center;
    direction: ltr;
}

.nexora-brand-symbol {
    width: 44px !important;
    height: 44px !important;
    border-radius: var(--zy-radius-lg) !important;
    box-shadow: none !important;
}

.nexora-wordmark {
    color: var(--zy-cloud-white) !important;
    font-family: var(--zy-font-display) !important;
    font-weight: 600 !important;
    letter-spacing: .12em !important;
}

.nexora-arabic {
    color: var(--zy-refined-aqua) !important;
}

.nexora-tagline {
    color: rgba(247, 249, 251, .62) !important;
}

.nexora-nav {
    display: grid !important;
    gap: var(--zy-space-2) !important;
}

.nexora-nav-group {
    margin: 0 !important;
    border: 1px solid rgba(217, 225, 232, .08) !important;
    border-radius: var(--zy-radius-lg) !important;
    background: rgba(247, 249, 251, .018) !important;
    overflow: clip !important;
}

.nexora-nav-group[open] {
    border-color: color-mix(in srgb, var(--brand-primary) 18%, transparent) !important;
    background: color-mix(in srgb, var(--brand-primary) 3.5%, transparent) !important;
}

.nexora-nav-link,
.nexora-nav-group > summary {
    min-height: 42px !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 9px 12px !important;
    border: 1px solid transparent !important;
    border-radius: var(--zy-radius-md) !important;
    color: rgba(247, 249, 251, .74) !important;
    background: transparent !important;
    text-decoration: none !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
    box-shadow: none !important;
    cursor: pointer !important;
    transition:
        color var(--zy-duration-fast) var(--zy-ease),
        background-color var(--zy-duration-fast) var(--zy-ease),
        border-color var(--zy-duration-fast) var(--zy-ease) !important;
}

.nexora-nav-group > summary {
    list-style: none !important;
    color: rgba(247, 249, 251, .88) !important;
}

.nexora-nav-group > summary::-webkit-details-marker {
    display: none !important;
}

.nexora-nav-link:hover,
.nexora-nav-group > summary:hover {
    color: var(--zy-cloud-white) !important;
    background: rgba(247, 249, 251, .05) !important;
    border-color: rgba(217, 225, 232, .10) !important;
}

.nexora-nav-link.active,
.nexora-nav-link.nexora-active,
.nexora-nav-link[aria-current="page"] {
    color: var(--zy-midnight-navy) !important;
    background: var(--zy-electric-teal) !important;
    border-color: rgba(66, 222, 211, .68) !important;
    box-shadow: 0 8px 20px color-mix(in srgb, var(--brand-primary) 14%, transparent) !important;
}

.nexora-nav-link.active span,
.nexora-nav-link.nexora-active span,
.nexora-nav-link[aria-current="page"] span {
    color: var(--zy-midnight-navy) !important;
}

.nexora-nav-group-links {
    display: grid !important;
    gap: var(--zy-space-1) !important;
    padding: 0 var(--zy-space-2) var(--zy-space-2) !important;
    background: transparent !important;
}

.nexora-nav-group-links .nexora-nav-link {
    min-height: 36px !important;
    padding: 7px 11px !important;
    font-size: 12px !important;
    font-weight: 650 !important;
}

.nexora-nav-dot {
    width: 8px !important;
    height: 8px !important;
    flex: 0 0 8px !important;
    border-radius: 2px !important;
    background: var(--zy-electric-teal) !important;
    box-shadow: none !important;
}

.nexora-nav-dot.gold {
    background: var(--zy-champagne-gold) !important;
}

.nexora-chevron {
    width: 7px !important;
    height: 7px !important;
    margin-inline-start: auto !important;
    border-inline-end: 1.5px solid rgba(247, 249, 251, .55) !important;
    border-bottom: 1.5px solid rgba(247, 249, 251, .55) !important;
    transform: rotate(45deg) !important;
    transition: transform var(--zy-duration-fast) var(--zy-ease) !important;
}

.nexora-nav-group[open] .nexora-chevron {
    transform: rotate(225deg) !important;
}

.nexora-topbar {
    min-height: var(--zy-topbar-height) !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 20 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: var(--zy-space-3) !important;
    padding: 12px var(--zy-space-4) !important;
    background: color-mix(in srgb, var(--zy-bg-elevated) 92%, transparent) !important;
    border-bottom: 1px solid var(--zy-border) !important;
    backdrop-filter: blur(16px) !important;
}

.nexora-topbar-left {
    min-width: 0;
}

.nexora-page-title {
    color: var(--zy-text) !important;
    font-family: var(--zy-font-ar) !important;
    font-size: 18px !important;
    font-weight: 800 !important;
    line-height: 1.25 !important;
}

html[lang="en"] .nexora-page-title {
    font-family: var(--zy-font-display) !important;
}

.nexora-page-subtitle {
    margin-top: 3px !important;
    color: var(--zy-text-muted) !important;
    font-size: 11px !important;
    font-weight: 600 !important;
}

.nexora-controls {
    display: flex !important;
    align-items: center !important;
    gap: var(--zy-space-2) !important;
    flex-wrap: wrap !important;
}

.nexora-user-chip,
.nexora-pill-button {
    min-height: 40px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: var(--zy-space-2) !important;
    padding: 7px 11px !important;
    border: 1px solid var(--zy-border) !important;
    border-radius: var(--zy-radius-lg) !important;
    background: var(--zy-surface) !important;
    color: var(--zy-text) !important;
    text-decoration: none !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    box-shadow: var(--zy-shadow-sm) !important;
}

.nexora-pill-button:hover {
    border-color: var(--zy-border-strong) !important;
    background: var(--zy-surface-raised) !important;
}

.nexora-user-avatar {
    width: 28px !important;
    height: 28px !important;
    display: inline-grid !important;
    place-items: center !important;
    border-radius: var(--zy-radius-md) !important;
    background: var(--zy-electric-teal) !important;
    color: var(--zy-midnight-navy) !important;
    font-family: var(--zy-font-ui) !important;
    font-weight: 800 !important;
}

.nexora-user-name {
    color: var(--zy-text) !important;
}

.nexora-user-role {
    color: var(--zy-text-muted) !important;
    font-size: 10px !important;
}

.nexora-content {
    width: 100% !important;
    max-width: var(--zy-content-max) !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
    margin-inline: auto !important;
    padding: var(--zy-space-4) !important;
    overflow-x: clip !important;
    scroll-padding-top:
        calc(var(--zy-topbar-height) + var(--zy-space-3));
    background: transparent !important;
}

.nexora-content > * {
    min-width: 0;
    max-width: 100%;
}

[data-sidebar-toggle] {
    display: none !important;
}

:where(a, button, input, select, textarea, summary):focus-visible {
    outline: 0 !important;
    box-shadow: var(--zy-focus-ring) !important;
}

@media (max-width: 980px) {
    .nexora-shell,
    html[dir="rtl"] .nexora-shell,
    html[dir="ltr"] .nexora-shell {
        display: block !important;
    }

    .nexora-sidebar {
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: 48vh !important;
        position: relative !important;
        padding: var(--zy-space-2) !important;
        border: 0 !important;
        border-bottom: 1px solid rgba(217, 225, 232, .10) !important;
        box-shadow: none !important;
    }

    .nexora-brand-card {
        margin-bottom: var(--zy-space-2) !important;
        padding-bottom: var(--zy-space-2) !important;
    }

    .nexora-brand-logo {
        width: min(100%, 190px);
    }

    .nexora-topbar {
        position: relative !important;
        min-height: auto !important;
        align-items: flex-start !important;
        padding: var(--zy-space-3) !important;
    }

    .nexora-controls {
        justify-content: flex-end !important;
    }

    .nexora-content {
        padding: var(--zy-space-3) !important;
    }
}

@media (max-width: 640px) {
    .nexora-topbar {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }

    .nexora-controls {
        justify-content: flex-start !important;
    }

    .nexora-user-role {
        display: none !important;
    }

    .nexora-content {
        padding: 12px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* ZYNORA_PHASE1B_SHELL_POLISH_START */

.nexora-main {
    background:
        radial-gradient(circle at 8% -8%, color-mix(in srgb, var(--brand-primary) 7%, transparent), transparent 28%),
        var(--zy-bg) !important;
}

.nexora-topbar {
    box-shadow: 0 1px 0 rgba(8, 20, 38, .03) !important;
}

html[data-theme="light"] .nexora-topbar {
    background: rgba(247, 249, 251, .92) !important;
}

html[data-theme="dark"] .nexora-topbar {
    background: rgba(16, 28, 48, .92) !important;
}

.nexora-topbar-left {
    display: flex;
    align-items: center;
    min-width: 0;
}

.nexora-page-title {
    font-size: 20px !important;
    letter-spacing: -.01em;
}

.nexora-page-subtitle {
    color: var(--zy-text-muted) !important;
}

.nexora-controls {
    flex-wrap: nowrap !important;
}

.nexora-user-copy {
    min-width: 0;
    display: grid;
    gap: 1px;
}

.nexora-user-name,
.nexora-user-role {
    display: block;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nexora-user-name {
    font-weight: 800 !important;
}

.nexora-user-role {
    color: var(--zy-text-muted) !important;
}

.nexora-theme-toggle {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--zy-border);
    border-radius: var(--zy-radius-lg);
    background: var(--zy-surface);
    color: var(--zy-text);
    cursor: pointer;
    box-shadow: var(--zy-shadow-sm);
    transition:
        transform var(--zy-duration-fast) var(--zy-ease),
        border-color var(--zy-duration-fast) var(--zy-ease),
        background-color var(--zy-duration-fast) var(--zy-ease);
}

.nexora-theme-toggle:hover {
    transform: translateY(-1px);
    border-color: var(--zy-border-strong);
    background: var(--zy-surface-raised);
}

.nexora-theme-icon {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nexora-theme-icon--sun {
    display: none;
}

html[data-theme="dark"] .nexora-theme-icon--sun {
    display: block;
}

html[data-theme="dark"] .nexora-theme-icon--moon {
    display: none;
}

.nexora-logout-button {
    color: var(--zy-danger) !important;
}

.nexora-logout-button:hover {
    border-color: rgba(217, 79, 92, .28) !important;
    background: var(--zy-danger-soft) !important;
}

.nexora-nav-dot {
    --zy-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='4' y='4' width='6' height='6' rx='1.5'/%3E%3Crect x='14' y='4' width='6' height='6' rx='1.5'/%3E%3Crect x='4' y='14' width='6' height='6' rx='1.5'/%3E%3Crect x='14' y='14' width='6' height='6' rx='1.5'/%3E%3C/svg%3E");
    width: 19px !important;
    height: 19px !important;
    flex: 0 0 19px !important;
    border-radius: 0 !important;
    background: currentColor !important;
    box-shadow: none !important;
    -webkit-mask: var(--zy-nav-icon) center / contain no-repeat;
    mask: var(--zy-nav-icon) center / contain no-repeat;
}

[data-nav-area="setup"] .nexora-nav-dot {
    --zy-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h16M6 20V8l6-4 6 4v12M9 20v-5h6v5M9 10h.01M12 10h.01M15 10h.01'/%3E%3C/svg%3E");
}

[data-nav-area="identity"] .nexora-nav-dot {
    --zy-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8M17 11l2 2 4-4'/%3E%3C/svg%3E");
}

[data-nav-area="people"] .nexora-nav-dot {
    --zy-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2M8.5 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8M17 11a3 3 0 1 0 0-6M23 21v-2a4 4 0 0 0-3-3.87'/%3E%3C/svg%3E");
}

[data-nav-area="attendance"] .nexora-nav-dot {
    --zy-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M16 3v4M8 3v4M3 10h18M8 15l2 2 4-4'/%3E%3C/svg%3E");
}

[data-nav-area="payroll"] .nexora-nav-dot {
    --zy-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6h15a2 2 0 0 1 2 2v10H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h13M15 11h6v4h-6a2 2 0 0 1 0-4Z'/%3E%3C/svg%3E");
}

.nexora-nav-dot.gold {
    color: var(--zy-champagne-gold);
}

.nexora-nav-link.active .nexora-nav-dot,
.nexora-nav-link.nexora-active .nexora-nav-dot,
.nexora-nav-link[aria-current="page"] .nexora-nav-dot {
    color: var(--zy-midnight-navy);
}

.nexora-nav-group[open] > summary .nexora-nav-dot {
    color: var(--zy-electric-teal);
}

.nexora-content {
    scrollbar-color: color-mix(in srgb, var(--brand-primary) 35%, transparent) transparent;
}

@media (max-width: 760px) {
    .nexora-controls {
        width: 100%;
        flex-wrap: wrap !important;
    }

    .nexora-user-chip {
        min-width: 0;
        flex: 1 1 auto;
    }

    .nexora-user-name,
    .nexora-user-role {
        max-width: 130px;
    }
}

/* ZYNORA_PHASE1B_SHELL_POLISH_END */

/* ==========================================================================
   NEXORA_SIDEBAR_LIGHT — نسخة الثيم الفاتح للقائمة الجانبية (2026-07)
   السايدبار كان دارك ثابتاً على الثيمين. بالفاتح: أبيض بحدود ونصوص غامقة،
   والرابط النشط يبقى تركوازياً.
   ========================================================================== */
html[data-theme="light"] .nexora-sidebar {
    background: #ffffff !important;
    color: #0b2239 !important;
    box-shadow: -6px 0 22px rgba(15, 40, 70, .07) !important;
}
html[data-theme="light"][dir="rtl"] .nexora-sidebar { border-left: 1px solid rgba(15, 60, 100, .12) !important; }
html[data-theme="light"][dir="ltr"] .nexora-sidebar { border-right: 1px solid rgba(15, 60, 100, .12) !important; }

html[data-theme="light"] .nexora-nav-link,
html[data-theme="light"] .nexora-nav-group > summary {
    color: rgba(11, 34, 57, .72) !important;
}
html[data-theme="light"] .nexora-nav-group > summary { color: rgba(11, 34, 57, .9) !important; }

html[data-theme="light"] .nexora-nav-link:hover,
html[data-theme="light"] .nexora-nav-group > summary:hover {
    color: #0b2239 !important;
    background: color-mix(in srgb, var(--brand-primary) 8%, transparent) !important;
    border-color: color-mix(in srgb, var(--brand-primary) 18%, transparent) !important;
}

html[data-theme="light"] .nexora-nav-group {
    border-color: rgba(15, 60, 100, .1) !important;
    background: rgba(15, 60, 100, .02) !important;
}
html[data-theme="light"] .nexora-nav-group[open] {
    border-color: color-mix(in srgb, var(--brand-primary) 28%, transparent) !important;
    background: color-mix(in srgb, var(--brand-primary) 5%, transparent) !important;
}

/* الرابط النشط: تركوازي بنص غامق — نفس هوية الدارك، مقروء بالفاتح */
html[data-theme="light"] .nexora-nav-link.active,
html[data-theme="light"] .nexora-nav-link.nexora-active,
html[data-theme="light"] .nexora-nav-link[aria-current="page"] {
    color: #04141F !important;
    background: var(--zy-electric-teal) !important;
}

/* الشعار: نسخة النص الغامق على الثيم الفاتح (الافتراضية نصها أبيض للسايدبار الغامق) */
html[data-theme="light"] .nexora-brand-logo {
    content: url("/brand/zynora-logo-horizontal-dark.svg");
}
html[data-theme="light"] .nexora-brand-tagline { color: #64748b !important; }
