/* Style variables & Design system */
:root {
    --bg-dark: #070913;
    --bg-card: rgba(22, 28, 45, 0.7);
    --bg-card-hover: rgba(30, 38, 61, 0.85);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.15);
    --accent: #8b5cf6;
    --accent-glow: rgba(139, 92, 246, 0.3);
    --cyan: #06b6d4;
    
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dark: #6b7280;
    
    --priority-high: #ef4444;
    --priority-high-bg: rgba(239, 68, 68, 0.15);
    --priority-medium: #f59e0b;
    --priority-medium-bg: rgba(245, 158, 11, 0.15);
    --priority-low: #10b981;
    --priority-low-bg: rgba(16, 185, 129, 0.15);
    
    --category-work: #3b82f6;
    --category-work-bg: rgba(59, 130, 246, 0.15);
    --category-personal: #ec4899;
    --category-personal-bg: rgba(236, 72, 153, 0.15);

    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-premium: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow-x: hidden;
    position: relative;
}

/* Premium Gradient Background Grids */
.glass-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.08) 0%, transparent 40%),
                #070913;
}

.glass-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 24px 24px;
}

/* Typographic Headings using Outfit */
h1, h2, h3, .logo-area h1 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

/* Layout container */
.app-container {
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    flex-grow: 1;
}

/* Header design */
.app-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

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

.logo-icon {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
}

.logo-icon i {
    width: 22px;
    height: 22px;
    color: white;
}

.logo-area h1 {
    font-size: 2.5rem;
    background: linear-gradient(to right, #ffffff, #c7d2fe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.03em;
}

.badge-premium {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
    font-size: 0.7rem;
    padding: 0.25rem 0.6rem;
    border-radius: 100px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 500px;
    margin-top: 0.25rem;
    line-height: 1.5;
}

/* Card Styling: Glassmorphism and Hover Effects */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    position: relative;
    overflow: visible;
    box-shadow: var(--shadow-premium);
    transition: var(--transition-smooth);
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
}

.card-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0.8;
}

.recorder-card {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    padding: 2.5rem 2rem;
}

.recorder-card h2 {
    font-size: 1.75rem;
    letter-spacing: -0.01em;
}

.card-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    max-width: 600px;
    line-height: 1.6;
}

/* Audio Recording Micro-animations */
.record-control-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    margin: 1.5rem 0;
    width: 100%;
}

.btn-record {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border: none;
    outline: none;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4);
    transition: var(--transition-smooth);
}

.btn-record:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 30px rgba(99, 102, 241, 0.6);
}

.btn-record:active {
    transform: scale(0.95);
}

.btn-content {
    background: rgba(7, 9, 19, 0.2);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: var(--transition-smooth);
}

.mic-icon {
    width: 28px;
    height: 28px;
    color: white;
    transition: var(--transition-smooth);
}

/* Recording State */
.btn-record.recording {
    background: linear-gradient(135deg, #ef4444, #ec4899);
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.4);
}

.btn-record.recording .btn-content {
    background: rgba(7, 9, 19, 0.3);
}

.btn-record.recording .mic-icon {
    transform: scale(1.1);
    animation: pulseMic 1.5s infinite ease-in-out;
}

/* Pulse Rings */
.pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--primary);
    opacity: 0;
    z-index: 1;
}

.btn-record.recording .pulse-ring {
    animation: recordPulse 2s infinite ease-out;
    background: #ef4444;
}

