/* Shared Layout Styles */

/* Base layout reset */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* Compact view - reduce font sizes */
html { font-size: 14px; }
body { 
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8fafc;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 0.875rem;
}

/* Top Bar */
.top-bar {
    background: linear-gradient(135deg, var(--accent-9) 0%, var(--accent-10) 100%);
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-8);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.logo-section {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.logo-section h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
}

/* Main Layout with Sidebar */
.main-layout {
    display: flex;
    margin-top: 64px;
    min-height: calc(100vh - 64px);
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: white;
    border-right: 1px solid var(--gray-6);
    position: fixed;
    height: calc(100vh - 64px);
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar-section {
    padding: var(--space-4) 0;
}

.sidebar-section-title {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--gray-11);
    padding: 0 var(--space-6);
    margin-bottom: var(--space-2);
    letter-spacing: 0.05em;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-6);
    color: var(--gray-11);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all var(--transition-base);
    cursor: pointer;
    position: relative;
}

.sidebar-item:hover {
    background: var(--gray-3);
    color: var(--gray-12);
}

.sidebar-item.active {
    background: var(--accent-3);
    color: var(--accent-11);
    font-weight: 500;
}

.sidebar-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent-9);
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: 260px;
    width: calc(100% - 260px);
    background: linear-gradient(180deg, var(--primary-1) 0%, var(--primary-2) 100%);
    min-height: calc(100vh - 64px);
    padding: var(--space-4);
}

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    padding: var(--space-2);
    cursor: pointer;
    color: white;
    transition: all var(--transition-base);
}

/* Token Modal */
.token-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    padding: var(--space-4);
    overflow-y: auto;
}

.token-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 600px;
    box-shadow: var(--shadow-2xl);
}

.modal-header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--gray-6);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-12);
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 2rem;
    line-height: 1;
    color: var(--gray-11);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: var(--space-6);
}

.token-box {
    display: flex;
    align-items: center;
    background: var(--gray-3);
    border: 1px solid var(--gray-6);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin: var(--space-4) 0;
    font-family: monospace;
    font-size: 0.875rem;
    word-break: break-all;
}

.copy-btn {
    background: var(--accent-9);
    color: white;
    border: none;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    margin-right: var(--space-4);
    flex-shrink: 0;
}

/* Button styles */
.btn {
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-base);
    border: none;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    text-decoration: none;
}

.btn-ghost {
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
}

/* Customer selector dropdown */
.customer-selector {
    position: relative;
}

#customerDropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: var(--space-2);
    background: white;
    border: 1px solid var(--primary-6);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 300px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
}