:root {
    /* Slate */
    --color-slate-50: #f8fafc;
    --color-slate-100: #f1f5f9;
    --color-slate-200: #e2e8f0;
    --color-slate-300: #cbd5e1;
    --color-slate-400: #94a3b8;
    --color-slate-500: #64748b;
    --color-slate-600: #475569;
    --color-slate-700: #334155;
    --color-slate-800: #1e293b;
    --color-slate-900: #0f172a;

    /* Gray */
    --color-gray-50: #f9fafb;
    --color-gray-100: #f3f4f6;
    --color-gray-200: #e5e7eb;
    --color-gray-300: #d1d5db;
    --color-gray-400: #9ca3af;
    --color-gray-500: #6b7280;
    --color-gray-600: #4b5563;
    --color-gray-700: #374151;
    --color-gray-800: #1f2937;
    --color-gray-900: #111827;

    /* Indigo */
    --color-indigo-50: #eef2ff;
    --color-indigo-100: #e0e7ff;
    --color-indigo-200: #c7d2fe;
    --color-indigo-300: #a5b4fc;
    --color-indigo-400: #818cf8;
    --color-indigo-500: #6366f1;
    --color-indigo-600: #4f46e5;
    --color-indigo-700: #4338ca;
    --color-indigo-800: #3730a3;
    --color-indigo-900: #312e81;

    /* Brand */
    --color-brand-50: #eef4fc;
    --color-brand-100: #d9e7f8;
    --color-brand-200: #b7d0f1;
    --color-brand-300: #8eb3e6;
    --color-brand-400: #6697db;
    --color-brand-500: #4a81d0;
    --color-brand-600: #336cc2;
    --color-brand-700: #2d5da8;
    --color-brand-800: #274f8e;
    --color-brand-900: #203f6f;
    --color-brand: var(--color-brand-600);

    /* Emerald */
    --color-emerald-50: #ecfdf5;
    --color-emerald-100: #d1fae5;
    --color-emerald-200: #a7f3d0;
    --color-emerald-300: #6ee7b7;
    --color-emerald-400: #34d399;
    --color-emerald-500: #10b981;
    --color-emerald-600: #059669;
    --color-emerald-700: #047857;
    --color-emerald-800: #065f46;
    --color-emerald-900: #064e3b;

    /* Green */
    --color-green-50: #f0fdf4;
    --color-green-100: #dcfce7;
    --color-green-200: #bbf7d0;
    --color-green-300: #86efac;
    --color-green-400: #4ade80;
    --color-green-500: #22c55e;
    --color-green-600: #16a34a;
    --color-green-700: #15803d;
    --color-green-800: #166534;
    --color-green-900: #14532d;

    /* Blue */
    --color-blue-50: #eff6ff;
    --color-blue-100: #dbeafe;
    --color-blue-200: #bfdbfe;
    --color-blue-300: #93c5fd;
    --color-blue-400: #60a5fa;
    --color-blue-500: #3b82f6;
    --color-blue-600: #2563eb;
    --color-blue-700: #1d4ed8;
    --color-blue-800: #1e40af;
    --color-blue-900: #1e3a8a;

    /* Red */
    --color-red-50: #fef2f2;
    --color-red-100: #fee2e2;
    --color-red-200: #fecaca;
    --color-red-300: #fca5a5;
    --color-red-400: #f87171;
    --color-red-500: #ef4444;
    --color-red-600: #dc2626;
    --color-red-700: #b91c1c;
    --color-red-800: #991b1b;
    --color-red-900: #7f1d1d;

    /* Amber */
    --color-amber-50: #fffbeb;
    --color-amber-100: #fef3c7;
    --color-amber-200: #fde68a;
    --color-amber-300: #fcd34d;
    --color-amber-400: #fbbf24;
    --color-amber-500: #f59e0b;
    --color-amber-600: #d97706;
    --color-amber-700: #b45309;
    --color-amber-800: #92400e;
    --color-amber-900: #78350f;

    /* Yellow */
    --color-yellow-50: #fefce8;
    --color-yellow-100: #fef9c3;
    --color-yellow-200: #fef08a;
    --color-yellow-300: #fde047;
    --color-yellow-400: #facc15;
    --color-yellow-500: #eab308;
    --color-yellow-600: #ca8a04;
    --color-yellow-700: #a16207;
    --color-yellow-800: #854d0e;
    --color-yellow-900: #713f12;

    /* Purple */
    --color-purple-50: #faf5ff;
    --color-purple-100: #f3e8ff;
    --color-purple-200: #e9d5ff;
    --color-purple-300: #d8b4fe;
    --color-purple-400: #c084fc;
    --color-purple-500: #a855f7;
    --color-purple-600: #9333ea;
    --color-purple-700: #7e22ce;
    --color-purple-800: #6b21a8;
    --color-purple-900: #581c87;

    --theme-primary-light: var(--color-brand-100);
    --theme-primary: var(--color-brand);
    --theme-primary-hover: var(--color-brand-700);
    --theme-primary-active: var(--color-brand-800);
}