@keyframes recordPulse {
    0% {
        transform: scale(1);
        opacity: 0.4;
    }
    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

@keyframes pulseMic {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.record-status {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.01em;
}

.record-status.recording {
    color: #ef4444;
    font-weight: 600;
}

/* Audio Visualizer Waveform */
.visualizer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    max-width: 240px;
    margin-bottom: 0.5rem;
}

.waveform {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 40px;
    width: 100%;
}

.waveform .bar {
    width: 4px;
    height: 8px;
    background-color: var(--accent);
    border-radius: 2px;
    transition: var(--transition-smooth);
}

.btn-record.recording ~ .visualizer-container .waveform .bar {
    background-color: #ef4444;
    animation: soundWave 1.2s infinite ease-in-out;
}

/* Staggered animation for wave bars */
.waveform .bar:nth-child(1) { animation-delay: 0.1s; height: 12px; }
.waveform .bar:nth-child(2) { animation-delay: 0.3s; height: 24px; }
.waveform .bar:nth-child(3) { animation-delay: 0.5s; height: 16px; }
.waveform .bar:nth-child(4) { animation-delay: 0.2s; height: 32px; }
.waveform .bar:nth-child(5) { animation-delay: 0.4s; height: 20px; }
.waveform .bar:nth-child(6) { animation-delay: 0.6s; height: 8px; }
.waveform .bar:nth-child(7) { animation-delay: 0.1s; height: 18px; }
.waveform .bar:nth-child(8) { animation-delay: 0.5s; height: 28px; }
.waveform .bar:nth-child(9) { animation-delay: 0.3s; height: 14px; }
.waveform .bar:nth-child(10) { animation-delay: 0.2s; height: 30px; }
.waveform .bar:nth-child(11) { animation-delay: 0.4s; height: 22px; }
.waveform .bar:nth-child(12) { animation-delay: 0.6s; height: 10px; }

@keyframes soundWave {
    0%, 100% {
        transform: scaleY(0.4);
    }
    50% {
        transform: scaleY(1.2);
    }
}

.timer {
    font-family: monospace;
    font-size: 1.1rem;
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    letter-spacing: 0.05em;
}

/* Divider styling */
.divider {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 400px;
    margin: 0.5rem 0;
    color: var(--text-dark);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.1em;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

.divider span {
    padding: 0 1rem;
}

/* File Upload Area */
.file-upload-area {
    width: 100%;
    max-width: 500px;
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 1.5rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.file-upload-area:hover, .file-upload-area.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.03);
}

.file-input-hidden {
    display: none;
}

.file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    width: 100%;
}

.upload-icon {
    width: 32px;
    height: 32px;
    color: var(--text-muted);
    transition: var(--transition-smooth);
}

.file-upload-area:hover .upload-icon {
    color: var(--primary);
    transform: translateY(-2px);
}

.upload-text {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.upload-text .highlight {
    color: var(--primary);
    font-weight: 600;
}

.upload-formats {
    font-size: 0.75rem;
    color: var(--text-dark);
}

/* Tips Box */
.tips-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 1.25rem;
    max-width: 600px;
    text-align: left;
}

.tips-box h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: #e0e7ff;
}

.tips-box p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    font-style: italic;
}

/* Loading Card */
.loading-card {
    text-align: center;
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
     margin: 16px 0px;
}

.loading-spinner-wrapper {
    position: relative;
    width: 60px;
    height: 60px;
}

.spinner {
    width: 100%;
    height: 100%;
    border: 4px solid rgba(255, 255, 255, 0.05);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-card h3 {
    font-size: 1.3rem;
}

.loading-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Alert Banner (Error State) */
.alert-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    font-size: 0.9rem;
    margin: 1rem 0;
    width: 100%;
    animation: slideDown 0.3s ease-out;
}

.alert-banner.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #fca5a5;
}

.alert-banner.error i {
    color: #f87171;
    flex-shrink: 0;
}

.btn-close-alert {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: var(--transition-smooth);
}

.btn-close-alert:hover {
    opacity: 1;
}

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

