/* ============================================
   CSS Variables
   ============================================ */

:root {
    --bg-primary: #030712;
    --bg-secondary: #0a0f1a;
    --bg-card: #0c1220;
    --bg-card-hover: #111a2d;
    --bg-input: #080d17;
    --bg-glass: rgba(10, 15, 26, 0.7);

    --border-color: rgba(16, 185, 129, 0.1);
    --border-hover: rgba(16, 185, 129, 0.3);

    --text-primary: #f0fdf4;
    --text-secondary: #86efac;
    --text-muted: #4a7c6a;
    --text-dim: #2d5a47;

    --accent: #10b981;
    --accent-light: #34d399;
    --accent-dark: #059669;
    --accent-glow: rgba(16, 185, 129, 0.15);
    --accent-glow-strong: rgba(16, 185, 129, 0.3);

    --gradient-primary: linear-gradient(135deg, #059669 0%, #10b981 50%, #34d399 100%);
    --gradient-hero: radial-gradient(ellipse at 50% 0%, rgba(16, 185, 129, 0.15) 0%, transparent 70%);

    --success: #22c55e;
    --error: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(16, 185, 129, 0.15);
    --shadow-glow-strong: 0 0 60px rgba(16, 185, 129, 0.25);

    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   Reset & Base
   ============================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 600px;
    background: var(--gradient-hero);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

a { color: var(--accent-light); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }

/* ============================================
   Header
   ============================================ */

.header {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-link {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--accent-glow);
}

.user-email {
    font-size: 14px;
    color: var(--text-muted);
}

.logout-btn {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition);
}

.logout-btn:hover {
    border-color: var(--error);
    color: var(--error);
}

/* ============================================
   Hero
   ============================================ */

.hero {
    padding: 80px 0 60px;
    text-align: center;
}

.hero-title {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -1.5px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* ============================================
   Search
   ============================================ */

.search-section { padding: 40px 0; }

.search-input {
    width: 100%;
    padding: 16px 24px;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 16px;
    transition: all var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
}

.search-input::placeholder { color: var(--text-dim); }

/* ============================================
   Tags
   ============================================ */

.tags-section { padding-bottom: 30px; }

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.tag-chip {
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.tag-chip:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.tag-chip.active {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--accent-light);
    box-shadow: var(--shadow-glow);
}

.tag-count {
    margin-left: 6px;
    font-size: 12px;
    opacity: 0.6;
}

/* ============================================
   Cards
   ============================================ */

.cards-section { padding: 30px 0 80px; }

.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 24px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 28px;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition);
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    background: var(--bg-card-hover);
}

.card:hover::before { opacity: 1; }

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
    gap: 12px;
}

.card-category {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.card-category-muted {
    padding: 0;
    background: transparent;
    color: #94a3b8;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
    font-size: 12px;
}

.card-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.3;
}

.card-summary {
    font-size: 15px;
    color: #dbe7e0;
    margin-bottom: 18px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 7;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-summary-public {
    -webkit-line-clamp: 8;
}

.card-url {
    display: block;
    font-size: 14px;
    color: var(--accent-light);
    margin-bottom: 18px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 10px 14px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.card-tags-compact {
    gap: 6px;
}

.tag {
    font-size: 13px;
    padding: 5px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    color: var(--text-secondary);
    transition: all var(--transition);
}

.tag-muted {
    padding: 4px 10px;
    background: rgba(148, 163, 184, 0.08);
    border-color: rgba(148, 163, 184, 0.18);
    color: #94a3b8;
    font-size: 12px;
}

.card-date {
    font-size: 13px;
    color: #8fa0a4;
    font-weight: 400;
}

.card-body-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.card-body-link:hover { color: inherit; }

/* ============================================
   Card Actions (dashboard)
   ============================================ */

.card-actions {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.card-actions-muted {
    color: #94a3b8;
}

.card-actions-muted .btn-inline,
.card-actions-muted .toggle-public {
    color: #94a3b8;
}

.card-actions-muted .btn-inline {
    border-color: rgba(148, 163, 184, 0.18);
}

.card-actions-muted .btn-inline:hover {
    border-color: rgba(148, 163, 184, 0.3);
    color: #e2e8f0;
    background: rgba(148, 163, 184, 0.08);
}

.card-actions-compact {
    justify-content: flex-start;
}

.card-action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-inline,
.btn-secondary {
    padding: 10px 14px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-inline:hover,
.btn-secondary:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
    background: rgba(16, 185, 129, 0.08);
}

.sidebar-btn,
.dashboard-reset-btn,
.export-btn,
.view-toggle-btn {
    border-color: rgba(148, 163, 184, 0.18);
    color: #94a3b8;
}

.sidebar-btn {
    width: 100%;
}

.sidebar-btn:hover,
.dashboard-reset-btn:hover,
.export-btn:hover,
.view-toggle-btn:hover {
    border-color: rgba(148, 163, 184, 0.3);
    color: #e2e8f0;
    background: rgba(148, 163, 184, 0.08);
}

.btn-inline-danger:hover {
    border-color: rgba(239, 68, 68, 0.4);
    color: var(--error);
    background: rgba(239, 68, 68, 0.08);
}

.task-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
}

.task-chip-queued {
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning);
}

.task-chip-processing {
    background: rgba(59, 130, 246, 0.12);
    color: var(--info);
}

.task-chip-error {
    background: rgba(239, 68, 68, 0.12);
    color: var(--error);
}

.queue-card {
    border-style: dashed;
}

.task-card-actions {
    align-items: center;
}

.moderation-card {
    border-color: rgba(239, 68, 68, 0.25);
}

.moderation-badge {
    background: rgba(239, 68, 68, 0.16);
    color: var(--error);
}

.task-source-preview {
    margin-top: -4px;
    margin-bottom: 16px;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.toggle-public {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
}

.toggle-public input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 44px;
    height: 24px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: all var(--transition);
}

.toggle-public input[type="checkbox"]::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all var(--transition);
}

