/* ============================================
   AnyLlotment Styles
   ============================================ */

:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --border: #475569;
    --card-bg: #1e293b;
    --hover-bg: rgba(255, 255, 255, 0.05);
}

/* Light Mode */
.light-mode {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --border: #cbd5e1;
    --card-bg: #ffffff;
    --hover-bg: rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
}

/* App Container */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.app-header {
    background: var(--bg-secondary);
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 2rem;
}

.header-spacer {
    flex: 1;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-email {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.btn-logout {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
}

.btn-sync {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.btn-sync:hover {
    background: var(--primary-hover);
}

/* Theme Toggle Button */
.btn-theme-toggle {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-theme-toggle:hover {
    background: var(--primary);
    border-color: var(--primary);
}

/* Show/hide icons based on theme */
.theme-icon-light {
    display: none;
}

.theme-icon-dark {
    display: inline;
}

.light-mode .theme-icon-light {
    display: inline;
}

.light-mode .theme-icon-dark {
    display: none;
}

/* Hidden utility */
.hidden {
    display: none !important;
}

/* ============================================
   Auth Screen
   ============================================ */

.auth-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-primary) 0%, #1a2744 100%);
    padding: 2rem;
}

.auth-container {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    width: 80px;
    height: auto;
    margin-bottom: 1rem;
}

.auth-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--success));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.auth-tagline {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.auth-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: var(--bg-tertiary);
    padding: 0.25rem;
    border-radius: 10px;
}

