:root {
    --bg-app: #000000;
    --bg-sidebar: #000000;
    --bg-card: #0A0A0A;
    --bg-input: #050505;

    --border-base: #27272a; /* zinc-800 */
    --border-subtle: rgba(255,255,255,0.08);

    --text-primary: #ffffff;
    --text-secondary: #a1a1aa; /* zinc-400 */

    --fc-page-bg-color: transparent;
    --fc-neutral-bg-color: #0A0A0A;
    --fc-neutral-text-color: #a1a1aa;
    --fc-border-color: #27272a;

    --fc-button-text-color: #fff;
    --fc-button-bg-color: transparent;
    --fc-button-border-color: #27272a;
    --fc-button-hover-bg-color: #27272a;
    --fc-button-hover-border-color: #3f3f46;
    --fc-button-active-bg-color: #27272a;
    --fc-button-active-border-color: #fff;

    --fc-event-bg-color: #27272a;
    --fc-event-border-color: #3f3f46;
    --fc-today-bg-color: rgba(255,255,255,0.03);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-app);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography Utility */
h1, h2, h3, h4, h5, h6 {
    letter-spacing: -0.025em; /* tight */
    font-weight: 600;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #27272a; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3f3f46; }

/* Custom Scrollbar utility class */
.custom-scrollbar::-webkit-scrollbar { width: 4px; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: #3f3f46; border-radius: 2px; }

/* Animation Utilities */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-in {
    animation: fadeIn 0.4s ease-out forwards;
}

@keyframes zoomIn95 {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
.zoom-in-95 {
    animation: zoomIn95 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Transitions */
#sidebar { transition: width 0.2s cubic-bezier(0.16, 1, 0.3, 1); }
main { transition: margin-left 0.2s cubic-bezier(0.16, 1, 0.3, 1); }

/* Sidebar Collapsed State */
.sidebar-collapsed .logo-text,
.sidebar-collapsed #plan-badge,
.sidebar-collapsed .nav-label, 
.sidebar-collapsed .section-header,
.sidebar-collapsed .user-info,
.sidebar-collapsed .toggle-btn { 
    display: none !important; 
    opacity: 0; 
    width: 0;
    pointer-events: none;
}
.sidebar-collapsed .logo-container > div { width: auto !important; }
.sidebar-collapsed .nav-item {
    justify-content: center !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: 40px;
    margin: 0 auto 4px auto;
}
.sidebar-collapsed .nav-item .relative.shrink-0 { margin: 0 !important; }
.sidebar-collapsed .logo-container {
    justify-content: center !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}
.sidebar-collapsed .nav-item:hover::after { display: none; }

/* --- COMPONENT CLASSES (LINEAR STYLE) --- */
/* Updated for Studio V2 */

.l-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-base);
    border-radius: 0.75rem; /* rounded-xl */
    overflow: hidden;
}

.l-card-hover {
    transition: all 0.2s ease;
}
.l-card-hover:hover {
    border-color: #3f3f46; /* zinc-700 */
    background-color: #101012;
}

.l-btn-primary {
    background-color: #ffffff;
    color: #000000;
    font-weight: 500;
    font-size: 0.875rem; /* text-sm */
    padding: 0.5rem 1rem;
    border-radius: 0.375rem; /* rounded-md */
    border: 1px solid transparent;
    transition: all 0.15s ease;
}
.l-btn-primary:hover {
    background-color: #e4e4e7; /* zinc-200 */
    box-shadow: 0 0 0 1px rgba(255,255,255,0.1);
}

.l-btn-secondary {
    background-color: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-base);
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.15s ease;
}
.l-btn-secondary:hover {
    color: #ffffff;
    border-color: #52525b; /* zinc-600 */
    background-color: rgba(255,255,255,0.02);
}

.l-btn-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.15s ease;
}
.l-btn-danger:hover {
    background-color: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
}

.l-btn-icon {
    padding: 0.375rem;
    color: var(--text-secondary);
    border-radius: 0.375rem;
    transition: all 0.15s ease;
}
.l-btn-icon:hover {
    color: #ffffff;
    background-color: rgba(255,255,255,0.05);
}

.l-input {
    background-color: var(--bg-input);
    border: 1px solid var(--border-base);
    color: white;
    font-size: 0.875rem;
    border-radius: 0.375rem; /* rounded-md */
    padding: 0.5rem 0.75rem;
    width: 100%;
    outline: none;
    transition: border-color 0.15s, background-color 0.15s;
}
.l-input:focus {
    border-color: #52525b; /* zinc-600 */
    background-color: #000000;
}
.l-input::placeholder {
    color: #52525b; /* zinc-600 */
}