/* Grid Layout for Output */
.dashboard-grid {
    display: grid;
    margin:16px 0px;
    grid-template-columns: 1fr 1.6fr;
    gap: 2rem;
    width: 100%;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.side-column {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.main-column {
    display: flex;
    flex-direction: column;
    gap: 2.25rem;
}

/* Section Title */
.section-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

.section-title i {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.section-title h2 {
    font-size: 1.25rem;
    color: #f3f4f6;
}

/* Summary Box */
.summary-text {
    font-size: 0.95rem;
    color: #e5e7eb;
    line-height: 1.6;
}

/* Transcript Box */
.transcript-box {
    max-height: 250px;
    overflow-y: auto;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-muted);
    padding-right: 0.5rem;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

/* Custom Scrollbar for Transcript Box */
.transcript-box::-webkit-scrollbar {
    width: 6px;
}

.transcript-box::-webkit-scrollbar-track {
    background: transparent;
}

.transcript-box::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
}

.transcript-box::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Main Column: Tasks & Reminders Header */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.section-header .section-title {
    margin-bottom: 0;
}

.header-icon-todo {
    color: var(--primary);
}

.header-icon-reminder {
    color: var(--accent);
}

.count-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.2rem 0.65rem;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 100px;
    color: var(--text-main);
}

/* Lists styling */
.task-list, .reminder-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.empty-state {
    background: rgba(255, 255, 255, 0.01);
    border: 1px dashed rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: 14px;
    text-align: center;
    color: var(--text-dark);
    font-size: 0.9rem;
}

/* Dynamic Item Cards */
.task-item, .reminder-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.25rem;
    transition: var(--transition-smooth);
    animation: slideIn 0.3s ease-out;
    position: relative;
    overflow: visible;
}

.task-item:hover, .reminder-item:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

/* Exit / delete animation */
.task-item.fade-out, .reminder-item.fade-out {
    opacity: 0;
    transform: scale(0.9) translateY(-10px);
    max-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    border-width: 0 !important;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.item-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.item-header-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.item-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.4;
    word-break: break-word;
}

.item-desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Badges for Tasks */
.badge {
    font-size: 0.72rem;
    padding: 0.15rem 0.5rem;
    border-radius: 100px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.badge-priority-high {
    background-color: var(--priority-high-bg);
    color: var(--priority-high);
}

.badge-priority-medium {
    background-color: var(--priority-medium-bg);
    color: var(--priority-medium);
}

.badge-priority-low {
    background-color: var(--priority-low-bg);
    color: var(--priority-low);
}

.badge-category-work {
    background-color: var(--category-work-bg);
    color: var(--category-work);
}

.badge-category-personal {
    background-color: var(--category-personal-bg);
    color: var(--category-personal);
}

/* Meta information (Dates, Time Estimates) */
.item-meta {
    display: flex;
    align-items: center;
    margin-top: 0.25rem;
    flex-wrap: wrap;
    gap: 8px;
}

.meta-field {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-dark);
    gap: 6px;
}

.dropdown-arrow {
    width: 14px;
    height: 14px;
}

.meta-field i {
    width: 14px;
    height: 14px;
}

.meta-field.has-val {
    color: var(--text-muted);
}

.meta-field.has-val i {
    color: var(--primary);
}

.meta-field.has-val-alt i {
    color: var(--accent);
}

/* Delete Button */
.btn-delete-item {
    background: none;
    border: none;
    outline: none;
    color: var(--text-dark);
    padding: 0.35rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    margin-left: 0.5rem;
    flex-shrink: 0;
}

.btn-delete-item:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    transform: scale(1.08);
}

