:root {
    --primary: #3d5afe;
    --primary-dark: #2a3eb1;
    --primary-light: #e8ecff;
    --bg-dark: #0f172a;
    --card: #ffffff;
    --border: #e2e8f0;
    --text: #1e293b;
    --muted: #64748b;
    --app-bg: #f8fafc;
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #dc2626;
    --purple: #9333ea;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--app-bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

/* Navigation Bar */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: -0.02em;
}

.brand-icon {
    width: 28px;
    height: 28px;
    color: var(--primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link {
    text-decoration: none;
    color: var(--muted);
    font-weight: 600;
    font-size: 0.92rem;
    padding: 8px 14px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

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

.nav-link.active {
    color: var(--primary);
    background: var(--primary-light);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.nav-actions .analyzer-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 0.88rem;
    padding: 0 16px;
    height: 38px;
    border-radius: 999px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(61, 90, 254, 0.25);
    white-space: nowrap;
}

.nav-actions .analyzer-nav-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(61, 90, 254, 0.35);
}

.nav-actions .analyzer-nav-btn svg {
    width: 15px;
    height: 15px;
}

/* Page Shell */
.page-shell {
    max-width: 1280px;
    margin: 0 auto;
    padding: 36px 24px 80px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Hero Section */
.tracker-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #ffffff;
    padding: 32px 36px;
    border-radius: 20px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.15);
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(61, 90, 254, 0.2);
    border: 1px solid rgba(61, 90, 254, 0.4);
    color: #93c5fd;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 12px;
}

.pulse-dot {
    width: 7px;
    height: 7px;
    background: #60a5fa;
    border-radius: 50%;
    box-shadow: 0 0 8px #60a5fa;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

.hero-text h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
}

.hero-text p {
    color: #94a3b8;
    font-size: 1rem;
    max-width: 600px;
    line-height: 1.5;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.btn-primary-hero {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary);
    color: #ffffff;
    border: none;
    padding: 14px 22px;
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 8px 20px rgba(61, 90, 254, 0.35);
}

.btn-primary-hero:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(61, 90, 254, 0.45);
}

.btn-primary-hero svg {
    width: 18px;
    height: 18px;
}

.stat-badge {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 14px 22px;
    border-radius: 16px;
    text-align: center;
    min-width: 140px;
}

.stat-label {
    display: block;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #94a3b8;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 900;
    color: #ffffff;
}

/* Pipeline Summary Strip */
.pipeline-summary-strip {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

.stage-metric {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    transition: all 0.2s ease;
    cursor: pointer;
}

.stage-metric:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.05);
    border-color: var(--primary);
}

.stage-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot-applied { background: var(--primary); box-shadow: 0 0 6px rgba(61, 90, 254, 0.5); }
.dot-screening { background: var(--purple); box-shadow: 0 0 6px rgba(147, 51, 234, 0.5); }
.dot-interview { background: var(--warning); box-shadow: 0 0 6px rgba(245, 158, 11, 0.5); }
.dot-offer { background: var(--success); box-shadow: 0 0 6px rgba(22, 163, 74, 0.5); }
.dot-rejected { background: var(--danger); box-shadow: 0 0 6px rgba(220, 38, 38, 0.5); }
.dot-no_response, .dot-no-response { background: var(--muted); box-shadow: 0 0 6px rgba(100, 116, 139, 0.5); }

.stage-name {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text);
    flex: 1;
}

.stage-count {
    font-size: 1rem;
    font-weight: 800;
    color: var(--muted);
    background: var(--app-bg);
    padding: 2px 8px;
    border-radius: 999px;
}

/* Controls Panel */
.controls-panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02);
}

.search-box {
    position: relative;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--muted);
    pointer-events: none;
}

.search-box input {
    width: 100%;
    padding: 12px 40px 12px 42px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 0.95rem;
    background: var(--app-bg);
    color: var(--text);
    outline: none;
    transition: all 0.2s ease;
}

.search-box input:focus {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(61, 90, 254, 0.15);
}

.clear-search-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    font-size: 1.2rem;
    color: var(--muted);
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

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

.filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-btn {
    background: var(--app-bg);
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    color: var(--text);
    border-color: #cbd5e1;
    background: #ffffff;
}

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(61, 90, 254, 0.25);
}

.controls-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sort-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--muted);
}

.sort-select {
    padding: 7px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #ffffff;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text);
    outline: none;
    cursor: pointer;
}

.refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text);
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.refresh-btn:hover {
    background: var(--app-bg);
    border-color: #cbd5e1;
}

.refresh-btn svg {
    width: 14px;
    height: 14px;
}

/* Applications Container & Cards */
.applications-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
}

