:root {
    --cloud-dancer: #F1F0EC;
    --cloud-dancer-rgb: 241, 240, 236;
    --mist: #A7B2B5;
    --mist-deep: #7D8D93;
    --accent-soft: #D8D2C7;
    --panel: rgba(255, 255, 255, 0.78);
    --panel-muted: rgba(255, 255, 255, 0.58);
    --border: rgba(125, 141, 147, 0.18);
    --shadow: 0 16px 40px rgba(101, 114, 120, 0.08);
}
* { scrollbar-width: thin; scrollbar-color: rgba(167, 178, 181, 0.68) transparent; }
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(167, 178, 181, 0.68); border-radius: 9999px; }
body {
    background: var(--cloud-dancer);
    color: #4B595F;
    font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
    height: 100vh;
    overflow: hidden;
}
.overlay { position: absolute; inset: 0; pointer-events: none; background: transparent; }
.shell { backdrop-filter: blur(8px); }
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.22));
    border-right: 1px solid var(--border);
    box-shadow: 16px 0 40px rgba(125, 141, 147, 0.06);
}
.sidebar .brand { color: #566369; letter-spacing: 0.08em; }
.sidebar-item {
    padding: 12px 16px;
    margin: 2px 12px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    color: #627076;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}
.sidebar-item:hover {
    background: rgba(167, 178, 181, 0.12);
    color: #4D5A60;
    border-color: rgba(167, 178, 181, 0.18);
    transform: translateX(2px);
}
.sidebar-item.active {
    background: linear-gradient(135deg, rgba(217, 223, 220, 0.96), rgba(196, 206, 210, 0.92));
    color: #445258;
    border-color: rgba(125, 141, 147, 0.16);
    box-shadow: 0 10px 24px rgba(125, 141, 147, 0.14);
}
.sidebar-divider { color: #9CA7AB; letter-spacing: 0.3em; font-size: 10px; }
.card {
    background: linear-gradient(135deg, var(--panel), var(--panel-muted));
    color: #4B595F;
    border-radius: 18px;
    padding: 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.card.dark {
    background: linear-gradient(135deg, rgba(248, 246, 241, 0.9), rgba(236, 233, 224, 0.76));
    color: #4B595F;
    border-color: rgba(125, 141, 147, 0.16);
}
.stat {
    border: 1px solid rgba(167, 178, 181, 0.18);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(242, 239, 232, 0.66));
    color: #4B595F;
    box-shadow: 0 12px 28px rgba(125, 141, 147, 0.08);
}
.terminal {
    background: rgba(104, 116, 122, 0.94);
    color: #F8F7F3;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.glassbar {
    backdrop-filter: blur(16px);
    background: rgba(255, 255, 255, 0.48);
    border: 1px solid rgba(125, 141, 147, 0.16);
    box-shadow: 0 8px 24px rgba(125, 141, 147, 0.06);
}
input, select, textarea {
    border: 1px solid rgba(125, 141, 147, 0.18);
    padding: 12px;
    border-radius: 10px;
    outline: none;
    background: rgba(255, 255, 255, 0.74);
    color: #4B595F;
    transition: border 0.2s, box-shadow 0.2s, transform 0.2s;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--mist);
    box-shadow: 0 0 0 4px rgba(167, 178, 181, 0.16);
    transform: translateY(-1px);
}
option { background: #FCFBF8; color: #4B595F; }
button {
    transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    border: 1px solid rgba(125, 141, 147, 0.1);
}
button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(125, 141, 147, 0.12);
}
.btn-primary {
    background: linear-gradient(135deg, #D9DFDC, #BEC9CD);
    color: #445258;
    font-weight: 700;
    border-radius: 12px;
    padding: 12px 18px;
    border: 1px solid rgba(125, 141, 147, 0.14);
}
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 9999px;
    padding: 6px 12px;
    background: rgba(167, 178, 181, 0.1);
    border: 1px solid rgba(167, 178, 181, 0.2);
    color: #59686E;
    font-size: 12px;
}
table th { text-transform: uppercase; letter-spacing: 0.04em; font-size: 12px; color: #7D8A8E; }
.login-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(248, 245, 238, 0.78));
    color: #4B595F;
    border-radius: 22px;
    padding: 28px;
    box-shadow: 0 18px 42px rgba(125, 141, 147, 0.12);
    border: 1px solid rgba(125, 141, 147, 0.12);
    width: 420px;
}

.skeleton-block {
    position: relative;
    overflow: hidden;
    background: linear-gradient(90deg, rgba(255,255,255,0.55), rgba(246,244,239,0.95), rgba(255,255,255,0.55));
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.6s linear infinite;
    border: 1px solid rgba(125, 141, 147, 0.16);
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.ui-notify-stack {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 210;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: min(380px, calc(100vw - 24px));
}

.ui-notify-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(125, 141, 147, 0.14);
    background: linear-gradient(135deg, rgba(255,255,255,0.92), rgba(248,245,238,0.88));
    box-shadow: 0 18px 40px rgba(88, 101, 108, 0.16);
    backdrop-filter: blur(16px);
    animation: ui-notify-enter 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ui-notify-success { border-color: rgba(16, 185, 129, 0.2); }
.ui-notify-error { border-color: rgba(239, 68, 68, 0.2); }
.ui-notify-warning { border-color: rgba(245, 158, 11, 0.2); }
.ui-notify-info { border-color: rgba(125, 141, 147, 0.18); }

.ui-notify-icon,
.ui-dialog-icon {
    width: 34px;
    height: 34px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    flex-shrink: 0;
}

.ui-icon-svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2.2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ui-notify-success .ui-notify-icon,
.ui-dialog-icon.ui-notify-success {
    background: rgba(16, 185, 129, 0.14);
    color: #047857;
    animation: ui-success-pop 0.45s ease;
}

.ui-notify-error .ui-notify-icon,
.ui-dialog-icon.ui-notify-error {
    background: rgba(239, 68, 68, 0.14);
    color: #b91c1c;
    animation: ui-error-shake 0.46s ease;
}

.ui-notify-warning .ui-notify-icon,
.ui-dialog-icon.ui-notify-warning {
    background: rgba(245, 158, 11, 0.16);
    color: #b45309;
    animation: ui-warning-pulse 1.1s ease;
}

.ui-notify-info .ui-notify-icon,
.ui-dialog-icon.ui-notify-info {
    background: rgba(125, 141, 147, 0.14);
    color: #566369;
    animation: ui-info-float 0.65s ease;
}

.ui-notify-title {
    font-size: 13px;
    font-weight: 800;
    color: #415057;
    margin-bottom: 2px;
}

.ui-notify-message {
    font-size: 13px;
    line-height: 1.6;
    color: #5a6a70;
    word-break: break-word;
    white-space: pre-wrap;
}

.ui-notify-close {
    width: 28px;
    height: 28px;
    border-radius: 9999px;
    padding: 0;
    background: transparent;
    color: #7b8a90;
    box-shadow: none !important;
    flex-shrink: 0;
}

.ui-dialog-mask {
    position: fixed;
    inset: 0;
    z-index: 220;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(34, 44, 49, 0.42);
    backdrop-filter: blur(10px);
}

.ui-dialog-panel {
    width: min(520px, 100%);
    border-radius: 24px;
    border: 1px solid rgba(125, 141, 147, 0.16);
    background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(246,243,236,0.92));
    box-shadow: 0 30px 80px rgba(73, 86, 92, 0.22);
    padding: 22px;
    animation: ui-dialog-enter 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ui-dialog-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.ui-dialog-title {
    font-size: 22px;
    font-weight: 800;
    color: #3f4d53;
}

.ui-dialog-subtitle {
    font-size: 12px;
    color: #8a989d;
    margin-top: 2px;
}

.ui-dialog-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ui-dialog-message {
    font-size: 14px;
    line-height: 1.8;
    color: #55656b;
    white-space: pre-wrap;
    word-break: break-word;
}

.ui-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.ui-dialog-btn-primary,
.ui-dialog-btn-danger,
.ui-dialog-btn-secondary {
    min-width: 112px;
    border-radius: 12px;
    padding: 11px 18px;
    font-weight: 700;
}

.ui-dialog-btn-primary {
    background: linear-gradient(135deg, #D9DFDC, #BEC9CD);
    color: #445258;
}

.ui-dialog-btn-danger {
    background: linear-gradient(135deg, #F7D9D9, #F1B9B9);
    color: #8F2D2D;
}

.ui-dialog-btn-secondary {
    background: rgba(255,255,255,0.72);
    color: #5b6a70;
    border: 1px solid rgba(125, 141, 147, 0.18);
}

.ui-btn-busy {
    position: relative;
    pointer-events: none;
    opacity: 0.82;
    padding-right: 38px !important;
}

.ui-btn-busy::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 14px;
    width: 14px;
    height: 14px;
    margin-top: -7px;
    border-radius: 9999px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    animation: ui-spin 0.8s linear infinite;
    opacity: 0.9;
}

.ui-loading-mask {
    position: fixed;
    inset: 0;
    z-index: 215;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(44, 52, 57, 0.28);
    backdrop-filter: blur(12px);
}

.ui-loading-panel {
    width: min(360px, 100%);
    padding: 24px;
    border-radius: 24px;
    border: 1px solid rgba(125, 141, 147, 0.16);
    background: linear-gradient(135deg, rgba(255,255,255,0.94), rgba(248,245,238,0.92));
    box-shadow: 0 28px 72px rgba(73, 86, 92, 0.18);
    text-align: center;
    animation: ui-dialog-enter 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ui-loading-spinner {
    position: relative;
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
}

.ui-loading-spinner::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 9999px;
    border: 3px solid rgba(125, 141, 147, 0.18);
    border-top-color: #8AA0A7;
    animation: ui-spin 1s linear infinite;
}

.ui-loading-spinner span {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 10px;
    height: 10px;
    border-radius: 9999px;
    background: #9BAEB4;
    animation: ui-loading-bounce 1.2s infinite ease-in-out;
    --tx: 0px;
    --ty: 0px;
}

.ui-loading-spinner span:nth-child(1) { --ty: -20px; animation-delay: 0s; }
.ui-loading-spinner span:nth-child(2) { --tx: 18px; animation-delay: 0.18s; }
.ui-loading-spinner span:nth-child(3) { --tx: -18px; animation-delay: 0.36s; }

.ui-loading-title {
    font-size: 18px;
    font-weight: 800;
    color: #45545A;
    margin-bottom: 8px;
}

.ui-loading-detail {
    font-size: 13px;
    line-height: 1.7;
    color: #7A898E;
}

@keyframes ui-notify-enter {
    from { opacity: 0; transform: translateY(-8px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes ui-dialog-enter {
    from { opacity: 0; transform: translateY(10px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes ui-success-pop {
    0% { transform: scale(0.65); }
    65% { transform: scale(1.12); }
    100% { transform: scale(1); }
}

@keyframes ui-error-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    50% { transform: translateX(3px); }
    75% { transform: translateX(-2px); }
}

@keyframes ui-warning-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

@keyframes ui-info-float {
    0% { transform: translateY(6px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes ui-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes ui-loading-bounce {
    0%, 80%, 100% { transform: translate(var(--tx), var(--ty)) scale(0.85); opacity: 0.45; }
    40% { transform: translate(var(--tx), var(--ty)) scale(1.15); opacity: 1; }
}

@media (max-width: 768px) {
    .ui-notify-stack {
        top: 12px;
        right: 12px;
        left: 12px;
        width: auto;
    }

    .ui-dialog-panel {
        padding: 18px;
    }

    .ui-dialog-actions {
        flex-direction: column-reverse;
    }

    .ui-dialog-btn-primary,
    .ui-dialog-btn-danger,
    .ui-dialog-btn-secondary {
        width: 100%;
    }
}