.auth-tab {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.75rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.auth-tab:hover {
    color: var(--text-primary);
}

.auth-tab.active {
    background: var(--primary);
    color: white;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-form input {
    padding: 0.875rem 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--primary);
}

.auth-form input::placeholder {
    color: var(--text-muted);
}

.btn-auth-primary {
    background: linear-gradient(135deg, var(--primary), #6366f1);
    color: white;
    border: none;
    padding: 0.875rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-auth-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.btn-google:hover {
    background: var(--hover-bg);
    border-color: var(--text-muted);
}

.btn-local {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.875rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.btn-local:hover {
    background: var(--hover-bg);
    border-color: var(--primary);
    color: var(--text-primary);
}

.btn-local-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.auth-error {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #fca5a5;
    font-size: 0.9rem;
    text-align: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-img {
    height: 50px;
    width: auto;
}

.logo-icon {
    font-size: 1.5rem;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--success));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tagline {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Main Layout */
.app-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

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

.sidebar-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.btn-new {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}

.btn-new:hover {
    background: var(--primary-hover);
}

.plan-list {
    list-style: none;
    padding: 0.5rem;
    flex: 1;
    overflow-y: auto;
}

.plan-item {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 0.25rem;
    transition: background 0.2s;
}

.plan-item:hover {
    background: var(--hover-bg);
}

.plan-item.active {
    background: var(--primary);
}

.plan-item-name {
    font-weight: 500;
}

.plan-item-info {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.plan-item.active .plan-item-info {
    color: rgba(255, 255, 255, 0.7);
}

/* Editor */
.editor {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

/* Empty State */
.empty-state {
    color: var(--text-muted);
    padding: 1rem;
    text-align: center;
}

.empty-state-large {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state-large .empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state-large h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.empty-state-large p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), #6366f1);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: transform 0.2s;
}

.btn-primary:hover {
    transform: scale(1.02);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
}

.btn-save {
    background: var(--success);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
}

.btn-delete {
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
}

.btn-delete:hover {
    background: var(--danger);
    color: white;
}

/* Plan Editor */
.plan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.plan-name-input {
    font-size: 1.5rem;
    font-weight: 600;
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 6px;
    width: 300px;
}

.plan-name-input:focus {
    outline: none;
    background: var(--hover-bg);
}

.plan-actions {
    display: flex;
    gap: 0.5rem;
}

/* Stats */
.stats-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 1rem 1.5rem;
    text-align: center;
    min-width: 100px;
    border: 1px solid var(--border);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.5rem;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: 8px 8px 0 0;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: var(--hover-bg);
}

.tab-btn.active {
    color: var(--primary);
    font-weight: 600;
    border-bottom: 2px solid var(--primary);
    margin-bottom: -2px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Sections */
.section {
    margin-bottom: 2rem;
}

.section h4 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.section-note {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

/* Factor Config */
.factor-header {
    display: flex;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.5rem;
}

.factor-header .col-name {
    flex: 1;
}

.factor-header .col-type {
    width: 180px;
}

.factor-header .col-priority {
    width: 80px;
}

.factor-header .col-remove {
    width: 28px;
}

.factor-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.5rem;
    background: var(--bg-tertiary);
    padding: 0.75rem;
    border-radius: 8px;
}

.factor-row input,
.factor-row select {
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.factor-row .factor-name {
    flex: 1;
}

.factor-row .factor-type {
    width: 180px;
}

.factor-row .factor-weight {
    width: 80px;
}

.btn-remove {
    background: var(--danger);
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
}

.btn-add {
    background: var(--success);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 0.5rem;
}

.factor-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-top: 0.75rem;
}

.factor-actions .btn-add {
    margin-top: 0;
}

/* Groups Config */
.group-config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.group-config-header .section-note {
    margin: 0;
}

.btn-reset {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}

.btn-reset:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

/* Size Summary */
.size-summary {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.size-summary.auto-mode {
    background: var(--bg-tertiary);
}

.size-summary.matched {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.size-summary.unmatched {
    background: rgba(251, 146, 60, 0.15);
    border: 1px solid rgba(251, 146, 60, 0.3);
}

.size-summary .total {
    font-weight: 500;
}

.size-summary .mode {
    color: var(--text-muted);
    font-style: italic;
}

.size-summary .match {
    color: var(--success);
    font-weight: 600;
}

.size-summary .diff {
    color: var(--warning);
    font-weight: 500;
}

/* Group Cards */
.group-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.group-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: 10px;
}

.group-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.group-fields {
    display: flex;
    gap: 1.5rem;
    flex: 1;
}

.group-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.group-field label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.group-field input {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.group-field input:focus {
    outline: none;
    border-color: var(--primary);
}

.group-field .name-input {
    width: 160px;
}

.group-field .size-input {
    width: 80px;
    text-align: center;
}

/* Subjects Table */
.subjects-section textarea {
    width: 100%;
    height: 120px;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: monospace;
    font-size: 0.85rem;
    resize: vertical;
}

.subjects-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.subjects-table th,
.subjects-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.subjects-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
}

.subjects-table tbody tr:hover {
    background: var(--hover-bg);
}

.group-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    color: white;
}

/* Form Row */
.form-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-row label {
    font-weight: 500;
}

.form-row input[type="number"] {
    width: 80px;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.btn-apply {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
}

.btn-apply:hover {
    background: var(--primary-hover);
}

/* Add Subject Form */
.add-form {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.add-form input {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    min-width: 100px;
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.section-header h4 {
    margin: 0;
}

.btn-bulk-toggle {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-bulk-toggle:hover {
    background: var(--primary);
    border-color: var(--primary);
}

/* Bulk Import Popover */
.bulk-popover {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-top: 1rem;
    animation: slideDown 0.2s ease;
}

.bulk-popover.hidden {
    display: none;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bulk-popover-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.bulk-popover-header h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.btn-close-popover {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
}

.btn-close-popover:hover {
    color: var(--danger);
}

.bulk-popover-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.btn-template {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-template:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-upload {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-upload:hover {
    background: var(--success);
    border-color: var(--success);
}

.bulk-popover textarea {
    width: 100%;
    height: 120px;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.85rem;
    resize: vertical;
    margin-bottom: 0.75rem;
}

.bulk-popover textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-import {
    background: linear-gradient(135deg, var(--primary), #6366f1);
    color: white;
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: transform 0.2s;
}

.btn-import:hover {
    transform: translateY(-1px);
}

/* Empty hint */
.empty-hint {
    color: var(--text-muted);
    font-style: italic;
    padding: 1rem 0;
}

/* Results */
.results-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.btn-run {
    background: linear-gradient(135deg, var(--success), #16a34a);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
}

.btn-run:hover {
    transform: scale(1.02);
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.result-card {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 1.25rem;
}

.result-card h4 {
    margin: 0 0 0.5rem 0;
}

.result-count {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.result-stats .stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.3rem 0;
    font-size: 0.85rem;
}

.result-stats .stat-name {
    color: var(--text-muted);
}

.result-subjects {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 1rem;
}

.subject-tag {
    background: var(--bg-secondary);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

/* Toast */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
}

.toast {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
    border-left: 4px solid var(--primary);
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.warning {
    border-left-color: var(--warning);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Cookie Consent Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 1rem 2rem;
    z-index: 9999;
    animation: slideUp 0.3s ease;
}

.cookie-banner.hidden {
    display: none;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

.cookie-content p {
    flex: 1;
    min-width: 300px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.cookie-actions {
    display: flex;
    gap: 0.75rem;
}

.btn-cookie-accept {
    background: var(--success);
    color: white;
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: transform 0.2s;
}

.btn-cookie-accept:hover {
    transform: translateY(-1px);
}

.btn-cookie-decline {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 0.6rem 1.25rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cookie-decline:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Conflict Resolution Modal */
.conflict-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.conflict-modal {
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 1.5rem;
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.conflict-modal h3 {
    margin-bottom: 0.5rem;
    color: var(--warning);
}

.conflict-desc {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.conflict-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.conflict-item {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid var(--border);
}

.conflict-id {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.conflict-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.conflict-existing,
.conflict-new {
    font-size: 0.85rem;
}

.conflict-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.conflict-existing .conflict-label {
    color: var(--text-muted);
}

.conflict-new .conflict-label {
    color: var(--success);
}

.conflict-values {
    color: var(--text-secondary);
    word-break: break-word;
}

.conflict-actions {
    display: flex;
    gap: 1.5rem;
}

.conflict-actions label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.conflict-actions input[type="radio"] {
    accent-color: var(--primary);
}

.conflict-bulk-actions {
    display: flex;
    gap: 0.75rem;
    margin: 1rem 0;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.btn-bulk {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.btn-bulk:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.conflict-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.conflict-modal-actions .btn-cancel {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 0.6rem 1.25rem;
    border-radius: 6px;
    cursor: pointer;
}

.conflict-modal-actions .btn-cancel:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.conflict-modal-actions .btn-confirm {
    background: var(--success);
    color: white;
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

.conflict-modal-actions .btn-confirm:hover {
    filter: brightness(1.1);
}