﻿        @font-face {
            font-family: 'Vazir';
            src: url('/fonts/Vazir-Bold.woff') format('woff');
            font-weight: bold;
            font-style: normal;
        }
        
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Vazir', Tahoma, Arial, sans-serif;
        }

        :root {
            color-scheme: dark light;
        }
        
        body {
            overflow: hidden;
            scrollbar-width: none;
            -ms-overflow-style: none;
        }

        ::-webkit-scrollbar,
        *::-webkit-scrollbar {
            display: none;
            width: 0;
            height: 0;
        }

        .topology-background {
            position: fixed;
            inset: 0;
            z-index: -6;
            background: linear-gradient(180deg, #050816 0%, #0a1020 45%, #071016 100%);
        }

        .topology-background canvas {
            position: absolute !important;
            inset: 0;
            width: 100% !important;
            height: 100% !important;
            display: block;
        }

        .topology-overlay {
            position: fixed;
            inset: 0;
            z-index: -5;
            pointer-events: none;
            background:
                radial-gradient(circle at 12% 16%, rgba(20, 255, 186, 0.14), transparent 34%),
                radial-gradient(circle at 84% 12%, rgba(0, 165, 255, 0.12), transparent 36%),
                linear-gradient(180deg, rgba(2, 10, 24, 0.42) 0%, rgba(3, 10, 20, 0.56) 100%);
        }
        
        /* شفق قطبی Aurora Borealis */
        .aurora-background {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background:
                radial-gradient(circle at 50% 115%, rgba(0, 112, 128, 0.35), transparent 38%),
                radial-gradient(circle at 15% 20%, rgba(87, 43, 180, 0.18), transparent 28%),
                linear-gradient(180deg, #050816 0%, #0a0e27 34%, #101936 62%, #071016 100%);
            z-index: -5;
        }
        
        .stars-layer {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: -3;
            opacity: 0.58;
        }
        
        .star {
            position: absolute;
            width: 2px;
            height: 2px;
            background: white;
            border-radius: 50%;
            animation: twinkle 3s infinite;
        }
        
        @keyframes twinkle {
            0%, 100% { opacity: 0.3; }
            50% { opacity: 1; }
        }
        
        .aurora-layer {
            position: fixed;
            inset: 0;
            z-index: -2;
            overflow: hidden;
            opacity: 1;
            pointer-events: none;
            mix-blend-mode: screen;
        }

        .aurora-layer::before,
        .aurora-layer::after {
            content: "";
            position: absolute;
            left: -24%;
            width: 148%;
            height: 88%;
            border-radius: 50%;
            filter: blur(46px) saturate(170%);
            opacity: 0.9;
            transform-origin: 50% 0%;
            will-change: transform, opacity, filter;
            -webkit-mask-image: radial-gradient(ellipse at 50% 34%, #000 0%, rgba(0, 0, 0, 0.92) 38%, rgba(0, 0, 0, 0.34) 62%, transparent 82%);
            mask-image: radial-gradient(ellipse at 50% 34%, #000 0%, rgba(0, 0, 0, 0.92) 38%, rgba(0, 0, 0, 0.34) 62%, transparent 82%);
        }

        .aurora-layer::before {
            top: -18%;
            background:
                radial-gradient(ellipse at 18% 52%, rgba(0, 255, 155, 0.48), transparent 38%),
                radial-gradient(ellipse at 52% 30%, rgba(0, 255, 190, 0.62), transparent 42%),
                radial-gradient(ellipse at 79% 40%, rgba(104, 70, 255, 0.54), transparent 43%),
                linear-gradient(102deg, transparent 0%, rgba(0, 255, 143, 0.12) 11%, rgba(0, 255, 162, 0.58) 24%, rgba(111, 255, 206, 0.28) 36%, rgba(124, 82, 255, 0.52) 52%, rgba(0, 210, 255, 0.28) 66%, transparent 84%);
            animation: auroraCurtain 16s ease-in-out infinite alternate;
        }

        .aurora-layer::after {
            top: -4%;
            background:
                radial-gradient(ellipse at 25% 38%, rgba(108, 82, 255, 0.45), transparent 44%),
                radial-gradient(ellipse at 47% 55%, rgba(0, 255, 176, 0.50), transparent 45%),
                radial-gradient(ellipse at 73% 50%, rgba(0, 186, 255, 0.34), transparent 44%),
                linear-gradient(84deg, transparent 4%, rgba(130, 60, 255, 0.40) 18%, rgba(0, 255, 176, 0.54) 36%, rgba(0, 195, 255, 0.36) 56%, rgba(176, 72, 255, 0.30) 72%, transparent 91%);
            animation: auroraCurtainAlt 22s ease-in-out infinite alternate;
        }
        
        .aurora-wave {
            position: absolute;
            left: -22%;
            width: 144%;
            height: 86%;
            border-radius: 50%;
            filter: blur(64px) saturate(178%);
            opacity: 0.9;
            will-change: transform, opacity;
            -webkit-mask-image: radial-gradient(ellipse at 50% 42%, #000 0%, rgba(0, 0, 0, 0.82) 42%, rgba(0, 0, 0, 0.28) 67%, transparent 86%);
            mask-image: radial-gradient(ellipse at 50% 42%, #000 0%, rgba(0, 0, 0, 0.82) 42%, rgba(0, 0, 0, 0.28) 67%, transparent 86%);
        }
        
        .wave1 {
            top: -2%;
            background:
                radial-gradient(ellipse at 18% 38%, rgba(0, 255, 136, 0.56) 0%, transparent 42%),
                radial-gradient(ellipse at 48% 30%, rgba(35, 255, 184, 0.52) 0%, transparent 40%),
                radial-gradient(ellipse at 78% 35%, rgba(0, 214, 255, 0.38) 0%, transparent 42%);
            animation: wave1 18s ease-in-out infinite alternate;
        }
        
        .wave2 {
            top: 8%;
            background:
                radial-gradient(ellipse at 24% 36%, rgba(132, 80, 255, 0.46) 0%, transparent 41%),
                radial-gradient(ellipse at 44% 48%, rgba(0, 255, 136, 0.60) 0%, transparent 43%),
                radial-gradient(ellipse at 68% 42%, rgba(0, 204, 255, 0.48) 0%, transparent 42%),
                linear-gradient(98deg, transparent 3%, rgba(0, 255, 170, 0.14) 15%, rgba(0, 255, 136, 0.50) 28%, rgba(130, 80, 255, 0.42) 46%, rgba(0, 204, 255, 0.32) 63%, transparent 90%);
            animation: wave2 14s ease-in-out infinite alternate;
        }
        
        .wave3 {
            top: 18%;
            background:
                radial-gradient(ellipse at 28% 45%, rgba(0, 255, 190, 0.28) 0%, transparent 40%),
                radial-gradient(ellipse at 62% 38%, rgba(132, 67, 255, 0.38) 0%, transparent 36%),
                radial-gradient(ellipse at 86% 48%, rgba(20, 255, 150, 0.27) 0%, transparent 38%);
            animation: wave3 24s ease-in-out infinite alternate;
        }
        
        .wave4 {
            top: 0;
            background:
                radial-gradient(ellipse at 20% 48%, rgba(151, 255, 220, 0.18) 0%, transparent 38%),
                radial-gradient(ellipse at 51% 45%, rgba(137, 77, 255, 0.18) 0%, transparent 40%),
                radial-gradient(ellipse at 82% 52%, rgba(0, 255, 180, 0.16) 0%, transparent 40%);
            opacity: 0.58;
            filter: blur(28px) saturate(150%);
            animation: auroraRays 11s ease-in-out infinite alternate;
        }

        .aurora-mist {
            display: none;
        }

        @keyframes auroraCurtain {
            0% { transform: translate3d(-3%, 0, 0) skewX(-8deg) scaleY(0.92); opacity: 0.70; filter: blur(34px) saturate(140%); }
            45% { transform: translate3d(2%, 8%, 0) skewX(5deg) scaleY(1.08); opacity: 0.95; filter: blur(24px) saturate(185%); }
            100% { transform: translate3d(5%, -2%, 0) skewX(-3deg) scaleY(1); opacity: 0.82; filter: blur(30px) saturate(160%); }
        }

        @keyframes auroraCurtainAlt {
            0% { transform: translate3d(5%, 5%, 0) skewX(6deg) scaleY(1.02); opacity: 0.56; }
            50% { transform: translate3d(-2%, 13%, 0) skewX(-5deg) scaleY(1.18); opacity: 0.86; }
            100% { transform: translate3d(-6%, 2%, 0) skewX(3deg) scaleY(0.98); opacity: 0.68; }
        }
        
        @keyframes wave1 {
            0% { transform: translate3d(-2%, 0, 0) rotate(-1deg) scale(1); opacity: 0.72; }
            50% { transform: translate3d(3%, 8%, 0) rotate(2deg) scale(1.08); opacity: 1; }
            100% { transform: translate3d(7%, 1%, 0) rotate(-1deg) scale(1.03); opacity: 0.86; }
        }
        
        @keyframes wave2 {
            0% { transform: translate3d(6%, -2%, 0) skewX(4deg) scaleY(0.96); opacity: 0.62; }
            50% { transform: translate3d(-4%, 10%, 0) skewX(-5deg) scaleY(1.18); opacity: 0.96; }
            100% { transform: translate3d(-8%, 2%, 0) skewX(2deg) scaleY(1.04); opacity: 0.78; }
        }
        
        @keyframes wave3 {
            0% { transform: translate3d(-5%, 0, 0) scale(1); opacity: 0.40; }
            50% { transform: translate3d(4%, -5%, 0) scale(1.14); opacity: 0.78; }
            100% { transform: translate3d(8%, 4%, 0) scale(1.04); opacity: 0.52; }
        }
        
        @keyframes auroraRays {
            0% { transform: translateX(-5%) skewX(-7deg); opacity: 0.26; }
            50% { transform: translateX(3%) skewX(5deg); opacity: 0.62; }
            100% { transform: translateX(8%) skewX(-2deg); opacity: 0.38; }
        }
        
        /* صفحه لاگین */
        #login-page {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: opacity 0.5s ease, visibility 0.5s ease;
        }
        
        #login-page.hidden {
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
        }
        
        .login-container {
            direction: ltr;
            width: min(1120px, calc(100% - 48px));
            min-height: 620px;
            display: grid;
            grid-template-columns: minmax(360px, 0.95fr) minmax(420px, 1.05fr);
            gap: 18px;
            background: linear-gradient(145deg, rgba(7, 14, 29, 0.92), rgba(10, 22, 37, 0.90));
            backdrop-filter: blur(34px);
            -webkit-backdrop-filter: blur(34px);
            border-radius: 34px;
            padding: 18px;
            border: 1px solid rgba(255, 255, 255, 0.14);
            box-shadow: 0 34px 94px rgba(0, 0, 0, 0.62), inset 0 1px 0 rgba(255, 255, 255, 0.1);
            animation: slideIn 0.8s ease;
            overflow: hidden;
        }
        
        @keyframes slideIn {
            from {
                opacity: 0;
                transform: translateY(-50px) scale(0.9);
            }
            to {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }
        
        .login-form-panel,
        .login-info-panel {
            direction: rtl;
            position: relative;
            min-width: 0;
        }

        .login-form-panel {
            display: flex;
            flex-direction: column;
            justify-content: center;
            padding: 52px 44px;
            background: rgba(8, 20, 34, 0.72);
            border: 1px solid rgba(255, 255, 255, 0.14);
            border-radius: 28px;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.11);
        }

        .login-info-panel {
            padding: 54px 48px;
            border-radius: 28px;
            overflow: hidden;
            background:
                linear-gradient(145deg, rgba(0, 255, 136, 0.16), rgba(0, 204, 255, 0.08) 46%, rgba(118, 69, 255, 0.16)),
                rgba(8, 18, 31, 0.88);
            border: 1px solid rgba(0, 255, 190, 0.18);
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.13), 0 24px 70px rgba(0, 0, 0, 0.28);
        }

        .login-info-panel::before {
            content: "";
            position: absolute;
            inset: -30% -20% auto auto;
            width: 360px;
            height: 360px;
            background: radial-gradient(circle, rgba(0, 255, 136, 0.28), transparent 66%);
            filter: blur(10px);
        }

        .login-info-panel::after {
            content: "";
            position: absolute;
            inset: auto auto -34% -24%;
            width: 420px;
            height: 420px;
            background: radial-gradient(circle, rgba(124, 58, 237, 0.24), transparent 68%);
            filter: blur(14px);
        }

        .system-mark {
            position: relative;
            width: 86px;
            height: 86px;
            border-radius: 28px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: linear-gradient(135deg, rgba(0, 255, 136, 0.95), rgba(0, 204, 255, 0.94));
            box-shadow: 0 0 42px rgba(0, 255, 136, 0.36);
            animation: logoGlow 3s ease-in-out infinite;
        }

        @keyframes logoGlow {
            0%, 100% { box-shadow: 0 0 34px rgba(0, 255, 136, 0.36); }
            50% { box-shadow: 0 0 58px rgba(0, 255, 190, 0.64); }
        }
        
        .system-mark svg {
            width: 46px;
            height: 46px;
            color: #061322;
            stroke-width: 1.8;
        }
        
        .login-header h2 {
            color: #fff;
            text-align: right;
            font-size: 30px;
            line-height: 1.45;
            margin: 28px 0 10px;
            letter-spacing: -0.4px;
            text-shadow: 0 0 22px rgba(0, 255, 136, 0.32);
        }
        
        .login-header p {
            color: rgba(255, 255, 255, 0.7);
            text-align: right;
            margin-bottom: 34px;
            font-size: 14px;
            line-height: 2;
        }
        
        .form-group {
            margin-bottom: 25px;
        }
        
        .form-group label {
            display: block;
            color: rgba(255, 255, 255, 0.9);
            margin-bottom: 10px;
            font-size: 14px;
            font-weight: bold;
        }
        
        .input-wrapper {
            position: relative;
        }
        
        .input-wrapper input {
            width: 100%;
            padding: 15px 50px 15px 20px;
            background: rgba(255, 255, 255, 0.05);
            border: 2px solid rgba(255, 255, 255, 0.1);
            border-radius: 15px;
            color: #fff;
            font-size: 15px;
            transition: all 0.3s ease;
            outline: none;
        }
        
        .input-wrapper input::placeholder {
            color: rgba(255, 255, 255, 0.4);
        }
        
        .input-wrapper input:focus {
            background: rgba(255, 255, 255, 0.1);
            border-color: #00ff88;
            box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
        }
        
        .input-wrapper .input-icon {
            position: absolute;
            left: 20px;
            top: 50%;
            transform: translateY(-50%);
            width: 24px;
            height: 24px;
            color: rgba(0, 255, 190, 0.86);
        }

        .input-wrapper .input-icon svg {
            width: 24px;
            height: 24px;
            display: block;
            stroke-width: 1.8;
        }
        
        .remember-me {
            display: flex;
            align-items: center;
            gap: 10px;
            margin: 20px 0 30px;
        }
        
        .remember-me input[type="checkbox"] {
            width: 20px;
            height: 20px;
            cursor: pointer;
        }
        
        .remember-me label {
            color: rgba(255, 255, 255, 0.9);
            font-size: 14px;
            cursor: pointer;
            margin: 0;
        }
        
        .btn-login {
            width: 100%;
            padding: 16px;
            background: linear-gradient(135deg, #00ff88 0%, #00ccff 100%);
            border: none;
            border-radius: 15px;
            color: #0a0e27;
            font-size: 16px;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 10px 30px rgba(0, 255, 136, 0.3);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
        }

        .btn-login svg {
            width: 21px;
            height: 21px;
            stroke-width: 2;
        }
        
        .btn-login:hover {
            transform: translateY(-3px);
            box-shadow: 0 15px 40px rgba(0, 255, 136, 0.5);
        }
        
        .btn-login:active {
            transform: translateY(-1px);
        }
        
        .login-alert-hidden {
            display: none;
        }

        .alert {
            padding: 15px;
            background: rgba(255, 50, 50, 0.2);
            border: 1px solid rgba(255, 50, 50, 0.5);
            border-radius: 10px;
            color: #fff;
            margin-bottom: 20px;
            font-size: 14px;
            animation: shake 0.5s ease;
        }
        
        @keyframes shake {
            0%, 100% { transform: translateX(0); }
            25% { transform: translateX(-10px); }
            75% { transform: translateX(10px); }
        }

        .asset-cache-modal {
            position: fixed;
            inset: 0;
            z-index: 50;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 24px;
            background: rgba(3, 9, 18, 0.72);
            backdrop-filter: blur(18px);
            -webkit-backdrop-filter: blur(18px);
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
            transition: opacity 360ms ease, visibility 360ms ease;
        }

        .asset-cache-modal.active {
            opacity: 1;
            visibility: visible;
            pointer-events: auto;
        }

        .asset-cache-card {
            width: min(520px, 100%);
            padding: 30px;
            border-radius: 28px;
            background: linear-gradient(145deg, rgba(8, 20, 36, 0.92), rgba(8, 28, 42, 0.82));
            border: 1px solid rgba(255, 255, 255, 0.11);
            box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.08);
            color: #fff;
        }

        .asset-cache-header {
            display: flex;
            align-items: center;
            gap: 16px;
            margin-bottom: 22px;
        }

        .asset-cache-icon {
            width: 58px;
            height: 58px;
            min-width: 58px;
            border-radius: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #061322;
            background: linear-gradient(135deg, #00ff88 0%, #00ccff 100%);
            box-shadow: 0 0 36px rgba(0, 255, 184, 0.32);
        }

        .asset-cache-icon svg {
            width: 31px;
            height: 31px;
            stroke-width: 1.9;
        }

        .asset-cache-title {
            margin: 0 0 6px;
            font-size: 18px;
            line-height: 1.8;
        }

        .asset-cache-subtitle {
            margin: 0;
            color: rgba(255, 255, 255, 0.62);
            font-size: 12px;
            line-height: 1.9;
        }

        .asset-cache-progress-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 10px;
            color: rgba(255, 255, 255, 0.72);
            font-size: 12px;
        }

        .asset-cache-percent {
            color: #00ffb8;
            font-size: 19px;
        }

        .asset-cache-track {
            height: 12px;
            overflow: hidden;
            border-radius: 999px;
            background: rgba(255, 255, 255, 0.09);
            border: 1px solid rgba(255, 255, 255, 0.08);
        }

        .asset-cache-bar {
            width: 0%;
            height: 100%;
            border-radius: inherit;
            background: linear-gradient(90deg, #00ff88 0%, #00ccff 100%);
            box-shadow: 0 0 24px rgba(0, 255, 184, 0.36);
            transition: width 220ms ease;
        }

        .asset-cache-file {
            min-height: 24px;
            margin-top: 14px;
            direction: ltr;
            text-align: left;
            color: rgba(255, 255, 255, 0.52);
            font-size: 11px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .asset-cache-error {
            display: none;
            margin-top: 14px;
            padding: 12px 14px;
            border-radius: 14px;
            color: #fff;
            background: rgba(255, 70, 90, 0.18);
            border: 1px solid rgba(255, 70, 90, 0.32);
            font-size: 12px;
            line-height: 1.9;
        }

        .system-kicker {
            position: relative;
            display: inline-flex;
            align-items: center;
            gap: 10px;
            color: rgba(255, 255, 255, 0.78);
            font-size: 13px;
            letter-spacing: 0.3px;
            padding: 9px 14px;
            border-radius: 999px;
            background: rgba(255, 255, 255, 0.08);
            border: 1px solid rgba(255, 255, 255, 0.12);
        }

        .system-kicker svg {
            width: 18px;
            height: 18px;
            color: #00ffb8;
        }

        .system-title {
            position: relative;
            color: #ffffff;
            font-size: 34px;
            line-height: 1.65;
            margin: 28px 0 12px;
            letter-spacing: -0.5px;
        }

        .system-description {
            position: relative;
            color: rgba(255, 255, 255, 0.75);
            font-size: 15px;
            line-height: 2.15;
            max-width: 470px;
            margin-bottom: 34px;
        }

        .feature-list {
            position: relative;
            display: grid;
            gap: 14px;
            margin-bottom: 34px;
        }

        .feature-item {
            display: flex;
            align-items: center;
            gap: 14px;
            padding: 14px 16px;
            border-radius: 18px;
            background: rgba(255, 255, 255, 0.075);
            border: 1px solid rgba(255, 255, 255, 0.1);
        }

        .feature-icon {
            width: 42px;
            height: 42px;
            min-width: 42px;
            border-radius: 14px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #00ffb8;
            background: rgba(0, 255, 184, 0.1);
            border: 1px solid rgba(0, 255, 184, 0.18);
        }

        .feature-icon svg {
            width: 23px;
            height: 23px;
            stroke-width: 1.8;
        }

        .feature-item strong {
            display: block;
            color: #fff;
            font-size: 14px;
            margin-bottom: 4px;
        }

        .feature-item span {
            display: block;
            color: rgba(255, 255, 255, 0.62);
            font-size: 12px;
            line-height: 1.8;
        }

        .system-specs {
            position: relative;
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 12px;
        }

        .spec-card {
            padding: 16px 12px;
            border-radius: 18px;
            background: rgba(4, 12, 24, 0.34);
            border: 1px solid rgba(255, 255, 255, 0.1);
        }

        .spec-card strong {
            display: block;
            color: #ffffff;
            font-size: 17px;
            margin-bottom: 8px;
        }

        .spec-card span {
            display: block;
            color: rgba(255, 255, 255, 0.58);
            font-size: 11px;
            line-height: 1.7;
        }

        .menu-icon {
            width: 24px;
            height: 24px;
            min-width: 24px;
            color: currentColor;
        }

        .menu-icon svg {
            width: 24px;
            height: 24px;
            display: block;
            stroke-width: 1.8;
        }

        .logout-icon {
            width: 20px;
            height: 20px;
            vertical-align: middle;
            margin-left: 8px;
            stroke-width: 2;
        }

        @media (max-width: 1460px) and (min-width: 961px) {
            .sidebar {
                width: 260px;
                min-width: 260px;
                max-width: 260px;
            }

            .main-content {
                width: calc(100vw - 260px);
            }

            .top-header {
                padding: 16px 20px;
            }

            .content-area {
                padding: 20px;
            }
        }

        @media (max-width: 1280px) and (min-width: 961px) {
            .sidebar {
                width: 240px;
                min-width: 240px;
                max-width: 240px;
            }

            .main-content {
                width: calc(100vw - 240px);
            }

            .sidebar-header {
                padding: 18px 16px 14px;
            }

            .user-info {
                margin: 12px;
                padding: 12px;
            }

            .menu-item {
                padding: 12px 12px;
                gap: 10px;
                font-size: 13px;
            }

            .top-header {
                min-height: 74px;
                padding: 14px 16px;
            }

            .header-title h1 {
                font-size: 21px;
            }

            .content-area {
                padding: 16px;
            }
        }

        @media (max-height: 860px) and (min-width: 961px) {
            #login-page {
                padding: 14px;
            }

            .login-container {
                min-height: min(620px, calc(100vh - 28px));
                padding: 14px;
            }

            .login-form-panel {
                padding: 34px 30px;
            }

            .login-info-panel {
                padding: 38px 34px;
            }

            .system-title {
                font-size: 30px;
                margin: 20px 0 10px;
            }

            .feature-list {
                margin-bottom: 22px;
                gap: 10px;
            }
        }

        @media (max-width: 960px) {
            body {
                overflow-y: auto;
            }

            .login-container {
                width: min(560px, calc(100% - 28px));
                min-height: auto;
                grid-template-columns: 1fr;
                padding: 14px;
                margin: 28px 0;
            }

            .login-form-panel {
                order: 2;
                padding: 38px 24px;
            }

            .login-info-panel {
                order: 1;
                padding: 36px 24px;
            }

            #login-page {
                position: relative;
                min-height: 100vh;
                height: auto;
                padding: 22px 0;
            }

            .system-title {
                font-size: 26px;
            }

            .system-specs {
                grid-template-columns: 1fr;
            }
        }
        
        /* صفحه داشبورد و انتقال SPA */
        body.app-loading #login-page,
        body.app-loading #app-container {
            opacity: 0;
            visibility: hidden;
        }

        body.auth-transition .topology-background,
        body.dashboard-mode .topology-background {
            filter: brightness(0.58) saturate(0.9);
            transition: filter 900ms cubic-bezier(0.22, 1, 0.36, 1);
        }

        body.auth-transition .topology-overlay,
        body.dashboard-mode .topology-overlay {
            opacity: 0.74;
            transition: opacity 900ms cubic-bezier(0.22, 1, 0.36, 1);
        }

        #login-page {
            z-index: 4;
            will-change: opacity, visibility;
            transition: opacity 720ms cubic-bezier(0.22, 1, 0.36, 1), visibility 720ms cubic-bezier(0.22, 1, 0.36, 1);
        }

        .login-container {
            will-change: transform, opacity, filter;
            transition: transform 820ms cubic-bezier(0.22, 1, 0.36, 1), opacity 720ms cubic-bezier(0.22, 1, 0.36, 1), filter 720ms cubic-bezier(0.22, 1, 0.36, 1);
        }

        #login-page.login-exit {
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
        }

        #login-page.login-exit .login-container {
            opacity: 0;
            transform: translateY(-96px) scale(0.96);
            filter: blur(10px);
        }

        #login-page.login-return .login-container {
            animation: loginReturn 780ms cubic-bezier(0.22, 1, 0.36, 1) both;
        }

        @keyframes loginReturn {
            from { opacity: 0; transform: translateY(-48px) scale(0.97); filter: blur(8px); }
            to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
        }

        .btn-login:disabled {
            cursor: not-allowed;
            opacity: 0.82;
            transform: none;
        }

        .btn-loader {
            width: 18px;
            height: 18px;
            border-radius: 50%;
            border: 2px solid rgba(10, 14, 39, 0.24);
            border-top-color: #0a0e27;
            display: none;
            animation: spin 850ms linear infinite;
        }

        .btn-login.is-loading .btn-arrow {
            display: none;
        }

        .btn-login.is-loading .btn-loader {
            display: inline-block;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        #app-container {
            position: fixed;
            inset: 0;
            display: flex;
            width: 100%;
            height: 100vh;
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
            transform: translateY(38px) scale(0.985);
            filter: blur(10px);
            background:
                radial-gradient(circle at 8% 0%, rgba(0, 255, 184, 0.13), transparent 30%),
                radial-gradient(circle at 100% 18%, rgba(119, 75, 255, 0.14), transparent 32%),
                linear-gradient(135deg, #07111f 0%, #0d1728 47%, #101827 100%);
            color: #eafdf6;
            z-index: 3;
            overflow: hidden;
            transition: opacity 860ms cubic-bezier(0.22, 1, 0.36, 1), visibility 860ms cubic-bezier(0.22, 1, 0.36, 1), transform 860ms cubic-bezier(0.22, 1, 0.36, 1), filter 860ms cubic-bezier(0.22, 1, 0.36, 1);
        }
        
        #app-container.active {
            opacity: 1;
            visibility: visible;
            pointer-events: auto;
            transform: translateY(0) scale(1);
            filter: blur(0);
        }

        #app-container.instant {
            transition: none;
        }

        .dashboard-shell {
            display: flex;
            width: 100vw;
            height: 100vh;
            padding: 0;
            margin: 0;
            gap: 0;
            overflow: hidden;
        }
        
        .sidebar {
            width: 275px;
            min-width: 275px;
            max-width: 275px;
            height: 100vh;
            max-height: 100vh;
            border-radius: 0;
            margin: 0;
            padding: 0;
            background: linear-gradient(180deg, rgba(10, 24, 41, 0.94) 0%, rgba(8, 17, 31, 0.90) 100%);
            border: none;
            border-left: 1px solid rgba(255, 255, 255, 0.08);
            box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
            display: flex;
            flex-direction: column;
            flex-shrink: 0;
            overflow: hidden;
        }
        
        .sidebar-header {
            padding: 24px 22px 20px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        }

        .brand-row {
            display: flex;
            align-items: center;
            gap: 14px;
        }

        .brand-mark {
            width: 48px;
            height: 48px;
            border-radius: 17px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #061322;
            background: linear-gradient(135deg, #00ff88 0%, #00ccff 100%);
            box-shadow: 0 0 32px rgba(0, 255, 184, 0.34);
        }

        .brand-mark svg {
            width: 27px;
            height: 27px;
            stroke-width: 1.9;
        }
        
        .sidebar-header h3 {
            color: #fff;
            margin: 0;
            font-size: 17px;
            line-height: 1.7;
        }

        .sidebar-header span {
            display: block;
            margin-top: 2px;
            color: rgba(255, 255, 255, 0.48);
            font-size: 11px;
        }
        
        .user-info {
            margin: 18px;
            padding: 18px;
            border-radius: 22px;
            background: rgba(255, 255, 255, 0.055);
            border: 1px solid rgba(255, 255, 255, 0.08);
            display: flex;
            align-items: center;
            gap: 13px;
            width: auto;
            text-align: right;
            cursor: pointer;
            position: relative;
            transition: border-color 0.22s ease, background 0.22s ease, transform 0.22s ease;
        }

        .user-info:hover,
        .user-info.profile-open {
            transform: translateY(-1px);
            border-color: rgba(0, 255, 184, 0.22);
            background: rgba(255, 255, 255, 0.075);
        }
        
        .user-avatar {
            width: 54px;
            height: 54px;
            min-width: 54px;
            border-radius: 18px;
            background: linear-gradient(135deg, #00ff88 0%, #00ccff 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            color: #061322;
            font-size: 22px;
            font-weight: bold;
            box-shadow: 0 4px 18px rgba(0, 255, 136, 0.25);
            overflow: hidden;
        }

        .user-avatar img {
            width: 100%;
            height: 100%;
            display: block;
            object-fit: cover;
        }

        .user-text {
            min-width: 0;
            flex: 1;
        }
        
        .user-name {
            color: #fff;
            font-size: 14px;
            margin: 0;
            line-height: 1.8;
        }
        
        .user-role {
            color: rgba(255, 255, 255, 0.56);
            font-size: 12px;
            margin: 0;
        }

        .user-profile-chevron {
            width: 18px;
            height: 18px;
            color: rgba(255, 255, 255, 0.54);
            transition: transform 0.22s ease;
        }

        .user-info.profile-open .user-profile-chevron {
            transform: rotate(180deg);
        }

        .profile-menu {
            position: absolute;
            top: calc(100% + 8px);
            right: 0;
            left: 0;
            z-index: 40;
            display: none;
            padding: 8px;
            border-radius: 18px;
            background: rgba(7, 16, 31, 0.98);
            border: 1px solid rgba(255, 255, 255, 0.12);
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.34);
        }

        .profile-menu.active {
            display: grid;
            gap: 6px;
        }

        .profile-menu-item {
            border: 0;
            border-radius: 13px;
            background: transparent;
            color: rgba(255, 255, 255, 0.84);
            padding: 10px 11px;
            text-align: right;
            cursor: pointer;
            font-family: inherit;
            font-size: 12px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .profile-menu-item:hover {
            color: #fff;
            background: rgba(0, 255, 184, 0.10);
        }

        .profile-menu-item svg {
            width: 17px;
            height: 17px;
            stroke-width: 1.8;
            color: #00ffb8;
        }
        
        .sidebar-menu {
            flex: 1;
            overflow-y: auto;
            overflow-x: hidden;
            padding: 4px 14px 14px;
            scrollbar-width: none;
            -ms-overflow-style: none;
        }

        .sidebar-menu::-webkit-scrollbar {
            display: none;
            width: 0;
            height: 0;
        }
        
        .menu-item {
            margin-bottom: 8px;
            padding: 14px 16px;
            color: rgba(255, 255, 255, 0.72);
            cursor: pointer;
            transition: all 0.28s ease;
            border: 1px solid transparent;
            border-radius: 17px;
            display: flex;
            align-items: center;
            gap: 13px;
            font-size: 14px;
        }
        
        .menu-item:hover {
            background: rgba(255, 255, 255, 0.07);
            color: #fff;
            border-color: rgba(0, 255, 184, 0.12);
            transform: translateX(-3px);
        }
        
        .menu-item.active {
            background: linear-gradient(135deg, rgba(0, 255, 136, 0.18), rgba(0, 204, 255, 0.10));
            color: #fff;
            border-color: rgba(0, 255, 184, 0.22);
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
        }
        
        .sidebar-footer {
            padding: 16px 18px 18px;
            border-top: 1px solid rgba(255, 255, 255, 0.08);
        }
        
        .btn-logout {
            width: 100%;
            padding: 13px 14px;
            background: rgba(255, 255, 255, 0.06);
            border: 1px solid rgba(255, 255, 255, 0.10);
            border-radius: 16px;
            color: #fff;
            cursor: pointer;
            transition: all 0.28s ease;
            font-size: 14px;
        }
        
        .btn-logout:hover {
            background: rgba(255, 80, 100, 0.18);
            border-color: rgba(255, 80, 100, 0.34);
            transform: translateY(-2px);
        }
        
        .main-content {
            flex: 1;
            min-width: 0;
            width: calc(100vw - 275px);
            height: 100vh;
            max-height: 100vh;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            border-radius: 0;
            margin: 0;
            padding: 0;
            border: none;
            background: rgba(255, 255, 255, 0.055);
            box-shadow: none;
        }
        
        .top-header {
            min-height: 88px;
            padding: 18px 26px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 18px;
            background: rgba(5, 14, 26, 0.46);
            border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        }
        
        .header-title h1 {
            font-size: 24px;
            color: #ffffff;
            margin: 0 0 6px;
            line-height: 1.5;
        }

        .header-title p {
            margin: 0;
            color: rgba(255, 255, 255, 0.56);
            font-size: 12px;
            line-height: 1.8;
        }
        
        .header-info {
            display: flex;
            align-items: center;
            gap: 12px;
        }
        
        .live-clock,
        .header-pill {
            background: rgba(255, 255, 255, 0.075);
            color: #eafff7;
            padding: 11px 16px;
            border-radius: 16px;
            font-size: 13px;
            border: 1px solid rgba(255, 255, 255, 0.10);
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
        }

        .header-pill {
            display: flex;
            align-items: center;
            gap: 9px;
            color: rgba(255, 255, 255, 0.76);
        }

        .header-pill svg {
            width: 19px;
            height: 19px;
            color: #00ffb8;
            stroke-width: 1.8;
        }
        
        .content-area {
            flex: 1;
            padding: 26px;
            overflow-y: auto;
            overflow-x: hidden;
            scrollbar-width: none;
            -ms-overflow-style: none;
            background:
                radial-gradient(circle at 20% 0%, rgba(0, 255, 184, 0.08), transparent 28%),
                radial-gradient(circle at 95% 25%, rgba(124, 82, 255, 0.08), transparent 30%);
        }

        .content-area::-webkit-scrollbar {
            display: none;
            width: 0;
            height: 0;
        }

        .view-panel {
            width: 100%;
            box-sizing: border-box;
            animation: viewIn 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
        }

        @keyframes viewIn {
            from { opacity: 0; transform: translateY(18px); }
            to { opacity: 1; transform: none; }
        }
        
        .dashboard-hero {
            display: grid;
            grid-template-columns: 1fr;
            gap: 18px;
            margin-bottom: 18px;
        }
        
        .welcome-section {
            position: relative;
            overflow: hidden;
            background: linear-gradient(135deg, rgba(0, 255, 136, 0.88) 0%, rgba(0, 204, 255, 0.80) 100%);
            color: #061322;
            padding: 34px;
            border-radius: 26px;
            box-shadow: 0 18px 48px rgba(0, 255, 136, 0.20);
        }

        .welcome-section::after {
            content: "";
            position: absolute;
            inset: -45% auto auto -10%;
            width: 340px;
            height: 340px;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.20);
            filter: blur(20px);
        }
        
        .welcome-section h2 {
            position: relative;
            font-size: 28px;
            margin-bottom: 10px;
            line-height: 1.7;
        }
        
        .welcome-section p {
            position: relative;
            max-width: 690px;
            font-size: 14px;
            line-height: 2.1;
            opacity: 0.82;
            margin: 0;
        }

        .quick-actions {
            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 12px;
        }

        .quick-action {
            min-height: 100px;
            padding: 18px;
            border-radius: 22px;
            border: 1px solid rgba(255, 255, 255, 0.10);
            background: rgba(255, 255, 255, 0.07);
            color: #fff;
            cursor: pointer;
            text-align: right;
            transition: all 0.28s ease;
        }

        .quick-action:hover {
            transform: translateY(-4px);
            border-color: rgba(0, 255, 184, 0.24);
            background: rgba(255, 255, 255, 0.10);
        }

        .quick-action svg {
            width: 24px;
            height: 24px;
            color: #00ffb8;
            margin-bottom: 12px;
            stroke-width: 1.8;
        }

        .quick-action span {
            display: block;
            color: rgba(255, 255, 255, 0.62);
            font-size: 11px;
            margin-top: 6px;
        }
        
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 16px;
            margin-bottom: 18px;
        }
        
        .stat-card,
        .workspace-card {
            background: rgba(255, 255, 255, 0.075);
            padding: 22px;
            border-radius: 24px;
            border: 1px solid rgba(255, 255, 255, 0.10);
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
            transition: all 0.3s ease;
        }
        
        .stat-card:hover,
        .workspace-card:hover {
            transform: translateY(-4px);
            border-color: rgba(0, 255, 184, 0.18);
            background: rgba(255, 255, 255, 0.095);
        }
        
        .stat-card h3 {
            font-size: 13px;
            color: rgba(255, 255, 255, 0.62);
            margin-bottom: 12px;
            line-height: 1.8;
        }
        
        .stat-card .value {
            font-size: 32px;
            font-weight: bold;
            color: #ffffff;
            line-height: 1.3;
        }

        .stat-meta {
            display: flex;
            align-items: center;
            justify-content: space-between;
            color: rgba(255, 255, 255, 0.50);
            font-size: 11px;
            margin-top: 14px;
        }

        .stat-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: #00ffb8;
            box-shadow: 0 0 16px rgba(0, 255, 184, 0.8);
        }

        .workspace-grid {
            display: grid;
            grid-template-columns: minmax(0, 1fr) 360px;
            gap: 18px;
        }

        .workspace-card h3 {
            color: #fff;
            font-size: 17px;
            margin-bottom: 18px;
            line-height: 1.7;
        }

        .activity-list,
        .task-list {
            display: grid;
            gap: 12px;
        }

        .activity-item,
        .task-item {
            display: flex;
            align-items: center;
            gap: 13px;
            padding: 14px;
            border-radius: 18px;
            background: rgba(6, 15, 28, 0.34);
            border: 1px solid rgba(255, 255, 255, 0.07);
        }

        .activity-icon,
        .task-status {
            width: 38px;
            height: 38px;
            min-width: 38px;
            border-radius: 14px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #00ffb8;
            background: rgba(0, 255, 184, 0.10);
            border: 1px solid rgba(0, 255, 184, 0.15);
        }

        .activity-icon svg {
            width: 21px;
            height: 21px;
            stroke-width: 1.8;
        }

        .activity-item strong,
        .task-item strong {
            display: block;
            color: #fff;
            font-size: 13px;
            margin-bottom: 5px;
        }

        .activity-item span,
        .task-item span {
            display: block;
            color: rgba(255, 255, 255, 0.52);
            font-size: 11px;
            line-height: 1.8;
        }

        .task-status {
            width: 12px;
            height: 12px;
            min-width: 12px;
            border-radius: 50%;
            padding: 0;
        }

        .generic-view {
            min-height: 420px;
            display: grid;
            place-items: center;
            text-align: center;
        }

        .generic-view svg {
            width: 72px;
            height: 72px;
            color: #00ffb8;
            margin-bottom: 20px;
            stroke-width: 1.5;
        }

        .generic-view h2 {
            color: #fff;
            font-size: 24px;
            margin-bottom: 12px;
        }

        .generic-view p {
            max-width: 560px;
            color: rgba(255, 255, 255, 0.58);
            line-height: 2;
            margin: 0 auto;
        }

        .org-management-layout {
            display: grid;
            grid-template-columns: minmax(0, 1fr);
            gap: 18px;
            align-items: start;
        }

        .org-form-card,
        .org-list-card,
        .org-modal-card {
            background: rgba(255, 255, 255, 0.075);
            border: 1px solid rgba(255, 255, 255, 0.10);
            border-radius: 24px;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
        }

        .org-form-card {
            padding: 20px;
        }

        .org-form-card h3,
        .org-list-header h3 {
            margin: 0 0 8px;
            color: #fff;
            font-size: 18px;
            line-height: 1.7;
        }

        .org-form-card p,
        .org-list-header p,
        .org-empty-state p {
            margin: 0;
            color: rgba(255, 255, 255, 0.62);
            font-size: 12px;
            line-height: 1.9;
        }

        .org-form-intro {
            margin: 0;
            color: rgba(255, 255, 255, 0.64);
            font-size: 12px;
            line-height: 1.9;
        }

        .org-form-grid {
            margin-top: 16px;
            display: grid;
            gap: 12px;
        }

        .org-field label {
            display: block;
            margin-bottom: 6px;
            color: rgba(255, 255, 255, 0.88);
            font-size: 12px;
        }

        .org-field input[type="text"],
        .org-field input[type="password"],
        .org-field input[type="number"],
        .org-field input[type="datetime-local"],
        .org-field input[type="file"],
        .org-field textarea,
        .org-field select {
            width: 100%;
            border: 1px solid rgba(255, 255, 255, 0.16);
            border-radius: 14px;
            background: rgba(4, 12, 24, 0.54);
            color: #fff;
            padding: 11px 12px;
            font-size: 13px;
            outline: none;
            transition: border-color 0.2s ease, box-shadow 0.2s ease;
        }

        .org-field textarea {
            min-height: 90px;
            resize: vertical;
        }

        .org-field input[type="text"]:focus,
        .org-field input[type="password"]:focus,
        .org-field input[type="number"]:focus,
        .org-field input[type="datetime-local"]:focus,
        .org-field input[type="file"]:focus,
        .org-field textarea:focus,
        .org-field select:focus {
            border-color: rgba(0, 255, 184, 0.42);
            box-shadow: 0 0 0 3px rgba(0, 255, 184, 0.14);
        }

        .org-file-meta {
            margin-top: 6px;
            font-size: 11px;
            color: rgba(255, 255, 255, 0.54);
            min-height: 18px;
        }

        .org-form-actions {
            display: flex;
            gap: 10px;
            margin-top: 8px;
        }

        .org-btn {
            border: 1px solid rgba(255, 255, 255, 0.14);
            background: rgba(255, 255, 255, 0.08);
            color: #fff;
            padding: 11px 14px;
            border-radius: 14px;
            cursor: pointer;
            font-size: 13px;
            transition: all 0.2s ease;
        }

        .org-btn:hover {
            transform: translateY(-1px);
            border-color: rgba(0, 255, 184, 0.28);
        }

        .org-btn-primary {
            background: linear-gradient(135deg, rgba(0, 255, 136, 0.22), rgba(0, 204, 255, 0.18));
            border-color: rgba(0, 255, 184, 0.30);
        }

        .org-btn-danger {
            background: rgba(255, 96, 120, 0.16);
            border-color: rgba(255, 96, 120, 0.24);
        }

        .org-btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            transform: none;
        }

        .org-message {
            margin-top: 10px;
            border-radius: 12px;
            padding: 10px 12px;
            font-size: 12px;
            line-height: 1.8;
            display: none;
        }

        .org-message-success {
            display: block;
            background: rgba(0, 255, 136, 0.14);
            border: 1px solid rgba(0, 255, 136, 0.28);
            color: #e8fff7;
        }

        .org-message-error {
            display: block;
            background: rgba(255, 97, 120, 0.14);
            border: 1px solid rgba(255, 97, 120, 0.28);
            color: #ffe9ee;
        }

        .org-list-card {
            padding: 22px;
            min-height: 460px;
        }

        .org-list-header {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 12px;
            margin-bottom: 14px;
        }

        .org-toolbar-actions {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
        }

        .org-list-meta {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            font-size: 11px;
            color: rgba(255, 255, 255, 0.56);
            background: rgba(255, 255, 255, 0.08);
            border: 1px solid rgba(255, 255, 255, 0.12);
            border-radius: 999px;
            padding: 6px 10px;
        }

        .org-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
            gap: 14px;
        }

        .org-card {
            background: rgba(4, 12, 24, 0.42);
            border: 1px solid rgba(255, 255, 255, 0.10);
            border-radius: 20px;
            padding: 14px;
            display: grid;
            gap: 12px;
            transition: border-color 0.2s ease, transform 0.2s ease;
        }

        .org-card:hover {
            border-color: rgba(0, 255, 184, 0.24);
            transform: translateY(-2px);
        }

        .org-card-head {
            display: flex;
            align-items: center;
            gap: 11px;
        }

        .org-logo {
            width: 54px;
            height: 54px;
            border-radius: 14px;
            border: 1px solid rgba(255, 255, 255, 0.14);
            background: rgba(255, 255, 255, 0.08);
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: center;
            color: rgba(255, 255, 255, 0.78);
            font-size: 18px;
            font-weight: bold;
        }

        .org-logo img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }

        .org-card-title {
            margin: 0;
            color: #fff;
            font-size: 14px;
            line-height: 1.7;
        }

        .org-card-sub {
            margin: 2px 0 0;
            color: rgba(255, 255, 255, 0.58);
            font-size: 11px;
        }

        .org-card-desc {
            margin: 0;
            color: rgba(255, 255, 255, 0.68);
            font-size: 12px;
            line-height: 1.9;
            min-height: 44px;
        }

        .org-card-actions {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 8px;
        }

        .org-card-btn {
            border: 1px solid rgba(255, 255, 255, 0.12);
            background: rgba(255, 255, 255, 0.08);
            color: #fff;
            padding: 8px 10px;
            border-radius: 12px;
            font-size: 11px;
            cursor: pointer;
            white-space: normal;
            text-align: center;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-height: 42px;
            line-height: 1.5;
            overflow-wrap: anywhere;
            transition: all 0.2s ease;
        }

        .org-card-btn:hover {
            border-color: rgba(0, 255, 184, 0.28);
            transform: translateY(-1px);
        }

        .org-card-btn-danger {
            color: #ffd5de;
            border-color: rgba(255, 97, 120, 0.30);
            background: rgba(255, 97, 120, 0.14);
        }

        .org-empty-state {
            text-align: center;
            border: 1px dashed rgba(255, 255, 255, 0.18);
            border-radius: 20px;
            padding: 30px 18px;
            color: rgba(255, 255, 255, 0.66);
        }

        .org-empty-state strong {
            display: block;
            color: #fff;
            margin-bottom: 6px;
            font-size: 16px;
        }

        .org-modal {
            position: fixed;
            inset: 0;
            z-index: 120;
            display: none;
            align-items: center;
            justify-content: center;
            background: rgba(3, 8, 18, 0.82);
            backdrop-filter: blur(14px);
            -webkit-backdrop-filter: blur(14px);
            padding: 18px;
        }

        .org-modal.active {
            display: flex;
        }

        .org-modal-card {
            width: min(820px, 100%);
            max-height: min(86vh, 760px);
            overflow: hidden;
            display: grid;
            grid-template-rows: auto 1fr auto;
            background: linear-gradient(145deg, rgba(7, 16, 31, 0.95), rgba(8, 20, 34, 0.92));
            border: 1px solid rgba(255, 255, 255, 0.14);
            box-shadow: 0 32px 84px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.09);
        }

        .org-modal-card-medium {
            width: min(640px, 100%);
        }

        .signature-route-modal-card {
            width: min(1180px, 100%);
            max-height: min(94vh, 920px);
        }

        .signature-route-general-grid {
            display: grid;
            grid-template-columns: minmax(0, 1.4fr) minmax(180px, 0.6fr);
            gap: 12px;
            padding: 14px;
            border: 1px solid rgba(255, 255, 255, 0.10);
            border-radius: 18px;
            background: linear-gradient(135deg, rgba(0, 204, 255, 0.07), rgba(0, 255, 136, 0.04));
        }

        .signature-route-general-grid .org-field:nth-child(3) {
            grid-column: 1 / -1;
        }

        .signature-route-flow-toolbar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            flex-wrap: wrap;
        }

        .signature-route-flow-toolbar h4 {
            margin: 0;
            color: #fff;
            font-size: 15px;
        }

        .signature-route-flow-toolbar p {
            margin: 4px 0 0;
            color: rgba(255, 255, 255, 0.56);
            font-size: 11px;
        }

        .signature-route-flow-stats {
            display: inline-flex;
            align-items: center;
            gap: 7px;
            flex-wrap: wrap;
            color: rgba(255, 255, 255, 0.62);
            font-size: 11px;
        }

        .signature-route-flow-editor {
            display: grid;
            grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
            gap: 14px;
            min-height: 360px;
        }

        .signature-route-flow-canvas,
        .signature-route-flow-properties {
            min-width: 0;
            border: 1px solid rgba(255, 255, 255, 0.11);
            border-radius: 20px;
            background: rgba(2, 10, 22, 0.52);
        }

        .signature-route-flow-canvas {
            padding: 16px;
            overflow: auto;
        }

        .signature-route-flow-canvas-head,
        .signature-route-flow-properties-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            margin-bottom: 14px;
        }

        .signature-route-flow-canvas-head strong,
        .signature-route-flow-properties-head strong {
            color: #fff;
            font-size: 13px;
        }

        .signature-route-flow-canvas-head span,
        .signature-route-flow-properties-head span {
            color: rgba(255, 255, 255, 0.48);
            font-size: 10px;
        }

        .signature-route-flow-nodes {
            display: flex;
            align-items: center;
            flex-direction: column;
            min-height: 270px;
            padding: 4px 8px 10px;
        }

        .signature-route-flow-node {
            position: relative;
            width: min(100%, 570px);
            display: grid;
            grid-template-columns: 38px minmax(0, 1fr) auto;
            align-items: center;
            gap: 11px;
            padding: 13px 14px;
            text-align: right;
            color: #fff;
            border: 1px solid rgba(255, 255, 255, 0.13);
            border-radius: 17px;
            background: linear-gradient(135deg, rgba(12, 29, 52, 0.96), rgba(7, 19, 35, 0.94));
            cursor: pointer;
            transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
        }

        .signature-route-flow-node:hover {
            transform: translateY(-1px);
            border-color: rgba(0, 204, 255, 0.48);
        }

        .signature-route-flow-node.active {
            border-color: rgba(0, 255, 168, 0.78);
            box-shadow: 0 0 0 3px rgba(0, 255, 168, 0.10), 0 12px 28px rgba(0, 0, 0, 0.22);
        }

        .signature-route-flow-node.is-invalid {
            border-color: rgba(255, 118, 134, 0.64);
        }

        .signature-route-flow-node-number {
            width: 34px;
            height: 34px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: 12px;
            color: #061322;
            background: linear-gradient(135deg, #00ff9d, #00c8ff);
            font-size: 14px;
            font-weight: 800;
        }

        .signature-route-flow-node-content {
            min-width: 0;
            display: grid;
            gap: 5px;
        }

        .signature-route-flow-node-title {
            overflow: hidden;
            color: #fff;
            font-size: 13px;
            font-weight: 700;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .signature-route-flow-node-meta {
            display: flex;
            align-items: center;
            gap: 6px;
            flex-wrap: wrap;
            color: rgba(255, 255, 255, 0.58);
            font-size: 10px;
        }

        .signature-route-flow-node-meta span {
            max-width: 220px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .signature-route-flow-node-badge {
            padding: 5px 8px;
            border: 1px solid rgba(0, 204, 255, 0.24);
            border-radius: 999px;
            color: #bcefff;
            background: rgba(0, 204, 255, 0.10);
            font-size: 10px;
            white-space: nowrap;
        }

        .signature-route-flow-connector {
            position: relative;
            height: 29px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #00dda1;
            font-size: 19px;
            line-height: 1;
        }

        .signature-route-flow-connector::before {
            content: '';
            position: absolute;
            height: 26px;
            border-right: 1px dashed rgba(0, 255, 168, 0.42);
        }

        .signature-route-flow-connector span {
            position: relative;
            z-index: 1;
            padding: 2px 6px;
            background: rgba(2, 10, 22, 0.96);
        }

        .signature-route-flow-terminal {
            width: min(100%, 340px);
            padding: 9px 14px;
            border: 1px dashed rgba(255, 255, 255, 0.22);
            border-radius: 999px;
            color: rgba(255, 255, 255, 0.70);
            background: rgba(255, 255, 255, 0.04);
            text-align: center;
            font-size: 11px;
        }

        .signature-route-flow-empty {
            width: 100%;
            min-height: 220px;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-direction: column;
            gap: 8px;
            padding: 24px;
            border: 1px dashed rgba(255, 255, 255, 0.18);
            border-radius: 17px;
            color: rgba(255, 255, 255, 0.58);
            text-align: center;
        }

        .signature-route-flow-empty strong {
            color: #fff;
            font-size: 14px;
        }

        .signature-route-flow-properties {
            padding: 16px;
        }

        .signature-route-flow-properties-body {
            display: grid;
            gap: 12px;
        }

        .signature-route-step-order-readonly {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            padding: 10px 12px;
            border-radius: 13px;
            color: rgba(255, 255, 255, 0.60);
            background: rgba(255, 255, 255, 0.05);
            font-size: 11px;
        }

        .signature-route-step-order-readonly strong {
            color: #fff;
            font-size: 15px;
        }

        .signature-route-property-actions {
            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 7px;
        }

        .signature-route-property-actions .org-btn {
            min-width: 0;
            padding: 9px 7px;
            font-size: 11px;
        }

        .signature-route-role-warning {
            padding: 10px 12px;
            border: 1px solid rgba(255, 193, 7, 0.28);
            border-radius: 13px;
            color: #ffe8a3;
            background: rgba(255, 193, 7, 0.09);
            font-size: 11px;
            line-height: 1.8;
        }

        .signature-route-list-warning {
            margin-top: 8px;
            padding: 10px 12px;
            border: 1px solid rgba(255, 193, 7, 0.22);
            border-radius: 13px;
            color: #ffe8a3;
            background: rgba(255, 193, 7, 0.08);
            font-size: 11px;
            line-height: 1.8;
        }

        @media (max-width: 900px) {
            .signature-route-flow-editor {
                grid-template-columns: 1fr;
            }

            .signature-route-flow-properties {
                order: -1;
            }
        }

        @media (max-width: 620px) {
            .signature-route-general-grid {
                grid-template-columns: 1fr;
            }

            .signature-route-general-grid .org-field:nth-child(3) {
                grid-column: auto;
            }

            .signature-route-flow-node {
                grid-template-columns: 34px minmax(0, 1fr);
            }

            .signature-route-flow-node-badge {
                grid-column: 2;
                justify-self: start;
            }

            .signature-route-property-actions {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }
        }

        /* n8n-inspired route canvas: spacious, node-based and dependency-free. */
        .signature-route-modal-card {
            width: min(1480px, 98vw);
            max-height: min(96vh, 980px);
            border-radius: 24px;
        }

        #signatureRouteModal {
            z-index: 180;
            padding: 0;
            align-items: stretch;
            justify-content: stretch;
            background: rgba(1, 6, 14, 0.96);
        }

        #signatureRouteModal .signature-route-modal-card {
            width: 100%;
            height: 100%;
            max-width: none;
            max-height: none;
            border: 0;
            border-radius: 0;
            box-shadow: none;
        }

        .signature-route-modal-card .org-modal-header {
            padding: 18px 24px;
            background: rgba(1, 8, 18, 0.56);
        }

        .signature-route-modal-card .org-modal-body {
            padding: 22px 24px 24px;
            gap: 20px;
        }

        .signature-route-modal-card .org-modal-footer {
            padding: 14px 24px;
            background: rgba(1, 8, 18, 0.56);
        }

        .signature-route-editor-shell {
            display: grid;
            grid-template-columns: 210px minmax(0, 1fr) 300px;
            gap: 16px;
            min-height: 510px;
        }

        .signature-route-palette,
        .signature-route-flow-canvas,
        .signature-route-flow-properties {
            border: 1px solid rgba(255, 255, 255, 0.12);
            border-radius: 18px;
            background: rgba(2, 9, 20, 0.70);
        }

        .signature-route-palette {
            padding: 15px;
        }

        .signature-route-palette-head {
            display: grid;
            gap: 4px;
            margin-bottom: 14px;
        }

        .signature-route-palette-head strong {
            color: #fff;
            font-size: 13px;
        }

        .signature-route-palette-head span {
            color: rgba(255, 255, 255, 0.50);
            font-size: 10px;
            line-height: 1.7;
        }

        .signature-route-palette-list {
            display: grid;
            gap: 8px;
        }

        .signature-route-palette-item {
            width: 100%;
            display: grid;
            grid-template-columns: 28px minmax(0, 1fr);
            align-items: center;
            gap: 8px;
            padding: 9px 10px;
            border: 1px solid rgba(255, 255, 255, 0.10);
            border-radius: 11px;
            color: rgba(255, 255, 255, 0.82);
            background: rgba(255, 255, 255, 0.04);
            cursor: pointer;
            text-align: right;
            transition: border-color .16s ease, background .16s ease, transform .16s ease;
        }

        .signature-route-palette-item:hover {
            border-color: rgba(0, 204, 255, 0.48);
            background: rgba(0, 204, 255, 0.09);
            transform: translateX(-2px);
        }

        .signature-route-palette-icon {
            width: 26px;
            height: 26px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: 9px;
            color: #061322;
            background: #8ee8ff;
            font-size: 12px;
            font-weight: 800;
        }

        .signature-route-palette-label {
            font-size: 11px;
            font-weight: 700;
        }

        .signature-route-palette-note {
            margin-top: 18px;
            padding-top: 14px;
            border-top: 1px solid rgba(255, 255, 255, 0.08);
            color: rgba(255, 255, 255, 0.47);
            font-size: 10px;
            line-height: 1.9;
        }

        .signature-route-flow-canvas {
            min-width: 0;
            display: grid;
            grid-template-rows: auto minmax(0, 1fr) auto;
            padding: 0;
            overflow: hidden;
        }

        .signature-route-canvas-toolbar {
            min-height: 58px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            padding: 11px 14px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.09);
            background: rgba(255, 255, 255, 0.025);
        }

        .signature-route-canvas-toolbar-title {
            display: flex;
            align-items: center;
            gap: 8px;
            color: #fff;
            font-size: 12px;
            font-weight: 700;
        }

        .signature-route-canvas-toolbar-title span {
            color: rgba(255, 255, 255, 0.44);
            font-size: 10px;
            font-weight: 400;
        }

        .signature-route-canvas-tools {
            display: inline-flex;
            align-items: center;
            gap: 5px;
        }

        .signature-route-canvas-tool {
            min-width: 30px;
            height: 30px;
            padding: 0 7px;
            border: 1px solid rgba(255, 255, 255, 0.12);
            border-radius: 8px;
            color: rgba(255, 255, 255, 0.72);
            background: rgba(255, 255, 255, 0.05);
            cursor: pointer;
        }

        .signature-route-canvas-tool:hover {
            border-color: rgba(0, 204, 255, 0.52);
            color: #fff;
        }

        .signature-route-canvas-zoom {
            min-width: 44px;
            color: rgba(255, 255, 255, 0.56);
            font-size: 10px;
            text-align: center;
        }

        .signature-route-canvas-viewport {
            position: relative;
            min-height: 390px;
            overflow: auto;
            cursor: grab;
            background-color: #07111f;
            background-image: radial-gradient(rgba(166, 205, 230, 0.18) 1px, transparent 1px), linear-gradient(135deg, rgba(0, 204, 255, 0.025), transparent 42%);
            background-position: 0 0, 0 0;
            background-size: 22px 22px, auto;
        }

        .signature-route-canvas-viewport.is-panning {
            cursor: grabbing;
            user-select: none;
        }

        .signature-route-canvas-stage {
            min-width: max-content;
            min-height: 100%;
            padding: 76px 70px;
            transform-origin: top left;
            transition: transform .12s ease;
            will-change: transform;
        }

        .signature-route-flow-nodes {
            min-height: 235px;
            display: flex;
            align-items: center;
            flex-direction: row;
            width: max-content;
            padding: 18px 8px 34px;
            direction: ltr;
        }

        .signature-route-flow-node {
            position: relative;
            width: 265px;
            min-height: 144px;
            display: grid;
            grid-template-columns: 1fr;
            align-content: start;
            gap: 10px;
            padding: 15px 16px 14px;
            border: 1px solid rgba(255, 255, 255, 0.16);
            border-top: 3px solid #8ee8ff;
            border-radius: 12px;
            color: #fff;
            background: linear-gradient(180deg, rgba(18, 35, 58, 0.98), rgba(7, 18, 33, 0.98));
            box-shadow: 0 14px 34px rgba(0, 0, 0, 0.25);
            cursor: grab;
            direction: rtl;
            text-align: right;
            transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease, opacity .16s ease;
        }

        .signature-route-flow-node:active {
            cursor: grabbing;
        }

        .signature-route-flow-node:hover {
            transform: translateY(-3px);
            border-color: rgba(142, 232, 255, 0.76);
            box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
        }

        .signature-route-flow-node.active {
            border-color: rgba(0, 255, 168, 0.88);
            border-top-color: #00ff9d;
            box-shadow: 0 0 0 3px rgba(0, 255, 168, 0.12), 0 18px 42px rgba(0, 0, 0, 0.35);
        }

        .signature-route-flow-node.dragging {
            opacity: .42;
            transform: scale(.97);
        }

        .signature-route-flow-node.is-invalid {
            border-color: rgba(255, 118, 134, 0.80);
            border-top-color: #ff7686;
        }

        .signature-route-flow-node::before,
        .signature-route-flow-node::after {
            content: '';
            position: absolute;
            top: 50%;
            width: 9px;
            height: 9px;
            border: 2px solid #07111f;
            border-radius: 50%;
            background: #8ee8ff;
            transform: translateY(-50%);
            z-index: 2;
        }

        .signature-route-flow-node::before { left: -6px; }
        .signature-route-flow-node::after { right: -6px; background: #00ff9d; }

        .signature-route-flow-node-top,
        .signature-route-flow-node-footer {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
        }

        .signature-route-flow-node-top {
            color: rgba(255, 255, 255, 0.48);
            font-size: 9px;
        }

        .signature-route-flow-node-index {
            color: #9befff;
            font-size: 10px;
            font-weight: 800;
            letter-spacing: .08em;
        }

        .signature-route-flow-node-drag {
            color: rgba(255, 255, 255, 0.34);
            font-size: 15px;
            line-height: 1;
        }

        .signature-route-flow-node-content {
            gap: 7px;
        }

        .signature-route-flow-node-title {
            color: #fff;
            font-size: 13px;
            line-height: 1.7;
        }

        .signature-route-flow-node-meta {
            display: grid;
            gap: 3px;
            color: rgba(255, 255, 255, 0.55);
            font-size: 10px;
        }

        .signature-route-flow-node-meta span {
            max-width: 220px;
        }

        .signature-route-flow-node-footer {
            margin-top: auto;
            padding-top: 9px;
            border-top: 1px solid rgba(255, 255, 255, 0.09);
        }

        .signature-route-flow-node-badge {
            padding: 4px 7px;
            color: #061322;
            background: #8ee8ff;
            border: 0;
            border-radius: 5px;
            font-size: 9px;
            font-weight: 800;
        }

        .signature-route-flow-node-required {
            color: rgba(255, 255, 255, 0.48);
            font-size: 9px;
        }

        .signature-route-flow-connector {
            position: relative;
            width: 58px;
            height: 2px;
            flex: 0 0 58px;
            border-top: 1px solid rgba(0, 255, 168, 0.50);
        }

        .signature-route-flow-connector::before {
            content: none;
        }

        .signature-route-flow-connector::after {
            content: '';
            position: absolute;
            top: -4px;
            right: -1px;
            border-top: 4px solid transparent;
            border-bottom: 4px solid transparent;
            border-left: 7px solid #00dca4;
        }

        .signature-route-flow-connector span {
            display: none;
        }

        .signature-route-flow-terminal {
            width: 150px;
            flex: 0 0 150px;
            padding: 12px 13px;
            border: 1px solid rgba(0, 204, 255, 0.40);
            border-radius: 11px;
            color: #bdefff;
            background: rgba(0, 204, 255, 0.09);
            font-size: 10px;
            font-weight: 700;
            text-align: center;
            direction: rtl;
        }

        .signature-route-canvas-footer {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            padding: 10px 14px;
            border-top: 1px solid rgba(255, 255, 255, 0.08);
            color: rgba(255, 255, 255, 0.46);
            font-size: 10px;
        }

        .signature-route-flow-properties {
            min-width: 0;
            padding: 17px;
        }

        .signature-route-flow-properties-head {
            margin-bottom: 18px;
        }

        .signature-route-flow-properties-body {
            gap: 14px;
        }

        .signature-route-property-actions {
            margin-top: 8px;
        }

        .signature-route-list-toolbar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            flex-wrap: wrap;
            margin-bottom: 14px;
            padding: 12px 14px;
            border: 1px solid rgba(255, 255, 255, 0.09);
            border-radius: 14px;
            color: rgba(255, 255, 255, 0.58);
            background: rgba(255, 255, 255, 0.035);
            font-size: 11px;
        }

        @media (max-width: 1180px) {
            .signature-route-editor-shell {
                grid-template-columns: 185px minmax(0, 1fr) 280px;
                gap: 12px;
            }
        }

        @media (max-width: 920px) {
            .signature-route-editor-shell {
                grid-template-columns: 1fr;
            }

            .signature-route-palette {
                order: 2;
            }

            .signature-route-palette-list {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }

            .signature-route-flow-properties {
                order: 1;
            }

            .signature-route-flow-canvas {
                order: 3;
            }
        }

        @media (max-width: 620px) {
            .signature-route-modal-card .org-modal-header,
            .signature-route-modal-card .org-modal-body,
            .signature-route-modal-card .org-modal-footer {
                padding-left: 14px;
                padding-right: 14px;
            }

            .signature-route-palette-list {
                grid-template-columns: 1fr;
            }

            .signature-route-canvas-stage {
                padding: 58px 34px;
            }
        }

        .profile-modal-card {
            width: min(980px, 100%);
            max-height: min(92vh, 880px);
            border-radius: 28px;
        }

        .org-modal-header,
        .org-modal-footer {
            padding: 14px 18px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.10);
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
        }

        .org-modal-header-actions {
            display: inline-flex;
            align-items: center;
            gap: 8px;
        }

        .org-modal-footer {
            border-top: 1px solid rgba(255, 255, 255, 0.10);
            border-bottom: 0;
            justify-content: flex-end;
        }

        .org-modal-title {
            margin: 0;
            color: #fff;
            font-size: 17px;
        }

        .org-modal-body {
            overflow-y: auto;
            padding: 16px 18px 18px;
            display: grid;
            gap: 14px;
        }

        .org-modal-close {
            border: 0;
            background: transparent;
            color: rgba(255, 255, 255, 0.78);
            font-size: 22px;
            cursor: pointer;
            line-height: 1;
        }

        .department-row {
            background: rgba(4, 12, 24, 0.42);
            border: 1px solid rgba(255, 255, 255, 0.10);
            border-radius: 16px;
            padding: 11px 12px;
            display: grid;
            gap: 8px;
        }

        .department-row-top {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
        }

        .department-name {
            margin: 0;
            color: #fff;
            font-size: 13px;
        }

        .department-desc {
            margin: 0;
            color: rgba(255, 255, 255, 0.62);
            font-size: 11px;
            line-height: 1.8;
        }

        .department-actions {
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }

        .department-status {
            font-size: 10px;
            padding: 4px 8px;
            border-radius: 999px;
            border: 1px solid rgba(255, 255, 255, 0.14);
        }

        .department-status-active {
            color: #d7fff2;
            background: rgba(0, 255, 136, 0.12);
            border-color: rgba(0, 255, 136, 0.24);
        }

        .department-status-inactive {
            color: #ffe6eb;
            background: rgba(255, 97, 120, 0.12);
            border-color: rgba(255, 97, 120, 0.24);
        }

        .department-form {
            display: grid;
            gap: 10px;
            background: rgba(255, 255, 255, 0.04);
            border: 1px solid rgba(255, 255, 255, 0.10);
            border-radius: 14px;
            padding: 10px;
        }

        .department-form-title {
            margin: 0;
            color: #fff;
            font-size: 12px;
        }

        .permission-group {
            display: grid;
            gap: 8px;
        }

        .permission-group-title {
            color: rgba(255, 255, 255, 0.74);
            font-size: 0.82rem;
            letter-spacing: 0.08em;
            text-transform: uppercase;
        }

        .permission-list {
            display: grid;
            gap: 8px;
        }

        .permission-option {
            display: flex;
            gap: 8px;
            align-items: flex-start;
            padding: 10px 12px;
            border: 1px solid rgba(255, 255, 255, 0.16);
            border-radius: 12px;
            background: rgba(255, 255, 255, 0.04);
            color: rgba(255, 255, 255, 0.9);
        }

        .permission-option input {
            margin-top: 4px;
            accent-color: #00c58a;
        }

        .permission-option-text {
            display: grid;
            gap: 4px;
        }

        .permission-option-title {
            color: #fff;
            font-size: 0.86rem;
        }

        .permission-option-desc {
            color: rgba(255, 255, 255, 0.62);
            font-size: 0.78rem;
            line-height: 1.8;
        }

        .profile-overview {
            display: grid;
            gap: 16px;
        }

        .profile-hero {
            display: grid;
            grid-template-columns: auto minmax(0, 1fr);
            gap: 16px;
            align-items: center;
            padding: 18px;
            border-radius: 22px;
            background: linear-gradient(135deg, rgba(0, 255, 136, 0.13), rgba(0, 204, 255, 0.08));
            border: 1px solid rgba(0, 255, 184, 0.18);
        }

        .profile-avatar-large {
            width: 86px;
            height: 86px;
            border-radius: 28px;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            color: #061322;
            background: linear-gradient(135deg, #00ff88 0%, #00ccff 100%);
            font-size: 32px;
            font-weight: bold;
            box-shadow: 0 8px 28px rgba(0, 255, 136, 0.22);
        }

        .profile-avatar-large img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .profile-hero h3 {
            margin: 0;
            color: #fff;
            font-size: 20px;
            line-height: 1.8;
        }

        .profile-hero p {
            margin: 0;
            color: rgba(255, 255, 255, 0.62);
            font-size: 12px;
            line-height: 1.9;
        }

        .profile-role-list {
            display: flex;
            gap: 6px;
            flex-wrap: wrap;
            margin-top: 8px;
        }

        .profile-meta-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 10px;
        }

        .profile-meta-item {
            min-width: 0;
            padding: 12px;
            border-radius: 16px;
            background: rgba(4, 12, 24, 0.42);
            border: 1px solid rgba(255, 255, 255, 0.10);
        }

        .profile-meta-item span {
            display: block;
            color: rgba(255, 255, 255, 0.50);
            font-size: 11px;
            margin-bottom: 5px;
        }

        .profile-meta-item strong {
            display: block;
            color: #fff;
            font-size: 13px;
            line-height: 1.8;
            overflow-wrap: anywhere;
        }

        .profile-avatar-tools {
            display: grid;
            gap: 10px;
            padding: 12px;
            border-radius: 16px;
            background: rgba(255, 255, 255, 0.04);
            border: 1px dashed rgba(255, 255, 255, 0.14);
        }

        .profile-avatar-tools input[type="file"] {
            color: rgba(255, 255, 255, 0.72);
            font-family: inherit;
        }

        .profile-avatar-preview-row {
            display: grid;
            grid-template-columns: auto minmax(0, 1fr);
            gap: 12px;
            align-items: center;
        }

        .profile-avatar-help {
            margin: 0;
            color: rgba(255, 255, 255, 0.58);
            font-size: 11px;
            line-height: 1.9;
        }

        .profile-security-note {
            border-radius: 16px;
            padding: 12px;
            background: rgba(0, 255, 136, 0.08);
            border: 1px solid rgba(0, 255, 136, 0.18);
            color: rgba(255, 255, 255, 0.72);
            font-size: 12px;
            line-height: 1.9;
        }

        .letter-list {
            display: grid;
            gap: 10px;
        }

        .letter-list-head,
        .letter-row-main {
            display: grid;
            grid-template-columns: minmax(170px, 2.2fr) minmax(120px, 1.1fr) minmax(120px, 1fr) minmax(115px, 1fr) minmax(130px, 1.2fr) minmax(110px, 0.9fr);
            gap: 10px;
            align-items: center;
        }

        .letter-list-head {
            padding: 10px 14px;
            border: 1px solid rgba(255, 255, 255, 0.14);
            border-radius: 14px;
            background: rgba(255, 255, 255, 0.05);
            color: rgba(255, 255, 255, 0.72);
            font-size: 11px;
        }

        .letter-list-head span {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .letter-row {
            border: 1px solid rgba(255, 255, 255, 0.12);
            border-radius: 16px;
            background: rgba(4, 12, 24, 0.42);
            transition: border-color 0.2s ease, transform 0.2s ease;
        }

        .letter-row:hover {
            border-color: rgba(0, 255, 184, 0.24);
            transform: translateY(-1px);
        }

        .letter-row.is-expanded {
            border-color: rgba(0, 255, 184, 0.32);
            background: rgba(5, 18, 31, 0.58);
        }

        .letter-row-main {
            width: 100%;
            border: 0;
            background: transparent;
            color: #fff;
            text-align: right;
            padding: 12px 14px;
            cursor: pointer;
            font: inherit;
        }

        .letter-row-main:focus-visible {
            outline: 2px solid rgba(0, 255, 184, 0.52);
            outline-offset: -2px;
            border-radius: 16px;
        }

        .letter-main-subject {
            display: grid;
            gap: 3px;
            min-width: 0;
        }

        .letter-main-subject strong {
            color: #fff;
            font-size: 13px;
            line-height: 1.8;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .letter-main-sub {
            color: rgba(255, 255, 255, 0.56);
            font-size: 11px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .letter-main-cell {
            color: rgba(255, 255, 255, 0.74);
            font-size: 12px;
            min-width: 0;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .letter-row-actions {
            display: grid;
            grid-template-rows: 0fr;
            transition: grid-template-rows 0.32s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
            opacity: 0;
            overflow: hidden;
            margin: 0;
            padding: 0;
        }

        .letter-row.is-expanded .letter-row-actions {
            grid-template-rows: 1fr;
            opacity: 1;
        }

        .letter-row-actions-inner {
            min-height: 0;
            overflow: hidden;
            border-top: 1px dashed rgba(255, 255, 255, 0.14);
            padding: 16px 20px;
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .letter-row-meta {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
        }

        .letter-row-btns {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 10px;
        }

        @media (max-width: 760px) {
            .org-card-actions {
                grid-template-columns: 1fr;
            }

            .org-list-header {
                flex-direction: column;
            }

            .org-toolbar-actions {
                width: 100%;
            }

            .org-toolbar-actions .org-btn,
            .org-toolbar-actions .org-list-meta {
                width: 100%;
                justify-content: center;
            }

            .letter-list-head {
                display: none;
            }

            .letter-row-main {
                grid-template-columns: repeat(2, minmax(0, 1fr));
                gap: 8px;
                align-items: flex-start;
            }

            .letter-main-subject {
                grid-column: 1 / -1;
            }

            .letter-row-btns {
                grid-template-columns: 1fr 1fr;
            }

            .org-modal {
                padding: 10px;
            }

            .org-modal-card {
                max-height: min(92vh, 760px);
            }

            .profile-modal-card {
                max-height: calc(100vh - 20px);
                border-radius: 22px;
            }

            .org-modal-header {
                flex-direction: column;
                align-items: stretch;
            }

            .org-modal-header-actions {
                width: 100%;
                justify-content: space-between;
            }

            .org-modal-header-actions .org-btn {
                flex: 1;
                min-width: 0;
            }
        }

        .stagger-in {
            opacity: 0;
            animation: cardIn 620ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
        }

        .stagger-in:nth-child(1) { animation-delay: 90ms; }
        .stagger-in:nth-child(2) { animation-delay: 160ms; }
        .stagger-in:nth-child(3) { animation-delay: 230ms; }
        .stagger-in:nth-child(4) { animation-delay: 300ms; }

        @keyframes cardIn {
            from { opacity: 0; transform: translateY(20px); filter: blur(4px); }
            to { opacity: 1; transform: translateY(0); filter: blur(0); }
        }

        @media (max-width: 1180px) {
            .dashboard-shell {
                grid-template-columns: 250px minmax(0, 1fr);
            }

            .dashboard-hero,
            .workspace-grid {
                grid-template-columns: 1fr;
            }

            .stats-grid {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }

            .quick-actions {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }
        }

        @media (max-width: 760px) {
            #app-container {
                position: fixed;
                overflow-y: auto;
                height: 100%;
            }

            .dashboard-shell {
                grid-template-columns: 1fr;
                height: auto;
                min-height: 100%;
            }

            .sidebar,
            .main-content {
                height: auto;
            }

            .top-header,
            .header-info {
                align-items: flex-start;
                flex-direction: column;
            }

            .stats-grid,
            .quick-actions {
                grid-template-columns: 1fr;
            }
        }

        body.theme-dark {
            color-scheme: dark;
        }

        body.theme-light {
            color-scheme: light;
            color: #11253c;
        }

        body.theme-light .topology-background {
            background: linear-gradient(180deg, #eef5fd 0%, #e4edf9 52%, #dce8f6 100%);
        }

        body.theme-light .topology-overlay {
            background:
                radial-gradient(circle at 10% 12%, rgba(0, 153, 126, 0.09), transparent 38%),
                radial-gradient(circle at 84% 10%, rgba(0, 132, 255, 0.08), transparent 38%),
                linear-gradient(180deg, rgba(255, 255, 255, 0.28) 0%, rgba(235, 243, 252, 0.54) 100%);
        }

        body.theme-light.auth-transition .topology-background,
        body.theme-light.dashboard-mode .topology-background {
            filter: brightness(0.94) saturate(0.95);
        }

        body.theme-light.auth-transition .topology-overlay,
        body.theme-light.dashboard-mode .topology-overlay {
            opacity: 0.88;
        }

        body.theme-light .login-container {
            background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(239, 247, 255, 0.94));
            border-color: rgba(18, 37, 60, 0.14);
            box-shadow: 0 28px 78px rgba(16, 35, 58, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.92);
        }

        body.theme-light .login-form-panel {
            background: rgba(255, 255, 255, 0.97);
            border-color: rgba(22, 44, 68, 0.16);
        }

        body.theme-light .login-info-panel {
            background:
                linear-gradient(145deg, rgba(0, 160, 122, 0.16), rgba(0, 153, 214, 0.10) 46%, rgba(109, 81, 221, 0.11)),
                rgba(245, 250, 255, 0.96);
            border-color: rgba(0, 138, 122, 0.27);
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 24px 58px rgba(0, 46, 76, 0.15);
        }

        body.theme-light .login-header h2,
        body.theme-light .system-title,
        body.theme-light .feature-item strong,
        body.theme-light .spec-card strong {
            color: #10243c;
            text-shadow: none;
        }

        body.theme-light .login-header p,
        body.theme-light .system-description,
        body.theme-light .feature-item span,
        body.theme-light .spec-card span,
        body.theme-light .system-kicker {
            color: rgba(16, 36, 60, 0.72);
        }

        body.theme-light .system-kicker {
            color: #12324d;
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(228, 244, 255, 0.86));
            border-color: rgba(18, 50, 77, 0.18);
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
            text-shadow: none;
        }

        body.theme-light .system-kicker svg {
            color: #0b8f76;
        }

        body.theme-light .form-group label,
        body.theme-light .remember-me label {
            color: rgba(16, 36, 60, 0.90);
        }

        body.theme-light .input-wrapper input {
            background: rgba(255, 255, 255, 0.85);
            border-color: rgba(16, 36, 60, 0.16);
            color: #10243c;
        }

        body.theme-light .input-wrapper input::placeholder {
            color: rgba(16, 36, 60, 0.42);
        }

        body.theme-light .input-wrapper .input-icon {
            color: rgba(16, 36, 60, 0.48);
        }

        body.theme-light .input-wrapper input:focus {
            background: rgba(255, 255, 255, 0.98);
            border-color: #00c58a;
            box-shadow: 0 0 0 4px rgba(0, 197, 138, 0.16);
        }

        body.theme-light .input-wrapper input:focus ~ .input-icon {
            color: #008f73;
        }

        body.theme-light .feature-item {
            background: rgba(255, 255, 255, 0.64);
            border-color: rgba(16, 36, 60, 0.11);
        }

        body.theme-light .spec-card {
            background: rgba(255, 255, 255, 0.68);
            border-color: rgba(16, 36, 60, 0.11);
        }

        body.theme-light .asset-cache-modal {
            background: rgba(235, 244, 253, 0.72);
        }

        body.theme-light .asset-cache-card {
            background: linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(240, 247, 255, 0.90));
            border-color: rgba(16, 36, 60, 0.12);
            box-shadow: 0 18px 56px rgba(12, 33, 56, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.88);
            color: #10243c;
        }

        body.theme-light .asset-cache-subtitle,
        body.theme-light .asset-cache-progress-row,
        body.theme-light .asset-cache-file {
            color: rgba(16, 36, 60, 0.62);
        }

        body.theme-light .asset-cache-track {
            background: rgba(16, 36, 60, 0.08);
            border-color: rgba(16, 36, 60, 0.10);
        }

        body.theme-light #app-container {
            background:
                radial-gradient(circle at 12% 0%, rgba(0, 185, 146, 0.11), transparent 28%),
                radial-gradient(circle at 96% 18%, rgba(97, 122, 246, 0.11), transparent 30%),
                linear-gradient(135deg, #edf4fb 0%, #e6effa 48%, #dce8f6 100%);
            color: #10243c;
        }

        body.theme-light .sidebar {
            background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(243, 249, 255, 0.88) 100%);
            border-color: rgba(16, 36, 60, 0.12);
            box-shadow: 0 18px 54px rgba(12, 33, 56, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
        }

        body.theme-light .sidebar-header,
        body.theme-light .sidebar-footer {
            border-color: rgba(16, 36, 60, 0.10);
        }

        body.theme-light .sidebar-header h3,
        body.theme-light .user-name,
        body.theme-light .header-title h1,
        body.theme-light .workspace-card h3,
        body.theme-light .stat-card .value,
        body.theme-light .activity-item strong,
        body.theme-light .task-item strong,
        body.theme-light .generic-view h2 {
            color: #10243c;
        }

        body.theme-light .sidebar-header span,
        body.theme-light .user-role,
        body.theme-light .header-title p,
        body.theme-light .stat-card h3,
        body.theme-light .stat-meta,
        body.theme-light .activity-item span,
        body.theme-light .task-item span,
        body.theme-light .generic-view p {
            color: rgba(16, 36, 60, 0.62);
        }

        body.theme-light .user-info,
        body.theme-light .main-content,
        body.theme-light .quick-action,
        body.theme-light .stat-card,
        body.theme-light .workspace-card {
            background: rgba(255, 255, 255, 0.72);
            border-color: rgba(16, 36, 60, 0.11);
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
        }

        body.theme-light .user-info:hover,
        body.theme-light .user-info.profile-open {
            background: rgba(255, 255, 255, 0.86);
            border-color: rgba(0, 145, 120, 0.22);
        }

        body.theme-light .user-profile-chevron {
            color: rgba(16, 36, 60, 0.52);
        }

        body.theme-light .profile-menu {
            background: rgba(255, 255, 255, 0.98);
            border-color: rgba(16, 36, 60, 0.13);
            box-shadow: 0 18px 50px rgba(12, 33, 56, 0.16);
        }

        body.theme-light .profile-menu-item {
            color: rgba(16, 36, 60, 0.78);
        }

        body.theme-light .profile-menu-item:hover {
            color: #10243c;
            background: rgba(16, 185, 129, 0.10);
        }

        body.theme-light .menu-item {
            color: rgba(16, 36, 60, 0.72);
        }

        body.theme-light .menu-item:hover {
            background: rgba(16, 36, 60, 0.06);
            color: #10243c;
            border-color: rgba(0, 185, 146, 0.22);
        }

        body.theme-light .menu-item.active {
            background: linear-gradient(135deg, rgba(0, 185, 146, 0.14), rgba(0, 168, 255, 0.10));
            color: #10243c;
            border-color: rgba(0, 185, 146, 0.26);
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
        }

        body.theme-light .btn-logout {
            background: rgba(255, 255, 255, 0.72);
            border-color: rgba(16, 36, 60, 0.14);
            color: #10243c;
        }

        body.theme-light .btn-logout:hover {
            background: rgba(255, 106, 126, 0.20);
            border-color: rgba(255, 90, 116, 0.38);
        }

        body.theme-light .top-header {
            background: rgba(255, 255, 255, 0.66);
            border-color: rgba(16, 36, 60, 0.10);
        }

        body.theme-light .live-clock,
        body.theme-light .header-pill {
            background: rgba(255, 255, 255, 0.72);
            color: #10243c;
            border-color: rgba(16, 36, 60, 0.12);
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
        }

        body.theme-light .header-pill {
            color: rgba(16, 36, 60, 0.78);
        }

        body.theme-light .content-area {
            background:
                radial-gradient(circle at 20% 0%, rgba(0, 185, 146, 0.09), transparent 28%),
                radial-gradient(circle at 95% 25%, rgba(118, 91, 236, 0.09), transparent 30%);
        }

        body.theme-light .quick-action span {
            color: rgba(16, 36, 60, 0.64);
        }

        body.theme-light .activity-item,
        body.theme-light .task-item {
            background: rgba(241, 247, 255, 0.84);
            border-color: rgba(16, 36, 60, 0.11);
        }

        body.theme-light .org-form-card,
        body.theme-light .org-list-card,
        body.theme-light .org-modal-card {
            background: rgba(255, 255, 255, 0.9);
            border-color: rgba(16, 36, 60, 0.12);
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
        }

        body.theme-light .org-modal-card {
            background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(242, 248, 255, 0.97));
            border-color: rgba(16, 36, 60, 0.16);
            box-shadow: 0 24px 70px rgba(9, 30, 50, 0.23), inset 0 1px 0 rgba(255, 255, 255, 0.94);
        }

        body.theme-light .org-form-card h3,
        body.theme-light .org-list-header h3,
        body.theme-light .org-modal-title,
        body.theme-light .org-empty-state strong,
        body.theme-light .org-card-title,
        body.theme-light .department-name,
        body.theme-light .department-form-title {
            color: #10243c;
        }

        body.theme-light .org-form-card p,
        body.theme-light .org-list-header p,
        body.theme-light .org-form-intro,
        body.theme-light .org-empty-state p,
        body.theme-light .org-card-sub,
        body.theme-light .org-card-desc,
        body.theme-light .department-desc {
            color: rgba(16, 36, 60, 0.68);
        }

        body.theme-light .org-field label {
            color: rgba(16, 36, 60, 0.88);
        }

        body.theme-light .org-field input[type="text"],
        body.theme-light .org-field input[type="password"],
        body.theme-light .org-field input[type="number"],
        body.theme-light .org-field input[type="datetime-local"],
        body.theme-light .org-field input[type="file"],
        body.theme-light .org-field textarea,
        body.theme-light .org-field select {
            background: rgba(240, 247, 255, 0.92);
            border-color: rgba(16, 36, 60, 0.15);
            color: #10243c;
        }

        body.theme-light .org-field input::placeholder,
        body.theme-light .org-field textarea::placeholder {
            color: rgba(16, 36, 60, 0.42);
        }

        body.theme-light .org-field input[type="text"]:focus,
        body.theme-light .org-field input[type="password"]:focus,
        body.theme-light .org-field input[type="number"]:focus,
        body.theme-light .org-field input[type="datetime-local"]:focus,
        body.theme-light .org-field input[type="file"]:focus,
        body.theme-light .org-field textarea:focus,
        body.theme-light .org-field select:focus {
            border-color: rgba(0, 145, 120, 0.42);
            box-shadow: 0 0 0 3px rgba(0, 145, 120, 0.12);
        }

        body.theme-light .org-card,
        body.theme-light .department-row,
        body.theme-light .department-form {
            background: rgba(241, 247, 255, 0.84);
            border-color: rgba(16, 36, 60, 0.12);
        }

        body.theme-light .org-logo {
            background: rgba(255, 255, 255, 0.92);
            border-color: rgba(16, 36, 60, 0.16);
            color: rgba(16, 36, 60, 0.72);
        }

        body.theme-light .org-modal {
            background: rgba(20, 40, 66, 0.52);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
        }

        body.theme-light .org-btn,
        body.theme-light .org-card-btn {
            color: #10243c;
            background: rgba(255, 255, 255, 0.9);
            border-color: rgba(16, 36, 60, 0.14);
        }

        body.theme-light .org-btn:hover,
        body.theme-light .org-card-btn:hover {
            border-color: rgba(0, 145, 120, 0.28);
            background: rgba(248, 252, 255, 0.98);
        }

        body.theme-light .org-btn-primary,
        body.theme-light .org-card-btn.org-btn-primary {
            color: #06321f;
            background: linear-gradient(135deg, rgba(34, 197, 94, 0.24), rgba(14, 165, 233, 0.20));
            border-color: rgba(0, 145, 120, 0.34);
        }

        body.theme-light .org-btn-danger,
        body.theme-light .org-card-btn-danger {
            color: #8f1230;
            background: rgba(244, 63, 94, 0.12);
            border-color: rgba(225, 29, 72, 0.24);
        }

        body.theme-light .org-message-success {
            color: #075f45;
            background: rgba(16, 185, 129, 0.13);
            border-color: rgba(5, 150, 105, 0.24);
        }

        body.theme-light .org-message-error {
            color: #9f1239;
            background: rgba(244, 63, 94, 0.11);
            border-color: rgba(225, 29, 72, 0.22);
        }

        body.theme-light .department-status {
            border-color: rgba(16, 36, 60, 0.14);
        }

        body.theme-light .department-status-active {
            color: #066044;
            background: rgba(16, 185, 129, 0.13);
            border-color: rgba(5, 150, 105, 0.24);
        }

        body.theme-light .department-status-inactive {
            color: #9f1239;
            background: rgba(244, 63, 94, 0.11);
            border-color: rgba(225, 29, 72, 0.22);
        }

        body.theme-light .permission-group-title {
            color: rgba(16, 36, 60, 0.62);
        }

        body.theme-light .permission-option {
            color: rgba(16, 36, 60, 0.86);
            background: rgba(241, 247, 255, 0.84);
            border-color: rgba(16, 36, 60, 0.12);
        }

        body.theme-light .permission-option:hover {
            background: rgba(235, 245, 255, 0.96);
            border-color: rgba(0, 145, 120, 0.22);
        }

        body.theme-light .permission-option-title {
            color: #10243c;
        }

        body.theme-light .permission-option-desc {
            color: rgba(16, 36, 60, 0.62);
        }

        body.theme-light .profile-hero {
            background: linear-gradient(135deg, rgba(16, 185, 129, 0.13), rgba(14, 165, 233, 0.10));
            border-color: rgba(0, 145, 120, 0.18);
        }

        body.theme-light .profile-hero h3,
        body.theme-light .profile-meta-item strong {
            color: #10243c;
        }

        body.theme-light .profile-hero p,
        body.theme-light .profile-meta-item span,
        body.theme-light .profile-security-note {
            color: rgba(16, 36, 60, 0.64);
        }

        body.theme-light .profile-meta-item {
            background: rgba(241, 247, 255, 0.84);
            border-color: rgba(16, 36, 60, 0.12);
        }

        body.theme-light .profile-avatar-tools {
            background: rgba(241, 247, 255, 0.74);
            border-color: rgba(16, 36, 60, 0.14);
        }

        body.theme-light .profile-avatar-tools input[type="file"] {
            color: rgba(16, 36, 60, 0.72);
        }

        body.theme-light .profile-avatar-help {
            color: rgba(16, 36, 60, 0.58);
        }

        body.theme-light .profile-security-note {
            background: rgba(16, 185, 129, 0.10);
            border-color: rgba(5, 150, 105, 0.18);
        }

        body.theme-light .org-list-meta {
            color: rgba(16, 36, 60, 0.72);
            background: rgba(255, 255, 255, 0.86);
            border-color: rgba(16, 36, 60, 0.14);
        }

        .format-manager { --format-surface: #172338; --format-soft: #1c2c43; --format-ink: #edf3fc; --format-muted: #b3c2d6; --format-border: #344760; --format-accent: #93b8ff; display: grid; gap: 24px; color: var(--format-ink); }
        body.theme-light .format-manager { --format-surface: #fff; --format-soft: #f5f8fd; --format-ink: #20324d; --format-muted: #526681; --format-border: #dce5f0; --format-accent: #285cc4; }
        .format-manager .org-list-card { background: var(--format-surface); border: 1px solid var(--format-border); border-radius: 22px; padding: clamp(18px, 3vw, 32px); box-shadow: 0 8px 32px rgba(15, 35, 65, .05); min-width: 0; }
        .format-manager h2, .format-manager h3, .format-manager h4 { color: var(--format-ink); line-height: 1.6; }
        .format-manager h2 { font-size: clamp(22px, 3vw, 30px); font-weight: 800; margin-block: 8px; }
        .format-manager h3 { font-size: 19px; font-weight: 700; }
        .format-manager p, .format-manager small { color: var(--format-muted); }
        .format-hero { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 24px; padding: 12px 4px; }
        .format-eyebrow { color: var(--format-accent); font-size: 12px; font-weight: 700; }
        .format-steps { display: flex; flex-wrap: wrap; gap: 20px; padding: 0; margin: 0; list-style: none; font-size: 12px; color: var(--format-muted); }
        .format-steps li { display: flex; align-items: center; gap: 8px; }
        .format-steps span { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--format-border); border-radius: 50%; background: var(--format-surface); color: var(--format-accent); }
        .format-count { border-radius: 30px; padding: 7px 14px; background: var(--format-soft); color: var(--format-accent); font-size: 12px; white-space: nowrap; }
        .format-manager [hidden] { display: none !important; }
        .format-manager p { line-height: 1.9; }
        .format-filters { margin-block: 8px 24px; }
        .format-filters label { color: var(--format-muted); font-size: 12px; }
        .format-manager .format-filters input, .format-manager .format-filters select { min-height: 46px; border: 1px solid var(--format-border); border-radius: 12px; background-color: var(--format-soft); color: var(--format-ink); }
        .format-manager .format-filters input::placeholder { color: var(--format-muted); opacity: 1; }
        .format-group { margin-block: 24px; }
        .format-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
        .format-group h4 { font-size: 14px; padding-inline-start: 12px; border-inline-start: 3px solid var(--format-accent); margin-bottom: 18px; }
        .format-card { display: flex; flex-direction: column; gap: 20px; padding: 20px; text-align: start; color: inherit; background: var(--format-surface); border: 1px solid var(--format-border); border-radius: 18px; cursor: pointer; min-width: 0; transition: border-color .18s, box-shadow .18s, transform .18s; }
        .format-card:hover { border-color: var(--format-accent); box-shadow: 0 12px 26px rgba(25, 65, 130, .1); transform: translateY(-3px); }
        .format-card:focus-visible, .format-manager summary:focus-visible { outline: 3px solid #2563eb; outline-offset: 3px; }
        .format-card img, .format-selection img { width: 72px; height: 102px; object-fit: contain; background: white; border-radius: 6px; }
        .format-card img { width: 100%; height: 190px; padding: 14px; border: 1px solid var(--format-border); border-radius: 12px; }
        .format-card strong { font-size: 15px; overflow-wrap: anywhere; }
        .format-card > span > span { color: var(--format-accent); font-size: 12px; padding-top: 12px; border-top: 1px solid var(--format-border); }
        .format-card > span { width: 100%; }
        .format-card .format-state { justify-self: start; padding: 4px 10px; border-radius: 30px; background: var(--format-soft); color: var(--format-muted); }
        .format-card .is-published { background: #dcf5e9; color: #176041; }
        .format-card .is-draft { background: #fff0d2; color: #7a4c09; }
        .format-card > span { display: grid; gap: 10px; }
        .format-card small { font-size: 13px; }
        .format-selection { display: flex; align-items: center; gap: 20px; margin-block: 24px; }
        .format-help, .format-publish { padding: 22px; margin-block: 24px; border: 1px solid var(--format-border); border-radius: 16px; background: var(--format-soft); }
        .format-selection { padding-bottom: 20px; border-bottom: 1px solid var(--format-border); }
        .format-selection h3 { overflow-wrap: anywhere; }
        .format-selection img { flex-shrink: 0; box-shadow: 0 4px 16px rgba(15, 35, 65, .1); }
        .format-manager .org-btn { min-height: 44px; border-radius: 11px; padding: 10px 18px; border: 1px solid var(--format-border); background: var(--format-surface); color: var(--format-ink); box-shadow: none; }
        .format-manager .org-btn-primary { background: #315fc3; border-color: #315fc3; color: #fff; }
        .format-manager .org-btn:disabled { opacity: .45; cursor: not-allowed; }
        .format-manager .org-btn:focus-visible { outline: 3px solid var(--format-accent); outline-offset: 3px; }
        .format-manager .org-toolbar-actions { gap: 10px; flex-wrap: wrap; }
        .format-manager #letterFormatValidation:not(:empty) { margin-top: 20px; padding: 12px 16px; border-inline-start: 3px solid var(--format-accent); background: var(--format-surface); border-radius: 8px; }
        @media (max-width: 575px) { .format-cards { grid-template-columns: minmax(0, 1fr); } .format-steps { gap: 10px; } .format-manager .org-toolbar-actions > button { flex: 1 1 100%; } .format-selection { gap: 12px; } }
        @media (prefers-reduced-motion: reduce) { .format-card { transition: none; } .format-card:hover { transform: none; } }
        .format-help summary { cursor: pointer; font-weight: 600; }
        .format-help button { margin-block: 8px; }
        .format-manager [aria-busy="true"] button { pointer-events: none; opacity: .6; }
        .format-empty { padding: 24px; text-align: center; }
        .letter-format-workspace { display:grid; grid-template-columns:320px minmax(0,1fr); gap:18px; }
        .letter-format-sidebar, .letter-format-main { min-height:680px; padding:20px; }
        .letter-format-sidebar input { width:100%; margin:14px 0; padding:11px 14px; border:1px solid rgba(148,163,184,.3); border-radius:10px; background:rgba(15,23,42,.45); color:inherit; }
        .letter-format-org { width:100%; display:grid; grid-template-columns:42px 1fr 10px; gap:10px; align-items:center; text-align:right; border:0; border-radius:12px; padding:11px; margin:5px 0; color:inherit; background:transparent; }
        .letter-format-org:hover, .letter-format-org.active { background:rgba(14,165,233,.13); }
        .letter-format-org-avatar { display:grid; place-items:center; width:42px; height:42px; border-radius:12px; background:linear-gradient(135deg,#0284c7,#14b8a6); color:#fff; font-weight:800; }
        .letter-format-org strong, .letter-format-org small { display:block; } .letter-format-org small { margin-top:4px; opacity:.62; }
        .letter-format-dot { width:8px; height:8px; border-radius:50%; background:#64748b; } .letter-format-dot.draft { background:#f59e0b; } .letter-format-dot.published { background:#10b981; }
        .letter-format-empty, #letterFormatEditorStatus { min-height:580px; display:flex; flex-direction:column; gap:8px; align-items:center; justify-content:center; opacity:.7; }
        .letter-format-titlebar { display:flex; justify-content:space-between; gap:20px; align-items:center; } .letter-format-meta { display:flex; gap:10px; align-items:center; opacity:.75; }
        .letter-format-badge { padding:4px 9px; border-radius:999px; background:#64748b33; } .letter-format-badge.published { background:#10b98133; color:#34d399; } .letter-format-badge.draft { background:#f59e0b33; color:#fbbf24; }
        .letter-format-guide { margin:16px 0; padding:12px 15px; border:1px solid rgba(14,165,233,.25); border-radius:10px; background:rgba(14,165,233,.08); }
        .letter-format-editor-shell { position:relative; height:570px; overflow:hidden; border:1px solid rgba(148,163,184,.25); border-radius:12px; } #letterFormatEditor, #letterFormatEditorMount { width:100%; height:100%; } #letterFormatEditorStatus { position:absolute; inset:0; min-height:0; }
        body.theme-light .letter-format-sidebar input { background:#fff; color:#10243c; }
        @media (max-width:900px) { .letter-format-workspace { grid-template-columns:1fr; } .letter-format-sidebar { min-height:auto; } .letter-format-titlebar { align-items:flex-start; flex-direction:column; } }

        body.theme-light .letter-list-head {
            color: rgba(16, 36, 60, 0.74);
            background: rgba(241, 247, 255, 0.9);
            border-color: rgba(16, 36, 60, 0.14);
        }

        body.theme-light .letter-row {
            background: rgba(241, 247, 255, 0.84);
            border-color: rgba(16, 36, 60, 0.12);
        }

        body.theme-light .letter-row.is-expanded {
            background: rgba(234, 243, 255, 0.97);
            border-color: rgba(16, 95, 138, 0.24);
        }

        body.theme-light .letter-row-main {
            color: #10243c;
        }

        body.theme-light .letter-main-subject strong {
            color: #10243c;
        }

        body.theme-light .letter-main-sub,
        body.theme-light .letter-main-cell {
            color: rgba(16, 36, 60, 0.72);
        }

        body.theme-light .letter-row-actions-inner {
            border-top-color: rgba(16, 36, 60, 0.12);
        }

        .seal-signature-thumb {
            height: 140px;
            background: repeating-conic-gradient(rgba(255, 255, 255, 0.07) 0% 25%, transparent 0% 50%) 50% / 18px 18px;
            border-radius: 14px;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 12px;
            margin-bottom: 12px;
            border: 1px solid rgba(255, 255, 255, 0.09);
        }
        body.theme-light .seal-signature-thumb {
            background: repeating-conic-gradient(rgba(0, 0, 0, 0.04) 0% 25%, transparent 0% 50%) 50% / 18px 18px;
            border-color: rgba(16, 36, 60, 0.12);
        }
        .seal-signature-thumb img {
            max-width: 100%;
            max-height: 100%;
            object-fit: contain;
            filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
        }
        .sig-canvas-wrap {
            border: 2px dashed rgba(255, 255, 255, 0.22);
            border-radius: 16px;
            background: rgba(255, 255, 255, 0.02);
            position: relative;
            touch-action: none;
            overflow: hidden;
        }
        body.theme-light .sig-canvas-wrap {
            border-color: rgba(16, 36, 60, 0.2);
            background: rgba(248, 250, 254, 0.85);
        }
        .sig-canvas {
            width: 100%;
            height: 190px;
            display: block;
            cursor: crosshair;
        }
        .sub-tab-pill {
            padding: 8px 18px;
            border-radius: 999px;
            border: 1px solid rgba(255, 255, 255, 0.12);
            background: rgba(255, 255, 255, 0.05);
            color: rgba(255, 255, 255, 0.8);
            font-weight: 600;
            font-size: 0.88rem;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        .sub-tab-pill:hover {
            background: rgba(255, 255, 255, 0.1);
            color: #fff;
        }
        .sub-tab-pill.active {
            background: linear-gradient(135deg, #00d287, #00b4d8);
            border-color: transparent;
            color: #04101e;
            box-shadow: 0 4px 14px rgba(0, 210, 135, 0.28);
        }
        body.theme-light .sub-tab-pill {
            background: rgba(16, 36, 60, 0.05);
            border-color: rgba(16, 36, 60, 0.12);
            color: rgba(16, 36, 60, 0.76);
        }
        body.theme-light .sub-tab-pill:hover {
            background: rgba(16, 36, 60, 0.09);
            color: #10243c;
        }
        body.theme-light .sub-tab-pill.active {
            background: linear-gradient(135deg, #059669, #0284c7);
            color: #fff;
        }
        /* User Management List/Table Styles */
        .user-table-wrap {
            overflow-x: auto;
            border: 1px solid rgba(255, 255, 255, 0.12);
            border-radius: 16px;
            background: rgba(4, 12, 24, 0.42);
            -webkit-overflow-scrolling: touch;
        }
        .user-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 13px;
            color: #fff;
            text-align: right;
        }
        .user-table th {
            padding: 12px 14px;
            background: rgba(255, 255, 255, 0.05);
            color: rgba(255, 255, 255, 0.72);
            font-size: 11.5px;
            font-weight: 600;
            border-bottom: 1px solid rgba(255, 255, 255, 0.12);
            white-space: nowrap;
        }
        .user-table td {
            padding: 11px 14px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.07);
            vertical-align: middle;
        }
        .user-table tbody tr:last-child td { border-bottom: none; }
        .user-table tbody tr { transition: background 0.15s ease; }
        .user-table tbody tr:hover { background: rgba(255, 255, 255, 0.035); }
        .user-cell-user { display: flex; align-items: center; gap: 10px; }
        .user-table-avatar {
            width: 36px;
            height: 36px;
            border-radius: 10px;
            background: rgba(0, 255, 184, 0.12);
            border: 1px solid rgba(0, 255, 184, 0.28);
            color: #00ffb8;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 14px;
            flex-shrink: 0;
        }
        .user-table-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
        .user-table-fullname { font-weight: 600; font-size: 13px; color: #fff; white-space: nowrap; }
        .user-table-username { font-size: 11px; color: rgba(255, 255, 255, 0.52); direction: ltr; text-align: right; }
        .user-cell-org { display: flex; flex-direction: column; gap: 2px; }
        .user-table-org-name { font-weight: 500; color: rgba(255, 255, 255, 0.9); font-size: 12.5px; }
        .user-table-dept-name { font-size: 11px; color: rgba(255, 255, 255, 0.52); }
        .user-cell-role { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
        .user-cell-contact { display: flex; flex-direction: column; gap: 2px; font-size: 11.5px; color: rgba(255, 255, 255, 0.72); }
        .user-row-actions { display: inline-flex; gap: 6px; align-items: center; justify-content: center; white-space: nowrap; }
        .user-row-actions .org-card-btn { padding: 6px 10px; font-size: 11px; display: inline-flex; align-items: center; gap: 4px; }
        .user-search-input {
            padding: 7px 14px;
            border-radius: 12px;
            border: 1px solid rgba(255, 255, 255, 0.14);
            background: rgba(4, 12, 24, 0.45);
            color: #fff;
            font-size: 12px;
            outline: none;
            transition: all 0.2s ease;
            min-width: 200px;
        }
        .user-search-input:focus {
            border-color: rgba(0, 255, 184, 0.4);
            box-shadow: 0 0 0 2px rgba(0, 255, 184, 0.15);
        }
        .user-row-index { color: rgba(255, 255, 255, 0.45); font-size: 11.5px; text-align: center; }

        body.theme-light .user-table-wrap { background: rgba(241, 247, 255, 0.84); border-color: rgba(16, 36, 60, 0.12); }
        body.theme-light .user-table { color: #10243c; }
        body.theme-light .user-table th { background: rgba(241, 247, 255, 0.95); color: rgba(16, 36, 60, 0.74); border-bottom-color: rgba(16, 36, 60, 0.12); }
        body.theme-light .user-table td { border-bottom-color: rgba(16, 36, 60, 0.08); }
        body.theme-light .user-table tbody tr:hover { background: rgba(16, 36, 60, 0.03); }
        body.theme-light .user-table-avatar { background: rgba(0, 145, 120, 0.12); border-color: rgba(0, 145, 120, 0.3); color: #00876c; }
        body.theme-light .user-table-fullname { color: #10243c; }
        body.theme-light .user-table-username { color: rgba(16, 36, 60, 0.56); }
        body.theme-light .user-table-org-name { color: #10243c; }
        body.theme-light .user-table-dept-name { color: rgba(16, 36, 60, 0.56); }
        body.theme-light .user-cell-contact { color: rgba(16, 36, 60, 0.72); }
        body.theme-light .user-search-input { background: rgba(255, 255, 255, 0.9); border-color: rgba(16, 36, 60, 0.14); color: #10243c; }
        body.theme-light .user-search-input:focus { border-color: rgba(0, 145, 120, 0.4); box-shadow: 0 0 0 2px rgba(0, 145, 120, 0.12); }
        body.theme-light .user-row-index { color: rgba(16, 36, 60, 0.45); }

        /* Sub-Organizations Enhanced Cards */
        .suborg-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
            gap: 18px;
        }

        /* Notification bell + dropdown panel */
        .notif-zone { position: relative; }
        .notif-bell {
            position: relative; width: 40px; height: 40px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.12);
            background: rgba(255, 255, 255, 0.04); color: inherit; display: inline-flex; align-items: center; justify-content: center;
            cursor: pointer; transition: background 0.18s ease, border-color 0.18s ease;
        }
        .notif-bell svg { width: 19px; height: 19px; }
        .notif-bell:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.22); }
        .notif-bell[aria-expanded="true"] { background: rgba(42, 209, 163, 0.16); border-color: rgba(42, 209, 163, 0.45); }
        .notif-badge {
            position: absolute; top: -5px; left: -5px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px;
            background: #ef4444; color: #fff; font-size: 11px; font-weight: 700; line-height: 19px; text-align: center;
            box-shadow: 0 0 0 2px rgba(6, 11, 24, 0.92);
        }
        .notif-panel {
            position: absolute; left: 0; top: calc(100% + 10px); width: min(360px, 88vw); max-height: 64vh; overflow: hidden;
            display: flex; flex-direction: column; border-radius: 16px; border: 1px solid rgba(255, 255, 255, 0.14);
            background: rgba(10, 17, 33, 0.97); box-shadow: 0 22px 60px rgba(0, 0, 0, 0.5); backdrop-filter: blur(14px);
            z-index: 60; opacity: 0; visibility: hidden; transform: translateY(-6px);
            transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
        }
        .notif-zone.open .notif-panel { opacity: 1; visibility: visible; transform: translateY(0); }
        .notif-panel-head {
            display: flex; align-items: center; justify-content: space-between; padding: 12px 14px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1); font-size: 13px;
        }
        .notif-mark-all {
            border: none; background: transparent; color: #2ad1a3; font-size: 12px; cursor: pointer; padding: 4px 6px; border-radius: 8px;
        }
        .notif-mark-all:hover { background: rgba(42, 209, 163, 0.12); }
        .notif-list { overflow-y: auto; padding: 6px; }
        .notif-item {
            display: block; width: 100%; text-align: right; border: none; cursor: pointer; padding: 10px 12px; margin-bottom: 4px;
            border-radius: 12px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.07);
            transition: background 0.15s ease;
        }
        .notif-item:hover { background: rgba(255, 255, 255, 0.1); }
        .notif-item.unread { background: rgba(42, 209, 163, 0.09); border-color: rgba(42, 209, 163, 0.25); }
        .notif-item-title { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 3px; }
        .notif-item-body { display: block; font-size: 11.5px; opacity: 0.72; line-height: 1.5; }
        .notif-item-meta { display: block; font-size: 10.5px; opacity: 0.5; margin-top: 5px; }
        .notif-empty { padding: 26px 14px; text-align: center; font-size: 12px; opacity: 0.55; }

        body.theme-light .notif-bell { border-color: rgba(16, 36, 60, 0.16); background: rgba(16, 36, 60, 0.04); }
        body.theme-light .notif-bell:hover { background: rgba(16, 36, 60, 0.08); border-color: rgba(16, 36, 60, 0.28); }
        body.theme-light .notif-badge { box-shadow: 0 0 0 2px #e8f2fb; }
        body.theme-light .notif-panel { background: rgba(255, 255, 255, 0.98); border-color: rgba(16, 36, 60, 0.14); box-shadow: 0 22px 60px rgba(16, 36, 60, 0.2); }
        body.theme-light .notif-panel-head { border-bottom-color: rgba(16, 36, 60, 0.12); color: #10243c; }
        body.theme-light .notif-item { background: rgba(16, 36, 60, 0.03); border-color: rgba(16, 36, 60, 0.08); color: #10243c; }
        body.theme-light .notif-item:hover { background: rgba(16, 36, 60, 0.07); }
        body.theme-light .notif-item.unread { background: rgba(42, 209, 163, 0.12); border-color: rgba(42, 209, 163, 0.35); }

        .suborg-card {
            position: relative;
            background: linear-gradient(145deg, rgba(14, 28, 52, 0.72) 0%, rgba(7, 16, 32, 0.90) 100%);
            border: 1px solid rgba(255, 255, 255, 0.09);
            border-radius: 22px;
            padding: 20px;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            gap: 16px;
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
            transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
            overflow: hidden;
        }

        .suborg-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: linear-gradient(90deg, transparent, rgba(0, 255, 184, 0.45), transparent);
            opacity: 0;
            transition: opacity 0.25s ease;
        }

        .suborg-card:hover {
            border-color: rgba(0, 255, 184, 0.32);
            transform: translateY(-3px);
            box-shadow: 0 14px 36px rgba(0, 0, 0, 0.38), 0 0 24px rgba(0, 255, 184, 0.08);
        }

        .suborg-card:hover::before {
            opacity: 1;
        }

        .suborg-card-head {
            display: flex;
            align-items: flex-start;
            gap: 14px;
        }

        .suborg-avatar {
            width: 58px;
            height: 58px;
            border-radius: 18px;
            border: 1px solid rgba(255, 255, 255, 0.14);
            background: linear-gradient(135deg, rgba(20, 48, 86, 0.8), rgba(12, 28, 52, 0.95));
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            font-size: 20px;
            font-weight: 700;
            color: #38bdf8;
            position: relative;
        }

        .suborg-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }

        .suborg-card-title-wrap {
            flex: 1;
            min-width: 0;
        }

        .suborg-title-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
        }

        .suborg-card-title {
            margin: 0;
            font-size: 15px;
            font-weight: 700;
            color: #ffffff;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            line-height: 1.5;
        }

        .suborg-id-badge {
            font-size: 10px;
            font-weight: 600;
            color: rgba(255, 255, 255, 0.5);
            background: rgba(255, 255, 255, 0.06);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 8px;
            padding: 2px 7px;
            flex-shrink: 0;
            letter-spacing: 0.5px;
        }

        .suborg-card-date {
            margin-top: 4px;
            display: flex;
            align-items: center;
            gap: 5px;
            font-size: 11px;
            color: rgba(255, 255, 255, 0.52);
        }

        .suborg-card-date svg {
            width: 13px;
            height: 13px;
            opacity: 0.7;
        }

        .suborg-card-desc {
            margin: 0;
            font-size: 12px;
            line-height: 1.8;
            color: rgba(255, 255, 255, 0.70);
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
            min-height: 42px;
        }

        .suborg-card-desc.empty {
            color: rgba(255, 255, 255, 0.38);
            font-style: italic;
        }

        .suborg-meta-strip {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 9px 12px;
            background: rgba(255, 255, 255, 0.04);
            border: 1px solid rgba(255, 255, 255, 0.07);
            border-radius: 12px;
            font-size: 12px;
        }

        .suborg-dept-pill {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            color: rgba(255, 255, 255, 0.85);
            font-weight: 500;
        }

        .suborg-dept-pill svg {
            width: 15px;
            height: 15px;
            color: #00ffb8;
        }

        .suborg-dept-count {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 22px;
            height: 20px;
            padding: 0 6px;
            border-radius: 999px;
            font-size: 11px;
            font-weight: 700;
            background: rgba(0, 255, 184, 0.16);
            color: #00ffb8;
            border: 1px solid rgba(0, 255, 184, 0.28);
        }

        .suborg-dept-count.zero {
            background: rgba(255, 255, 255, 0.08);
            color: rgba(255, 255, 255, 0.5);
            border-color: rgba(255, 255, 255, 0.12);
        }

        .suborg-status-pill {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            font-size: 11px;
            color: #38bdf8;
        }

        .suborg-status-pill::before {
            content: '';
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: #38bdf8;
            box-shadow: 0 0 6px #38bdf8;
        }

        .suborg-card-actions {
            display: flex;
            flex-direction: column;
            gap: 8px;
            margin-top: 4px;
        }

        .suborg-primary-btn {
            width: 100%;
            border: 1px solid rgba(0, 255, 184, 0.35);
            background: linear-gradient(135deg, rgba(0, 255, 184, 0.16), rgba(14, 165, 233, 0.14));
            color: #ffffff;
            padding: 9px 14px;
            border-radius: 12px;
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            transition: all 0.2s ease;
        }

        .suborg-primary-btn:hover {
            border-color: rgba(0, 255, 184, 0.6);
            background: linear-gradient(135deg, rgba(0, 255, 184, 0.26), rgba(14, 165, 233, 0.24));
            box-shadow: 0 4px 14px rgba(0, 255, 184, 0.18);
            transform: translateY(-1px);
        }

        .suborg-primary-btn svg {
            width: 16px;
            height: 16px;
            color: #00ffb8;
        }

        .suborg-secondary-actions {
            display: grid;
            grid-template-columns: 1fr 1fr 1fr;
            gap: 6px;
        }

        .suborg-tool-btn {
            border: 1px solid rgba(255, 255, 255, 0.10);
            background: rgba(255, 255, 255, 0.05);
            color: rgba(255, 255, 255, 0.85);
            padding: 7px 8px;
            border-radius: 10px;
            font-size: 11px;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 5px;
            white-space: nowrap;
            transition: all 0.18s ease;
        }

        .suborg-tool-btn:hover {
            background: rgba(255, 255, 255, 0.12);
            border-color: rgba(255, 255, 255, 0.22);
            color: #ffffff;
            transform: translateY(-1px);
        }

        .suborg-tool-btn svg {
            width: 14px;
            height: 14px;
            flex-shrink: 0;
            opacity: 0.8;
        }

        .suborg-tool-btn-danger {
            color: #fca5a5;
            border-color: rgba(239, 68, 68, 0.25);
            background: rgba(239, 68, 68, 0.08);
        }

        .suborg-tool-btn-danger:hover {
            background: rgba(239, 68, 68, 0.20);
            border-color: rgba(239, 68, 68, 0.45);
            color: #fecaca;
        }

        .suborg-empty-filter {
            grid-column: 1 / -1;
            text-align: center;
            padding: 36px 20px;
            border: 1px dashed rgba(255, 255, 255, 0.14);
            border-radius: 20px;
            background: rgba(255, 255, 255, 0.02);
        }

        .suborg-empty-filter strong {
            display: block;
            font-size: 15px;
            color: #ffffff;
            margin-bottom: 6px;
        }

        .suborg-empty-filter p {
            color: rgba(255, 255, 255, 0.6);
            font-size: 13px;
            margin: 0 0 14px;
        }

        /* Light Theme for Sub-Organizations */
        body.theme-light .suborg-card {
            background: linear-gradient(145deg, rgba(255, 255, 255, 0.96) 0%, rgba(243, 248, 255, 0.92) 100%);
            border-color: rgba(16, 36, 60, 0.12);
            box-shadow: 0 6px 20px rgba(16, 36, 60, 0.05);
        }

        body.theme-light .suborg-card:hover {
            border-color: rgba(0, 145, 120, 0.38);
            box-shadow: 0 12px 30px rgba(16, 36, 60, 0.10), 0 0 18px rgba(0, 145, 120, 0.06);
        }

        body.theme-light .suborg-avatar {
            background: linear-gradient(135deg, rgba(230, 242, 255, 0.9), rgba(215, 233, 255, 0.95));
            border-color: rgba(16, 36, 60, 0.14);
            color: #0284c7;
            box-shadow: 0 2px 8px rgba(16, 36, 60, 0.06);
        }

        body.theme-light .suborg-card-title {
            color: #0f172a;
        }

        body.theme-light .suborg-id-badge {
            color: rgba(16, 36, 60, 0.6);
            background: rgba(16, 36, 60, 0.05);
            border-color: rgba(16, 36, 60, 0.12);
        }

        body.theme-light .suborg-card-date {
            color: rgba(16, 36, 60, 0.60);
        }

        body.theme-light .suborg-card-desc {
            color: rgba(16, 36, 60, 0.72);
        }

        body.theme-light .suborg-card-desc.empty {
            color: rgba(16, 36, 60, 0.40);
        }

        body.theme-light .suborg-meta-strip {
            background: rgba(16, 36, 60, 0.03);
            border-color: rgba(16, 36, 60, 0.08);
        }

        body.theme-light .suborg-dept-pill {
            color: #0f172a;
        }

        body.theme-light .suborg-dept-pill svg {
            color: #009178;
        }

        body.theme-light .suborg-dept-count {
            background: rgba(0, 145, 120, 0.12);
            color: #007661;
            border-color: rgba(0, 145, 120, 0.28);
        }

        body.theme-light .suborg-dept-count.zero {
            background: rgba(16, 36, 60, 0.06);
            color: rgba(16, 36, 60, 0.45);
            border-color: rgba(16, 36, 60, 0.10);
        }

        body.theme-light .suborg-status-pill {
            color: #0284c7;
        }

        body.theme-light .suborg-status-pill::before {
            background: #0284c7;
            box-shadow: 0 0 6px #0284c7;
        }

        body.theme-light .suborg-primary-btn {
            background: linear-gradient(135deg, rgba(34, 197, 94, 0.18), rgba(14, 165, 233, 0.16));
            border-color: rgba(0, 145, 120, 0.35);
            color: #064e3b;
        }

        body.theme-light .suborg-primary-btn:hover {
            background: linear-gradient(135deg, rgba(34, 197, 94, 0.26), rgba(14, 165, 233, 0.24));
            border-color: rgba(0, 145, 120, 0.5);
            box-shadow: 0 4px 12px rgba(0, 145, 120, 0.16);
        }

        body.theme-light .suborg-primary-btn svg {
            color: #009178;
        }

        body.theme-light .suborg-tool-btn {
            background: rgba(255, 255, 255, 0.9);
            border-color: rgba(16, 36, 60, 0.12);
            color: #1e293b;
        }

        body.theme-light .suborg-tool-btn:hover {
            background: #ffffff;
            border-color: rgba(0, 145, 120, 0.32);
            color: #0f172a;
        }

        body.theme-light .suborg-tool-btn-danger {
            background: rgba(244, 63, 94, 0.08);
            border-color: rgba(225, 29, 72, 0.20);
            color: #be123c;
        }

        body.theme-light .suborg-tool-btn-danger:hover {
            background: rgba(244, 63, 94, 0.16);
            border-color: rgba(225, 29, 72, 0.36);
            color: #9f1239;
        }

        body.theme-light .suborg-empty-filter {
            background: rgba(16, 36, 60, 0.02);
            border-color: rgba(16, 36, 60, 0.12);
        }

        body.theme-light .suborg-empty-filter strong {
            color: #0f172a;
        }

        body.theme-light .suborg-empty-filter p {
            color: rgba(16, 36, 60, 0.6);
        }

        /* Role Management Table Styles */
        .role-table-wrap {
            overflow-x: auto;
            border: 1px solid rgba(255, 255, 255, 0.12);
            border-radius: 16px;
            background: rgba(4, 12, 24, 0.42);
            -webkit-overflow-scrolling: touch;
        }
        .role-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 13px;
            color: #fff;
            text-align: right;
        }
        .role-table th {
            padding: 12px 14px;
            background: rgba(255, 255, 255, 0.05);
            color: rgba(255, 255, 255, 0.72);
            font-size: 11.5px;
            font-weight: 600;
            border-bottom: 1px solid rgba(255, 255, 255, 0.12);
            white-space: nowrap;
        }
        .role-table td {
            padding: 11px 14px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.07);
            vertical-align: middle;
        }
        .role-table tbody tr:last-child td { border-bottom: none; }
        .role-table tbody tr { transition: background 0.15s ease; }
        .role-table tbody tr:hover { background: rgba(255, 255, 255, 0.035); }
        .role-cell-title { display: flex; align-items: center; gap: 10px; }
        .role-table-avatar {
            width: 36px;
            height: 36px;
            border-radius: 10px;
            background: linear-gradient(135deg, rgba(124, 58, 237, 0.25), rgba(59, 130, 246, 0.25));
            border: 1px solid rgba(139, 92, 246, 0.35);
            color: #c084fc;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 14px;
            flex-shrink: 0;
        }
        .role-table-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
        .role-table-name { font-weight: 600; font-size: 13px; color: #fff; display: flex; align-items: center; gap: 6px; }
        .role-table-id { font-size: 10.5px; font-weight: 500; color: rgba(255, 255, 255, 0.45); background: rgba(255, 255, 255, 0.07); padding: 1px 5px; border-radius: 4px; }
        .role-table-desc { font-size: 11.5px; color: rgba(255, 255, 255, 0.52); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .role-perm-chip-list { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; max-width: 300px; }
        .role-perm-chip {
            font-size: 10.5px;
            padding: 2px 7px;
            border-radius: 6px;
            background: rgba(59, 130, 246, 0.12);
            border: 1px solid rgba(59, 130, 246, 0.25);
            color: #93c5fd;
            white-space: nowrap;
        }
        .role-perm-more {
            font-size: 10.5px;
            padding: 2px 6px;
            border-radius: 6px;
            background: rgba(255, 255, 255, 0.08);
            color: rgba(255, 255, 255, 0.6);
            white-space: nowrap;
        }
        .role-users-badge {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            font-size: 12px;
            font-weight: 600;
            color: rgba(255, 255, 255, 0.85);
            padding: 3px 9px;
            border-radius: 8px;
            background: rgba(255, 255, 255, 0.06);
            border: 1px solid rgba(255, 255, 255, 0.1);
        }
        .role-row-actions { display: inline-flex; gap: 6px; align-items: center; justify-content: center; white-space: nowrap; }
        .role-row-actions .org-card-btn { padding: 5px 9px; font-size: 11px; display: inline-flex; align-items: center; gap: 4px; }

        body.theme-light .role-table-wrap { background: rgba(241, 247, 255, 0.84); border-color: rgba(16, 36, 60, 0.12); }
        body.theme-light .role-table { color: #10243c; }
        body.theme-light .role-table th { background: rgba(241, 247, 255, 0.95); color: rgba(16, 36, 60, 0.74); border-bottom-color: rgba(16, 36, 60, 0.12); }
        body.theme-light .role-table td { border-bottom-color: rgba(16, 36, 60, 0.08); }
        body.theme-light .role-table tbody tr:hover { background: rgba(16, 36, 60, 0.03); }
        body.theme-light .role-table-avatar { background: rgba(124, 58, 237, 0.1); border-color: rgba(124, 58, 237, 0.25); color: #7c3aed; }
        body.theme-light .role-table-name { color: #10243c; }
        body.theme-light .role-table-id { color: rgba(16, 36, 60, 0.5); background: rgba(16, 36, 60, 0.06); }
        body.theme-light .role-table-desc { color: rgba(16, 36, 60, 0.56); }
        body.theme-light .role-perm-chip { background: rgba(2, 132, 199, 0.08); border-color: rgba(2, 132, 199, 0.22); color: #0284c7; }
        body.theme-light .role-perm-more { background: rgba(16, 36, 60, 0.07); color: rgba(16, 36, 60, 0.6); }
        body.theme-light .role-users-badge { background: rgba(16, 36, 60, 0.05); border-color: rgba(16, 36, 60, 0.1); color: #10243c; }