/* Badge Utility */
.l-badge {
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    border: 1px solid transparent;
}

/* Modals */
.l-modal-content {
    background-color: #09090b; /* Slightly darker than card */
    border: 1px solid var(--border-base);
    border-radius: 0.75rem; /* rounded-xl */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Sidebar Active State */
.nav-item.active {
    background-color: #111;
    color: white;
    font-weight: 500;
    border: 1px solid transparent;
}
.nav-item.active i { color: currentColor; }

/* Premium Table - Linear Style */
.premium-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
}
.premium-table th {
    text-align: left;
    font-size: 0.75rem;
    font-weight: 500;
    color: #a1a1aa; /* zinc-400 */
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-base);
    background-color: rgba(255,255,255,0.02);
}
.premium-table td {
    padding: 0.75rem 1rem;
    color: #d4d4d8; /* zinc-300 */
    border-bottom: 1px solid rgba(255,255,255,0.03);
    transition: color 0.15s;
}
.premium-table tr:hover td {
    background-color: rgba(255,255,255,0.02);
    color: #ffffff;
}
.premium-table tr:last-child td {
    border-bottom: none;
}
.premium-table .cell-mono {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: #71717a; /* zinc-500 */
}

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

.l-toast {
    background-color: #09090b;
    border: 1px solid var(--border-base);
    color: #ffffff;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.l-toast.hidden {
    animation: toastSlideOut 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateY(100%); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes toastSlideOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(20%); }
}

/* --- FULLCALENDAR OVERRIDES --- */
.fc-theme-standard td, .fc-theme-standard th {
    border-color: var(--fc-border-color) !important;
}
.fc .fc-toolbar-title {
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    color: white;
}
.fc .fc-col-header-cell-cushion {
    color: var(--fc-neutral-text-color);
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    font-weight: 600;
}
.fc .fc-daygrid-day-number {
    color: #d4d4d8;
    font-size: 0.8rem;
    padding: 8px;
}
.fc-popover {
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-base) !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}
.fc-popover-header {
    background-color: var(--bg-app) !important;
    border-bottom: 1px solid var(--border-base) !important;
}

/* Mini Calendar */
#mini-calendar .fc-toolbar-title {
    font-size: 0.8rem !important;
    font-weight: 600;
    padding-left: 4px;
}
#mini-calendar .fc-button {
    width: 24px !important;
    height: 24px !important;
}
#mini-calendar .fc-daygrid-day-number {
    font-size: 0.75rem !important;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    border-radius: 6px; /* slightly squared */
}
#mini-calendar .fc-day-today .fc-daygrid-day-number {
    background-color: #ffffff !important;
    color: #000000 !important;
    font-weight: 700;
}

/* --- UTILITY ADDITIONS FOR DASHBOARD V2 --- */

.l-card-gradient {
    position: relative;
    overflow: hidden;
}
.l-card-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    opacity: 0.5;
}

.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: #27272a transparent;
}
.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background-color: #27272a;
    border-radius: 4px;
}

/* Glass effect for overlays */
.l-glass {
    background: rgba(10, 10, 10, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Text Gradient */
.text-gradient-primary {
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-image: linear-gradient(to bottom right, #ffffff, #a1a1aa);
}

/* --- TOAST NOTIFICATIONS --- */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background-color: #09090b;
    border: 1px solid var(--border-base);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    min-width: 300px;
}

.toast.error {
    border-color: rgba(239, 68, 68, 0.3);
}

.toast.success {
    border-color: rgba(16, 185, 129, 0.3);
}

.toast-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}
.toast.success .toast-icon { color: #10b981; }
.toast.error .toast-icon { color: #ef4444; }

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* --- MOBILE SPECIFIC FIXES --- */
@media screen and (max-width: 768px) {
    /* Prevent iOS Zoom on Inputs */
    .l-input, select, textarea {
        font-size: 16px !important;
    }

    /* Ensure tables scroll horizontally on mobile */
    .premium-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
    }

    /* Adjust buttons for easier tapping */
    .l-btn-primary, .l-btn-secondary {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* PWA Prompt Safe Area */
    #pwa-install-prompt {
        padding-bottom: env(safe-area-inset-bottom);
        margin-bottom: env(safe-area-inset-bottom);
    }
}