/* Footer layout */
.app-footer-bar {
    text-align: center;
    padding-top: 2rem;
    color: var(--text-dark);
    font-size: 0.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ─── Responsive: Tablet ──────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* ─── Responsive: Mobile ──────────────────────────────────────────────────── */
@media (max-width: 600px) {

    /* Layout */
    .app-container {
        padding: 1.25rem 0.875rem;
        gap: 1.5rem;
    }

    /* Header */
    .logo-area h1 { font-size: 1.8rem; }

    .logo-icon {
        width: 34px;
        height: 34px;
    }

    .logo-icon i {
        width: 17px;
        height: 17px;
    }

    .badge-premium { display: none; }

    .subtitle {
        font-size: 0.9rem;
        text-align: center;
    }

    /* Cards */
    .card {
        padding: 1.25rem 1rem;
        border-radius: 16px;
    }

    .recorder-card {
        padding: 1.5rem 1rem;
        gap: 1rem;
    }

    .recorder-card h2 { font-size: 1.35rem; }

    /* Record button */
    .btn-record  { width: 68px; height: 68px; }
    .btn-content { width: 54px; height: 54px; }
    .mic-icon    { width: 22px; height: 22px; }

    /* File upload */
    .file-upload-area { padding: 1.1rem 0.875rem; }
    .upload-text      { font-size: 0.83rem; }

    /* Tips */
    .tips-box      { padding: 1rem; }
    .tips-box h3   { font-size: 0.85rem; }
    .tips-box p    { font-size: 0.8rem; }

    /* Dashboard grid already 1-col at 900px, just tighten gap */
    .dashboard-grid { gap: 1.25rem; margin: 8px 0; }

    /* Section titles */
    .section-title h2 { font-size: 1.1rem; }

    /* Task & reminder items */
    .task-item,
    .reminder-item {
        padding: 1rem 0.875rem;
        gap: 0.75rem;
        border-radius: 12px;
    }

    /* Item header: title + badges wrap */
    .item-header-row {
        flex-wrap: wrap;
        gap: 6px;
    }

    .item-title { font-size: 0.95rem; }

    .item-desc { font-size: 0.83rem; }

    /* Meta row: allow 2-column grid on small screens */
    .item-meta {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-top: 0.5rem;
    }

    .meta-field {
        font-size: 0.75rem;
        gap: 4px;
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
    }

    .meta-field span {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .meta-field i { width: 12px; height: 12px; }

    .dropdown-arrow {
        width: 11px;
        height: 11px;
    }

    /* Badges */
    .badge {
        font-size: 0.65rem;
        padding: 0.12rem 0.45rem;
    }

    /* Checkbox */
    .task-checkbox-box {
        width: 16px;
        height: 16px;
    }

    /* Delete button */
    .btn-delete-item {
        padding: 0.25rem;
    }

    /* Create tasks bar — stack vertically */
    .create-tasks-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 0.875rem 1rem;
    }

    .btn-create-tasks {
        justify-content: center;
        padding: 11px 16px;
        font-size: 0.875rem;
        width: 100%;
    }

    .create-tasks-hint {
        justify-content: center;
        font-size: 0.78rem;
    }

    /* Transcript box */
    .transcript-box { max-height: 180px; }

    /* Loading card */
    .loading-card { padding: 2rem 1rem; }

    /* Footer */
    .app-footer-bar { font-size: 0.72rem; padding-top: 1.25rem; }

    /* Toast — full width on mobile */
    .taskyz-toast {
        bottom: 16px;
        left: 12px;
        right: 12px;
        transform: translateX(0) translateY(20px);
        max-width: 100%;
        font-size: 0.83rem;
    }

    .taskyz-toast.toast-visible {
        transform: translateX(0) translateY(0);
    }
}

/* ─── Interactive meta field triggers (project / user / date) ─────────────── */
.meta-field-interactive,
.date-trigger {
    cursor: pointer;
    border-radius: 8px;
    padding: 3px 6px;
    transition: var(--transition-smooth);
    user-select: none;
}

.meta-field-interactive:hover,
.date-trigger:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--text-muted);
}

.meta-field-interactive:hover i,
.date-trigger:hover i {
    color: var(--primary);
}

/* Active (has value) state for date trigger */
.date-trigger.has-val .date-display { color: var(--text-muted); }
.date-trigger.has-val i[data-lucide="calendar"] { color: var(--primary); }

/* ─── Portal — lives on <body>, never clipped ─────────────────────────────── */
#taskyz-portal {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
}

