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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    line-height: 1.6;
    background: #f5f5f5;
    overflow-x: hidden;
    max-width: 100vw;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logout-button {
    background: #dc2626;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.3s;
}

.logout-button:hover {
    background: #b91c1c;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-number {
    font-size: 2em;
    font-weight: bold;
    color: #2563eb;
    margin-top: 10px;
}

.stat-card h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #111827;
}

.stat-subtext {
    margin-top: 8px;
    font-size: 0.875rem;
    color: #6b7280;
}

.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: 0;
}

.dashboard-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.dashboard-loading,
.dashboard-error {
    padding: 16px;
    border-radius: 8px;
    font-size: 0.95rem;
}

.dashboard-loading {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.dashboard-error {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.dashboard-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.dashboard-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dashboard-card-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.dashboard-card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #111827;
}

.card-meta {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
    font-weight: 600;
}

.dashboard-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
    padding: 0;
}

.dashboard-list li {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    border-radius: 8px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

.dashboard-list li .item-title {
    font-weight: 600;
    color: #111827;
}

.dashboard-list li .item-meta {
    font-size: 0.8rem;
    color: #6b7280;
}

.dashboard-list li .item-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #1d4ed8;
}

.dashboard-list .empty-state {
    background: #fff;
    border-style: dashed;
    color: #6b7280;
    text-align: center;
    font-style: italic;
}

/* Bookmarks Section */
#bookmarks-section {
    margin-top: 32px;
}

#bookmarks-section .section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: #1f2937;
}

#bookmarks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.bookmark-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    color: inherit;
    text-decoration: none;
    transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
    cursor: pointer;
}

.bookmark-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-color: #6366f1;
}

.bookmark-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bookmark-icon {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
}

.bookmark-title {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.95rem;
}

.bookmark-desc {
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.4;
}

.bookmarks-empty {
    padding: 32px;
    text-align: center;
    color: #9ca3af;
    font-style: italic;
    grid-column: 1 / -1;
}

.bookmarks-error {
    padding: 16px;
    text-align: center;
    color: #dc2626;
    background: #fee2e2;
    border-radius: 8px;
    grid-column: 1 / -1;
}

@media (max-width: 768px) {
    #bookmarks-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-columns {
        grid-template-columns: 1fr;
    }

    .dashboard-stats {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 16px;
    }

    .stat-card {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .stat-number {
        font-size: 1.75em;
    }

    .bookmark-card {
        padding: 14px;
    }

    .dashboard-card {
        padding: 16px;
    }
}