.app-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
    position: relative;
}

.app-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
    border-color: #cbd5e1;
}

/* Stage Accents */
.app-card.stage-applied { border-left: 4px solid var(--primary); }
.app-card.stage-screening { border-left: 4px solid var(--purple); }
.app-card.stage-interview { border-left: 4px solid var(--warning); }
.app-card.stage-offer { border-left: 4px solid var(--success); background: linear-gradient(180deg, rgba(22, 163, 74, 0.03) 0%, #ffffff 100%); }
.app-card.stage-rejected { border-left: 4px solid var(--danger); opacity: 0.88; }
.app-card.stage-no_response, .app-card.stage-no-response { border-left: 4px solid var(--muted); opacity: 0.8; }

.app-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.app-title-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.app-job-title {
    font-size: 1.12rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.35;
    word-break: break-word;
}

.app-company-name {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
}

.app-company-name svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.app-date-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: 500;
}

.app-date-meta svg {
    width: 13px;
    height: 13px;
}

/* Status Stage Badge */
.stage-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.stage-badge.badge-applied { background: rgba(61, 90, 254, 0.1); color: var(--primary); border: 1px solid rgba(61, 90, 254, 0.3); }
.stage-badge.badge-screening { background: rgba(147, 51, 234, 0.1); color: var(--purple); border: 1px solid rgba(147, 51, 234, 0.3); }
.stage-badge.badge-interview { background: rgba(245, 158, 11, 0.1); color: #d97706; border: 1px solid rgba(245, 158, 11, 0.35); }
.stage-badge.badge-offer { background: rgba(22, 163, 74, 0.12); color: var(--success); border: 1px solid rgba(22, 163, 74, 0.35); }
.stage-badge.badge-rejected { background: rgba(220, 38, 38, 0.1); color: var(--danger); border: 1px solid rgba(220, 38, 38, 0.3); }
.stage-badge.badge-no_response, .stage-badge.badge-no-response { background: rgba(100, 116, 139, 0.1); color: var(--muted); border: 1px solid rgba(100, 116, 139, 0.3); }

/* Notes Section */
.app-notes-section {
    background: var(--app-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notes-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.edit-notes-btn {
    background: transparent;
    border: none;
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.edit-notes-btn:hover {
    background: var(--primary-light);
}

.notes-content-text {
    font-size: 0.88rem;
    color: var(--text);
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

.notes-content-empty {
    font-size: 0.85rem;
    color: #94a3b8;
    font-style: italic;
}

/* Notes Inline Editor */
.notes-editor {
    display: none;
    flex-direction: column;
    gap: 8px;
}

.notes-editor.active {
    display: flex;
}

.notes-textarea {
    width: 100%;
    min-height: 70px;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #ffffff;
    font-family: inherit;
    font-size: 0.88rem;
    color: var(--text);
    outline: none;
    resize: vertical;
}

.notes-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(61, 90, 254, 0.15);
}

.notes-editor-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.btn-save-note {
    background: var(--primary);
    color: #ffffff;
    border: none;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-save-note:hover {
    background: var(--primary-dark);
}

.btn-cancel-note {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-cancel-note:hover {
    background: #ffffff;
    color: var(--text);
}

/* Actions Row */
.app-actions-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding-top: 6px;
}

.app-link-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--primary);
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.88rem;
    transition: all 0.2s ease;
}

.app-link-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.app-link-btn svg {
    width: 14px;
    height: 14px;
}

/* Quick Status Selector */
.app-status-select-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.app-status-select {
    appearance: none;
    -webkit-appearance: none;
    padding: 10px 32px 10px 12px;
    border-radius: 10px;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    outline: none;
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 13px 13px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.app-status-select.sel-applied { background-color: rgba(61, 90, 254, 0.08); border-color: rgba(61, 90, 254, 0.3); color: var(--primary); }
.app-status-select.sel-screening { background-color: rgba(147, 51, 234, 0.08); border-color: rgba(147, 51, 234, 0.3); color: var(--purple); }
.app-status-select.sel-interview { background-color: rgba(245, 158, 11, 0.08); border-color: rgba(245, 158, 11, 0.35); color: #d97706; }
.app-status-select.sel-offer { background-color: rgba(22, 163, 74, 0.1); border-color: rgba(22, 163, 74, 0.35); color: var(--success); }
.app-status-select.sel-rejected { background-color: rgba(220, 38, 38, 0.08); border-color: rgba(220, 38, 38, 0.3); color: var(--danger); }
.app-status-select.sel-no_response, .app-status-select.sel-no-response { background-color: rgba(100, 116, 139, 0.08); border-color: rgba(100, 116, 139, 0.3); color: var(--muted); }

.app-status-select:disabled,
.app-status-select.is-updating {
    opacity: 0.6;
    cursor: wait;
}

/* Delete Button */
.app-delete-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #ef4444;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    padding: 0;
}

.app-delete-btn:hover {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.app-delete-btn:active {
    transform: translateY(0);
}

.app-delete-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    transition: transform 0.2s ease;
}

.app-delete-btn:hover svg {
    transform: scale(1.1);
}

.app-delete-btn:disabled,
.app-delete-btn.is-deleting {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    background: var(--card);
    border: 1px dashed var(--border);
    border-radius: 18px;
    padding: 60px 24px;
    text-align: center;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.empty-state svg {
    width: 48px;
    height: 48px;
    color: #94a3b8;
}

.empty-state p {
    font-size: 1rem;
    font-weight: 600;
    max-width: 440px;
}

.empty-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary);
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 11px 20px;
    border-radius: 10px;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.empty-action-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* Pagination Bar */
.pagination-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 20px;
}

.pagination-info {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--muted);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.page-nav-btn,
.page-num-btn {
    background: #ffffff;
    border: 1px solid var(--border);
    color: var(--text);
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.page-nav-btn:hover:not(:disabled),
.page-num-btn:hover:not(.active) {
    background: var(--app-bg);
    border-color: #cbd5e1;
}

.page-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-num-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.page-size-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--muted);
}

.page-size-select {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #ffffff;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text);
    outline: none;
    cursor: pointer;
}

/* Floating Toast */
.app-toast {
    position: fixed;
    bottom: 28px;
    right: 28px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 12px;
    background: #0f172a;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
    z-index: 1000;
    opacity: 0;
    transform: translateY(12px);
    transition: all 0.25s ease;
    pointer-events: none;
}

.app-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.app-toast.success { border-left: 4px solid var(--success); }
.app-toast.error { border-left: 4px solid var(--danger); }
.app-toast.info { border-left: 4px solid var(--primary); }

/* Modal Popup Window */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal-container {
    background: #ffffff;
    border-radius: 20px;
    max-width: 540px;
    width: 100%;
    padding: 28px 30px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
    border: 1px solid var(--border);
    transform: translateY(16px) scale(0.97);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-overlay.show .modal-container {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.modal-title-group {
    flex: 1;
}

.modal-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 10px;
    border-radius: 999px;
    margin-bottom: 6px;
}

.modal-badge svg {
    width: 12px;
    height: 12px;
}

.modal-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
    margin: 0 0 4px;
}

.modal-subtitle {
    font-size: 0.88rem;
    color: var(--muted);
    line-height: 1.4;
    margin: 0;
}

.modal-close-btn {
    background: transparent;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    color: var(--text);
    background: var(--app-bg);
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-error-alert {
    background: rgba(220, 38, 38, 0.08);
    border: 1px solid rgba(220, 38, 38, 0.3);
    color: var(--danger);
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.45;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 4px;
}

.required-star {
    color: var(--danger);
    font-weight: 800;
}

.optional-tag {
    font-size: 0.76rem;
    font-weight: 500;
    color: var(--muted);
    margin-left: 2px;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 11px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--app-bg);
    color: var(--text);
    font-family: inherit;
    font-size: 0.92rem;
    outline: none;
    transition: all 0.2s ease;
}

.form-input:focus,
.form-textarea:focus {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(61, 90, 254, 0.15);
}

.form-input.has-error,
.form-textarea.has-error {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.field-validation-msg {
    font-size: 0.8rem;
    color: var(--danger);
    font-weight: 600;
    display: none;
}

.field-validation-msg.visible {
    display: block;
}

.modal-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.modal-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-btn svg {
    width: 16px;
    height: 16px;
}

.modal-btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
}

.modal-btn-secondary:hover {
    background: var(--app-bg);
    color: var(--text);
    border-color: #cbd5e1;
}

.modal-btn-primary {
    background: var(--primary);
    border: none;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(61, 90, 254, 0.25);
}

.modal-btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(61, 90, 254, 0.35);
}

.modal-btn:disabled {
    opacity: 0.6;
    cursor: wait;
    transform: none;
}

/* Responsive */
@media (max-width: 1080px) {
    .pipeline-summary-strip {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .tracker-hero {
        flex-direction: column;
        padding: 24px 20px;
    }

    .pipeline-summary-strip {
        grid-template-columns: repeat(2, 1fr);
    }

    .applications-container {
        grid-template-columns: 1fr;
    }

    .filters-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .controls-right {
        width: 100%;
        justify-content: space-between;
    }

    .pagination-bar {
        flex-direction: column;
        align-items: center;
    }
}