.toggle-public input[type="checkbox"]:checked {
    background: rgba(148, 163, 184, 0.14);
    border-color: rgba(148, 163, 184, 0.28);
}

.toggle-public input[type="checkbox"]:checked::after {
    left: 22px;
    background: #cbd5e1;
}

.toggle-label {
    user-select: none;
}

/* ============================================
   Load More
   ============================================ */

.load-more-container { text-align: center; margin-top: 40px; }

.cards-list-container {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.cards-day-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cards-day-heading {
    color: #94a3b8;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.cards-day-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.list-card-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: var(--radius-lg);
    background: rgba(8, 13, 23, 0.6);
}

.list-card-main {
    min-width: 0;
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) minmax(120px, 220px);
    gap: 14px;
    align-items: center;
    color: inherit;
    flex: 1;
}

.list-card-main:hover {
    color: inherit;
}

.list-card-time {
    color: #8fa0a4;
    font-size: 13px;
    white-space: nowrap;
}

.list-card-title {
    color: #e5efe9;
    font-size: 14px;
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.list-card-category {
    color: #94a3b8;
    font-size: 12px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.list-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.load-more-btn {
    padding: 14px 36px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.load-more-btn:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* ============================================
   Auth Gate
   ============================================ */

.auth-gate {
    padding: 80px 0;
    display: flex;
    justify-content: center;
}

.auth-card {
    max-width: 440px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.auth-form-section h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 28px;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 15px;
    transition: all var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
}

.form-group-checkbox {
    margin-bottom: 16px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.checkbox-label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    min-width: 20px;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition);
    margin-top: 2px;
    position: relative;
}

.checkbox-label input[type="checkbox"]:checked {
    background: var(--accent);
    border-color: var(--accent);
}

.checkbox-label input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-label a {
    color: var(--accent-light);
    text-decoration: underline;
}

.legal-links {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-muted);
}

.legal-links a {
    color: var(--text-muted);
    text-decoration: underline;
    transition: color var(--transition);
}

.legal-links a:hover {
    color: var(--text-secondary);
}

.legal-links .separator {
    margin: 0 8px;
}

.btn-primary {
    width: 100%;
    padding: 16px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    box-shadow: var(--shadow-glow-strong);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-muted);
}

.auth-switch a {
    color: var(--accent-light);
    font-weight: 500;
}

.auth-error {
    margin-top: 16px;
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    color: var(--error);
    font-size: 14px;
    text-align: center;
}

/* ============================================
   Dashboard
   ============================================ */

.dashboard { padding: 40px 0 80px; }

.add-note-section {
    margin: 0 0 48px;
}

.add-note-section h2,
.my-cards-section h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 24px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.section-heading h2 {
    margin-bottom: 0;
}

.section-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.view-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.view-toggle-btn.active {
    border-color: rgba(148, 163, 184, 0.32);
    background: rgba(148, 163, 184, 0.08);
    color: #e2e8f0;
}

.export-btn {
    white-space: nowrap;
}

.note-warning {
    margin-bottom: 18px;
    padding: 16px 18px;
    border-radius: var(--radius-lg);
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.22);
    color: #fcd34d;
    font-size: 14px;
    line-height: 1.6;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

.dashboard-sidebar {
    position: sticky;
    top: 100px;
}