/* Portal list items */
.portal-option {
    padding: 10px 14px;
    color: var(--text-muted, #9ca3af);
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portal-option:hover {
    background: rgba(99, 102, 241, 0.14);
    color: #f3f4f6;
}

/* User option row */
.portal-user-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    white-space: normal;
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.user-avatar-placeholder {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.user-option-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.user-option-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #f3f4f6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-option-role {
    font-size: 0.72rem;
    color: #6b7280;
    text-transform: capitalize;
}

/* Portal loading / info message */
.portal-msg {
    padding: 12px 14px;
    font-size: 0.82rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Small inline spinner */
.spinner-sm {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

/* ─── Task checkbox ───────────────────────────────────────────────────────── */
.task-checkbox-wrap {
    display: flex;
    align-items: flex-start;
    padding-top: 2px;
    cursor: pointer;
    flex-shrink: 0;
}

.task-checkbox {
    display: none; /* hide native, use custom box */
}

.task-checkbox-box {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.04);
    flex-shrink: 0;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.task-checkbox:checked + .task-checkbox-box {
    background: var(--primary);
    border-color: var(--primary);
}

.task-checkbox:checked + .task-checkbox-box::after {
    content: "";
    width: 5px;
    height: 9px;
    border: 2px solid white;
    border-top: none;
    border-left: none;
    transform: rotate(45deg) translateY(-1px);
    display: block;
}

.task-checkbox-wrap:hover .task-checkbox-box {
    border-color: var(--primary);
}

/* Deselected task — dimmed */
.task-item.task-deselected {
    opacity: 0.45;
}

.task-item.task-deselected .item-title {
    text-decoration: line-through;
    color: var(--text-dark);
}

/* ─── Status badge inside meta ────────────────────────────────────────────── */
.status-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.status-active   { color: #10b981; }
.status-inactive { color: #6b7280; }

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    flex-shrink: 0;
}
.status-dot.status-active   { background: #10b981; }
.status-dot.status-inactive { background: #6b7280; }

/* Active option highlight in portal */
.portal-option-active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary, #6366f1);
}

/* ─── Field error highlight ───────────────────────────────────────────────── */
.field-error {
    outline: 2px solid #ef4444 !important;
    border-radius: 8px;
    animation: shakeField 0.3s ease;
}

@keyframes shakeField {
    0%, 100% { transform: translateX(0); }
    25%       { transform: translateX(-4px); }
    75%       { transform: translateX(4px); }
}

/* ─── Create tasks bar ────────────────────────────────────────────────────── */
.create-tasks-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.25rem;
    padding: 1rem 1.25rem;
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 14px;
    flex-wrap: wrap;
}

.create-tasks-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--text-dark);
}

.create-tasks-hint i {
    width: 14px;
    height: 14px;
    color: #6366f1;
    flex-shrink: 0;
}

.btn-create-tasks {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
    white-space: nowrap;
}

.btn-create-tasks:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-create-tasks:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.btn-create-tasks i {
    width: 16px;
    height: 16px;
}

/* ─── Toast notification ──────────────────────────────────────────────────── */
.taskyz-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    z-index: 999999;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 22px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    max-width: 480px;
    text-align: left;
    font-family: 'Inter', sans-serif;
}

.taskyz-toast.toast-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.taskyz-toast.toast-success {
    background: #052e16;
    border: 1px solid #16a34a;
    color: #4ade80;
}

.taskyz-toast.toast-error {
    background: #1f0a0a;
    border: 1px solid #dc2626;
    color: #f87171;
}

.taskyz-toast i {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ─── Portal: constrain on small screens ─────────────────────────────────── */
@media (max-width: 600px) {
    #taskyz-portal {
        min-width: 160px !important;
        max-width: calc(100vw - 24px) !important;
        font-size: 0.83rem;
    }

    .portal-option { padding: 9px 12px; }

    .portal-user-option { padding: 7px 10px; gap: 8px; }

    .user-avatar,
    .user-avatar-placeholder {
        width: 26px;
        height: 26px;
    }
}
