:root {
    --bg-app: #1C1917;
    /* Stone 900 */
    --bg-panel: rgba(41, 37, 36, 0.7);
    /* Stone 800 */
    --bg-darker: #0c0a09;
    /* Stone 950 */

    --border: rgba(120, 113, 108, 0.2);
    /* Stone 500 */
    --border-white-10: rgba(255, 255, 255, 0.1);
    --border-white-20: rgba(255, 255, 255, 0.2);

    --text-main: #FAFAF9;
    /* Stone 50 */
    --text-gray-300: #D6D3D1;
    /* Stone 300 */
    --text-muted: #A8A29E;
    /* Stone 400 */

    --primary: #EF4444;
    /* Red 500 */
    --primary-hover: #DC2626;
    /* Red 600 */
    --primary-30: rgba(239, 68, 68, 0.3);

    --secondary: #F87171;
    /* Red 400 */
    --accent: #FECACA;
    /* Red 200 */

    --font-sans: 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-app);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-1 {
    flex: 1;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}

.full-width {
    width: 100%;
}

.m-0 {
    margin: 0;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.p-3 {
    padding: 0.75rem;
}

.p-4 {
    padding: 1rem;
}

.p-5 {
    padding: 1.25rem;
}

.p-6 {
    padding: 1.5rem;
}

.pt-5 {
    padding-top: 1.25rem;
}

.py-1\.5 {
    padding-top: 0.375rem;
    padding-bottom: 0.375rem;
}

.space-y-6> :not([hidden])~ :not([hidden]) {
    margin-top: 1.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.text-xs {
    font-size: 0.75rem;
}

.text-sm {
    font-size: 0.875rem;
}

.text-md {
    font-size: 1rem;
}

.text-\[10px\] {
    font-size: 10px;
}

.text-main {
    color: var(--text-main);
}

.text-muted {
    color: var(--text-muted);
}

.text-gray-300 {
    color: var(--text-gray-300);
}

.text-white {
    color: #fff;
}

.text-accent {
    color: var(--accent);
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.font-mono {
    font-family: var(--font-mono);
}

.uppercase {
    text-transform: uppercase;
}

.tracking-wider {
    letter-spacing: 0.05em;
}

.text-center {
    text-align: center;
}

.leading-tight {
    line-height: 1.25;
}

.bg-dark {
    background: var(--bg-app);
}

.bg-darker {
    background: var(--bg-darker);
}

.bg-panel {
    background: var(--bg-panel);
}

.bg-black {
    background: #000;
}

.border-b {
    border-bottom: 1px solid var(--border);
}

.border-r {
    border-right: 1px solid var(--border);
}

.border-t {
    border-top: 1px solid var(--border);
}

.border {
    border: 1px solid var(--border);
}

.border-white-10 {
    border-color: var(--border-white-10);
}

.border-white-20 {
    border-color: var(--border-white-20);
}

.rounded {
    border-radius: 4px;
}

.rounded-lg {
    border-radius: var(--radius-lg);
}

.opacity-0 {
    opacity: 0;
}

.opacity-50 {
    opacity: 0.5;
}

.group:hover .group-hover\:opacity-100 {
    opacity: 1;
}

.group:hover .group-hover\:text-white {
    color: white;
}

.transition-opacity {
    transition: opacity 0.2s;
}

.transition-colors {
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.transition-all {
    transition: all 0.2s;
}

.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

.inset-0 {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

.top-6 {
    top: 1.5rem;
}

.right-6 {
    right: 1.5rem;
}

.cursor-pointer {
    cursor: pointer;
}

.pointer-events-none {
    pointer-events: none;
}

.whitespace-pre {
    white-space: pre;
}

.overflow-hidden {
    overflow: hidden;
}

.overflow-auto {
    overflow: auto;
}

.overflow-x-auto {
    overflow-x: auto;
}

.scroll-y {
    overflow-y: auto;
}

.resize-none {
    resize: none;
}

.z-10 {
    z-index: 10;
}

.shadow-inner {
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.5);
}

/* Custom Structure */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.grid-layout {
    display: grid;
    grid-template-columns: 1fr 300px 1.5fr;
    min-height: 0;
}

@media (max-width: 1024px) {
    .grid-layout {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr 1fr;
    }

    .grid-layout> :first-child {
        grid-column: span 2;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
}

@media (max-width: 640px) {
    .grid-layout {
        display: flex;
        flex-direction: column;
    }

    .grid-layout>aside {
        min-height: 350px;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
}

.glass {
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.bg-glass {
    background: rgba(28, 25, 23, 0.8);
    backdrop-filter: blur(8px);
}

.bg-dark\/80 {
    background-color: rgba(28, 25, 23, 0.8);
}

.icon-brand {
    background: var(--primary);
    color: white;
    display: flex;
    padding: 0.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.badge {
    display: inline-flex;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    font-family: var(--font-mono);
}

/* Forms */
.label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.inp {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.75rem;
    border-radius: var(--radius);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.inp:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-30);
}

select.inp {
    appearance: none;
    background-color: var(--bg-darker);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A8A29E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px;
    padding-right: 2.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-sans);
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border-radius: var(--radius);
    padding: 0.6rem 1rem;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-hover);
}

.btn.primary {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.btn.primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--primary-30);
}

.btn.icon-only {
    padding: 0.5rem;
}

/* Toggle Group */
.toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.toggle-btn:hover {
    color: var(--text-main);
}

.toggle-btn.active {
    background: var(--primary-30);
    color: var(--primary);
}

/* Slider */
.slider {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    margin: 10px 0;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    transition: transform 0.1s;
    border: 2px solid var(--bg-darker);
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--bg-darker);
    cursor: pointer;
}

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}