.sidebar-card,
.dashboard-controls {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
}

.sidebar-card {
    padding: 22px;
}

.sidebar-actions {
    margin-bottom: 16px;
}

.sidebar-title {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.category-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(52, 211, 153, 0.85) rgba(15, 23, 42, 0.72);
    overscroll-behavior: contain;
}

.category-menu::-webkit-scrollbar {
    width: 10px;
}

.category-menu::-webkit-scrollbar-track {
    background: linear-gradient(180deg, rgba(8, 13, 23, 0.92) 0%, rgba(15, 23, 42, 0.72) 100%);
    border-radius: 999px;
}

.category-menu::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.95) 0%, rgba(52, 211, 153, 0.82) 100%);
    border: 2px solid rgba(8, 13, 23, 0.9);
    border-radius: 999px;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}

.category-menu::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(52, 211, 153, 1) 0%, rgba(110, 231, 183, 0.9) 100%);
}

.category-separator {
    height: 1px;
    margin: 8px 0;
    background: rgba(148, 163, 184, 0.12);
}

.category-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 6px;
}

.category-group-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 4px;
    color: #94a3b8;
    font-size: 12px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.category-group-children {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-link {
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid transparent;
    background: rgba(8, 13, 23, 0.72);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    text-align: left;
}

.category-link-all {
    margin-bottom: 4px;
}

.category-link-parent {
    font-weight: 600;
}

.category-link-parent .category-dot {
    background: var(--accent);
}

.category-link-sub {
    color: #94a3b8;
    padding-left: 18px;
}

.category-link-sub .category-dot {
    width: 6px;
    height: 6px;
    background: rgba(148, 163, 184, 0.72);
}

.category-link-static {
    color: #cbd5e1;
}

.category-link-static .category-dot {
    background: #94a3b8;
}

.category-link:hover,
.category-link.active {
    border-color: var(--border-hover);
    color: var(--text-primary);
    transform: translateX(3px);
}

.category-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #64748b;
}

.category-name {
    flex: 1;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.35;
}

.category-count {
    color: var(--text-muted);
    font-size: 13px;
    flex-shrink: 0;
    padding-top: 1px;
}

.dashboard-main {
    min-width: 0;
}

.dashboard-controls {
    padding: 22px;
    margin-bottom: 24px;
}

.dashboard-controls-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.dashboard-search-wrap {
    flex: 1;
}

.dashboard-reset-btn {
    width: auto;
    flex-shrink: 0;
}

.dashboard-tags {
    justify-content: flex-start;
}

.dashboard-tags .tag-chip {
    padding: 6px 10px;
    border-color: rgba(148, 163, 184, 0.16);
    background: rgba(148, 163, 184, 0.06);
    color: #94a3b8;
    font-size: 12px;
}

.dashboard-tags .tag-chip:hover {
    border-color: rgba(148, 163, 184, 0.28);
    color: #e2e8f0;
    background: rgba(148, 163, 184, 0.08);
}

.dashboard-tags .tag-chip.active {
    border-color: rgba(148, 163, 184, 0.32);
    background: rgba(148, 163, 184, 0.12);
    color: #e2e8f0;
    box-shadow: none;
}

.dashboard-tags .tag-count {
    color: #7c8d92;
    font-size: 11px;
}

.note-textarea {
    width: 100%;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 24px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 16px;
    line-height: 1.6;
    resize: vertical;
    min-height: 140px;
    transition: all var(--transition);
}

.note-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
}

.note-textarea::placeholder { color: var(--text-dim); }

.note-textarea-readonly {
    opacity: 0.9;
    background: rgba(148, 163, 184, 0.06);
    border-color: rgba(148, 163, 184, 0.14);
    color: #d9e5df;
}

.note-textarea-readonly:focus {
    box-shadow: none;
    border-color: rgba(148, 163, 184, 0.18);
}

.my-cards-section { margin-top: 40px; }

.moderation-tasks-section,
.processing-tasks-section {
    margin-top: 56px;
}

.moderation-tasks-section h2,
.processing-tasks-section h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 24px;
}

.note-textarea-compact {
    min-height: 120px;
}

.empty-state-sidebar {
    padding: 18px 8px 6px;
    text-align: left;
    font-size: 13px;
}

/* ============================================
   Task Status
   ============================================ */

.task-status {
    margin-top: 20px;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-size: 15px;
    text-align: center;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.task-queued {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--warning);
}

.task-processing {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--info);
}

.task-done {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--success);
}

.task-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--error);
}

/* ============================================
   Button Loader
   ============================================ */

