/* TableBeep - Dashboard Styles */

:root {
    --primary-color: #6a1dba;
    --primary-hover: #5518a0;
    --bg-color: #ffffff;
    --sidebar-bg: #1a1a2e;
    --sidebar-text: #e0e0e0;
    --text-color: #333333;
    --border-color: #e0e0e0;
    --card-radius: 20px;
    --card-padding: 18px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f6fbff;
    color: var(--text-color);
}

.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    color: var(--primary-color);
    font-size: 24px;
    font-weight: 700;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.3s ease;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-item.active {
    background: var(--primary-color);
    color: white;
    border-left: 4px solid white;
}

.nav-item svg {
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
}

.top-bar {
    background: transparent;
    padding: 16px 32px;
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all 0.3s ease;
}

.top-bar.scrolled {
    background: rgba(246, 251, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.user-name {
    font-weight: 600;
    color: var(--text-color);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-content {
    padding: 32px;
    flex: 1;
}

.page-header {
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 8px;
}

.page-header p {
    color: #666;
    font-size: 16px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    padding: var(--card-padding);
    border-radius: var(--card-radius);
    display: flex;
    gap: 16px;
    align-items: center;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    color: #666;
}

/* Quick Actions */
.quick-actions {
    margin-bottom: 32px;
}

.quick-actions h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.action-card {
    background: white;
    padding: var(--card-padding);
    border-radius: var(--card-radius);
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.action-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.action-card-primary {
    background: linear-gradient(135deg, var(--primary-color), #ff1744);
    color: white;
}

.action-card-primary:hover {
    border-color: white;
}

.action-icon {
    width: 56px;
    height: 56px;
    background: #f5f5f5;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: var(--primary-color);
}

.action-card-primary .action-icon {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.action-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.action-card p {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.action-card-primary p {
    color: rgba(255, 255, 255, 0.9);
}

/* QR Code Section */
.qr-code-section {
    margin-bottom: 32px;
}

.qr-code-section h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
}

.qr-card {
    background: white;
    padding: var(--card-padding);
    border-radius: var(--card-radius);
    display: flex;
    gap: 32px;
    align-items: center;
}

.qr-image {
    flex-shrink: 0;
}

.qr-image img {
    width: 200px;
    height: 200px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
}

.qr-info {
    flex: 1;
}

.qr-info h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.qr-url {
    color: var(--primary-color);
    font-size: 14px;
    margin-bottom: 16px;
    word-break: break-all;
}

.qr-description {
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--card-radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-ai-import {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 18px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-ai-import:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-ai-import::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn-ai-import:hover::before {
    left: 100%;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: var(--card-radius);
    margin-bottom: 24px;
    font-size: 15px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--card-radius);
    font-size: 15px;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(106, 29, 186, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Tables */
.table-container {
    background: white;
    border-radius: var(--card-radius);
    overflow: hidden;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
    color: var(--text-color);
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover {
    background: #f8f9fa;
}

.table-actions {
    display: flex;
    gap: 8px;
}

/* Cards */
.card {
    background: white;
    border-radius: var(--card-radius);
    padding: var(--card-padding);
    margin-bottom: 24px;
}

.card-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.card-header h2 {
    font-size: 20px;
    font-weight: 700;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .dashboard-content {
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .action-grid {
        grid-template-columns: 1fr;
    }
    
    .qr-card {
        flex-direction: column;
        text-align: center;
    }
    
    .page-header h1 {
        font-size: 24px;
    }

    /* Responsive tables */
    .table-container { overflow: hidden; }
    .table { display: block; width: 100%; }
    .table thead { display: none; }
    .table tbody { display: block; }
    .table tr { 
        display: block; 
        margin: 12px 0; 
        background: #fff; 
        border: 1px solid var(--border-color); 
        border-radius: var(--card-radius);
        overflow: hidden;
    }
    .table td { 
        display: flex; 
        justify-content: space-between; 
        align-items: center; 
        gap: 12px; 
        padding: 12px 16px; 
        border-bottom: 1px solid var(--border-color);
    }
    .table tr > td:last-child { border-bottom: none; }
    .table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: #666;
        flex: 0 0 42%;
        max-width: 180px;
    }
    .table-actions { flex-wrap: wrap; }
    .table img { width: 40px; height: 40px; }
    .table td.no-label::before { content: none; }
    .table .no-label .table-actions { flex-wrap: nowrap; overflow-x: auto; gap: 6px; }
    .table td.no-label { justify-content: flex-start; }
}

@media (max-width: 480px) {
    .top-bar {
        padding: 12px 16px;
    }
    
    .dashboard-content {
        padding: 16px;
    }

    /* Tighter spacing on very small screens */
    .table td { padding: 10px 12px; }
    .table td::before { flex-basis: 48%; }
}