/* Preflight / CSS Reset */
*,
::before,
::after {
    box-sizing: border-box;
    border-width: 0;
    border-style: solid;
    border-color: #e5e7eb;
    /* gray-200 default */
}

html {
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    -moz-tab-size: 4;
    tab-size: 4;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    font-feature-settings: normal;
}

body {
    margin: 0;
    line-height: inherit;
    min-height: 100vh;
    background-attachment: fixed;
    background-color: #ffffff;
    background-image:
        radial-gradient(at 0% 0%, rgba(102, 151, 219, 0.35) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(51, 108, 194, 0.22) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(191, 219, 254, 0.3) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(217, 231, 248, 0.45) 0px, transparent 50%),
        radial-gradient(at 50% 50%, rgba(255, 255, 255, 0) 0px, transparent 50%);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-size: inherit;
    font-weight: inherit;
    margin: 0;
}

p {
    margin: 0;
}

button,
input,
optgroup,
select,
textarea {
    font-family: inherit;
    font-size: 100%;
    line-height: inherit;
    color: inherit;
    margin: 0;
    padding: 0;
}

button,
select {
    text-transform: none;
}

img,
video {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Custom Utilities */
.glass {
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(64px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.glass-hover {
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.glass-hover:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

@keyframes ring-pulsate {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }

    70% {
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.animate-ring-pulsate {
    animation: ring-pulsate 2s infinite;
}

/* Top Bar */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    padding: 0 1.5rem;
    background-color: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 10;
    gap: 1rem;
}

.top-bar-left {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
}

.nav-home {
    color: var(--color-slate-400);
    display: flex;
    align-items: center;
    transition: color 0.2s;
    text-decoration: none;
    font-size: 0.9rem;
}

.nav-home:hover {
    color: var(--color-brand-600);
}

.nav-stack {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--color-slate-500);
    white-space: nowrap;
    overflow: hidden;
}

.nav-item {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.nav-item.active {
    color: var(--color-slate-900);
    font-weight: 500;
}

a.nav-item:hover {
    color: var(--color-brand-600);
}

.nav-separator {
    color: var(--color-slate-300);
}

.top-bar-center {
    flex: 0 1 auto;
    display: flex;
    justify-content: center;
    min-width: 0;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.top-bar-right {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    min-width: 0;
}

.search-section {
    flex: 0 1 200px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 150px;
}

.search-section.expanded {
    flex: 1 0 400px;
}

.search-container {
    display: flex;
    align-items: center;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.4rem 0.75rem;
    width: 100%;
    gap: 0.5rem;
    transition: all 0.2s ease;
    cursor: text;
}

.search-container:focus-within {
    border-color: var(--color-brand-500);
    background-color: #ffffff;
    box-shadow: 0 0 0 2px rgba(51, 108, 194, 0.1);
}

.search-icon {
    color: #9ca3af;
    font-size: 0.85rem;
}

.search-input {
    border: none !important;
    background: transparent !important;
    outline: none !important;
    flex: 1;
    font-size: 0.875rem;
    color: var(--color-gray-900);
    padding: 0 !important;
    height: 24px;
    width: 100%;
}

.search-input::placeholder {
    color: #9ca3af;
}

.shortcut-box {
    background-color: var(--color-gray-50);
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 1px 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
}

.shortcut-text {
    font-size: 0.65rem;
    font-weight: 600;
    color: #9ca3af;
    letter-spacing: 0.02em;
}

.system-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid #e5e7eb;
    background-color: #ffffff;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.action-btn:hover {
    background-color: #f9fafb;
    color: #111827;
    border-color: #d1d5db;
}

.action-btn i {
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