.btn-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.spinner {
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

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

/* ============================================
   Card Detail Page
   ============================================ */

.card-detail-section { padding: 40px 0 80px; }

.card-detail { max-width: 900px; margin: 0 auto; }

.detail-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 32px;
    transition: all var(--transition);
}

.detail-back-btn:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    transform: translateX(-4px);
}

.detail-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.detail-header {
    padding: 40px;
    border-bottom: 1px solid var(--border-color);
}

.detail-category {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    display: inline-block;
    margin-bottom: 20px;
}

.detail-category-muted {
    padding: 0;
    background: transparent;
    color: #94a3b8;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
}

.detail-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 16px;
    line-height: 1.2;
}

.detail-date {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.detail-body { padding: 40px; }

.detail-section { margin-bottom: 32px; }
.detail-section:last-child { margin-bottom: 0; }

.detail-section-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-light);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-section-title::before {
    content: '';
    width: 3px;
    height: 16px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

.detail-url {
    display: block;
    padding: 18px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--accent-light);
    word-break: break-all;
    font-size: 15px;
    transition: all var(--transition);
}

.detail-url:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-glow);
}

.detail-summary {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-primary);
    padding: 20px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.detail-tags { display: flex; flex-wrap: wrap; gap: 10px; }

.detail-tags .tag {
    font-size: 14px;
    padding: 8px 16px;
}

.detail-original {
    padding: 20px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
}

/* ============================================
   States
   ============================================ */

.loading-placeholder,
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 16px;
    grid-column: 1 / -1;
    width: 100%;
}

.hidden { display: none !important; }

/* ============================================
   Modal
   ============================================ */

.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 7, 18, 0.75);
    backdrop-filter: blur(6px);
}

.modal-dialog {
    position: relative;
    width: min(760px, 100%);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 28px;
    box-shadow: var(--shadow-lg);
    z-index: 1;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.modal-header h3 {
    font-size: 24px;
    font-weight: 700;
}

.modal-close {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: transparent;
    color: var(--text-secondary);
    font-size: 22px;
    cursor: pointer;
    transition: all var(--transition);
}

.modal-close:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.modal-form .form-group {
    margin-bottom: 18px;
}

.modal-form textarea,
.modal-form input {
    width: 100%;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

.modal-submit {
    width: auto;
    min-width: 160px;
}

/* ============================================
   Footer
   ============================================ */

.footer {
    border-top: 1px solid var(--border-color);
    padding: 24px 0;
    margin-top: 40px;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-copy {
    font-size: 14px;
    color: var(--text-muted);
}

.footer-meta {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.footer-stats {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.footer-stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(148, 163, 184, 0.05);
    color: #9fb1b5;
}

.footer-stat-icon {
    width: 15px;
    height: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #7f9197;
    flex-shrink: 0;
}

.footer-stat-icon svg {
    width: 15px;
    height: 15px;
    display: block;
}

.footer-stat-value {
    font-size: 13px;
    line-height: 1;
    color: #d7e1dd;
    font-variant-numeric: tabular-nums;
}

.footer-stats-error .footer-stat-chip {
    opacity: 0.7;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    font-size: 14px;
    color: var(--text-muted);
    transition: color var(--transition);
}

.footer-links a:hover {
    color: var(--text-secondary);
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
    .hero-title { font-size: 36px; }
    .hero-subtitle { font-size: 16px; }
    .cards-container { grid-template-columns: 1fr; }
    .dashboard-layout { grid-template-columns: 1fr; }
    .dashboard-sidebar { position: static; }
    .dashboard-controls-header { flex-direction: column; align-items: stretch; }
    .section-heading { flex-direction: column; align-items: flex-start; }
    .section-actions { width: 100%; }
    .list-card-row { flex-direction: column; align-items: stretch; }
    .list-card-main { grid-template-columns: 56px minmax(0, 1fr); }
    .list-card-category { grid-column: 2; }
    .list-card-actions { justify-content: flex-start; }
    .detail-header, .detail-body { padding: 28px; }
    .detail-title { font-size: 26px; }
    .tags-container { justify-content: flex-start; }
    .auth-card { padding: 28px; }
    .header-nav { gap: 12px; }
    .user-email { display: none; }
    .footer-inner { flex-direction: column; align-items: center; }
    .footer-meta { justify-content: center; }
    .footer-stats { justify-content: center; }
}

@media (max-width: 480px) {
    .container { padding: 0 16px; }
    .hero { padding: 60px 0 40px; }
    .hero-title { font-size: 28px; }
    .note-textarea { padding: 18px; }
    .card { padding: 22px; }
    .footer-links { flex-direction: column; gap: 8px; text-align: center; }
}
