@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@500;600;700;800&display=swap');

:root {
    /* Wasai Warm Terracotta Palette - Inspired by Linear & Claude */
    --bg-dark: #fbfaf8; /* Warm Off-white */
    --bg-card: #ffffff;
    --primary: #d97757; /* Terracotta Accent */
    --primary-hover: #c46445;
    --primary-glow: rgba(217, 119, 87, 0.12);
    --secondary: #6b6b6b;
    --accent: #543b34;
    --text-main: #1d1816; /* Deep Charcoal/Brown */
    --text-muted: #666666;
    --border-glass: rgba(0, 0, 0, 0.06);
    --border-peach: #f4dbcc;
    --border: var(--border-peach);
    --text: var(--text-main);
    --text-secondary: var(--text-muted);
    
    /* Semantic Colors */
    --success: #2d7a5f;
    --success-light: #ecfdf5;
    --warning: #b45309;
    --warning-light: #fffbeb;
    --error: #b91c1c;
    --error-light: #fef2f2;
    
    /* Layout Tokens */
    --sidebar-width: 250px;
    --header-height: 60px;
    --radius-lg: 14px;
    --radius-md: 9px;
    --radius-sm: 6px;
    --shadow-premium: 0 4px 14px -2px rgba(0, 0, 0, 0.05), 0 2px 6px -1px rgba(0, 0, 0, 0.02);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

h1, h2, h3, h4, h5, h6, .logo {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    letter-spacing: -0.015em;
}

body {
    background: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Custom Sleek Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(217, 119, 87, 0.22);
    border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(217, 119, 87, 0.45);
}

/* Base Layout Container */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: #fbfaf8;
}

/* Cards & Containers */
.glass {
    background: var(--bg-card);
    border: 1px solid var(--border-peach);
    box-shadow: var(--shadow-premium);
}

.text-gradient {
    color: var(--primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    line-height: 1.2;
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: 1px solid transparent;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(217, 119, 87, 0.25);
}

.btn-sm {
    padding: 0.32rem 0.7rem;
    font-size: 0.78rem;
    border-radius: var(--radius-sm);
}

.btn-secondary {
    background: #fdfcfb;
    color: var(--text-main);
    border: 1.5px solid var(--border-peach);
}

.btn-secondary:hover:not(:disabled) {
    background: #fbfaf8;
    border-color: var(--primary);
}

.btn-outline {
    background: #ffffff;
    border: 1.5px solid var(--border-peach);
    color: var(--text-main);
}

.btn-outline:hover:not(:disabled) {
    background: #fbf7f4;
    border-color: var(--primary);
    color: var(--primary);
}

/* Form Controls */
.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.4rem;
}

.form-control {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1.5px solid var(--border-peach);
    border-radius: var(--radius-md);
    background: #ffffff;
    color: var(--text-main);
    font-size: 0.9rem;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: #ffffff;
}

.form-control:disabled, .form-control[readonly] {
    background: #f7f5f2;
    color: var(--text-muted);
    cursor: not-allowed;
}

.help-text {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
    line-height: 1.4;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.animate-fade {
    animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Layout Specifics */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 1.5rem;
    padding-top: calc(var(--header-height) + 1.25rem);
    transition: margin-left 0.3s ease;
    max-width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.main-content.no-header { padding-top: 1.5rem; }
.main-content.no-header #page-content { margin-top: 0; }

#page-content {
    flex: 1;
    min-height: 0;
    margin-top: 0.75rem;
    overflow-y: auto;
    padding-right: 0.35rem;
}

@media (max-width: 1024px) {
    .main-content {
        margin-left: 0;
        padding: 1rem;
        padding-top: calc(var(--header-height) + 1rem);
    }
}

/* Status Badges & Pills */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
}

.status-pill-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.status-completed, .status-active {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.status-rejected, .status-failed, .status-cancelled {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.status-pending, .status-running, .status-scheduled {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    animation: toast-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.toast-info {
    background: #ffffff;
    color: var(--text-main);
    border-left: 4px solid var(--primary);
}

.toast-success {
    background: #ffffff;
    color: #065f46;
    border-left: 4px solid #10b981;
}

.toast-error {
    background: #ffffff;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.toast-warning {
    background: #ffffff;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
