:root {
    /* Premium SaaS Palette */
    --header-bg: #0f172a;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --background: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;

    /* Vibrant Status Colors */
    --success: #10b981;
    --success-bg: #d1fae5;
    --danger: #ef4444;
    --danger-bg: #fee2e2;
    --pending: #f59e0b;
    --pending-bg: #fef3c7;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius: 12px;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--background);
    color: var(--text-main);
    min-height: 100vh;
}

/* Header & Menu */
header {
    background: var(--header-bg);
    color: white;
    padding: 16px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}
.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.title-area {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.brand-line {
    display: flex;
    align-items: center;
    gap: 12px;
}
.brand-line h1 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0;
    letter-spacing: -0.01em;
}

/* File Selector Dropdown Base */
.file-selector-wrapper {
    position: relative;
}
.active-file-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    font-weight: 500;
    color: #e2e8f0;
    max-width: 280px;
}
.active-file-btn span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.active-file-btn:hover {
    background: rgba(255,255,255,0.2);
    color: white;
}
.active-file-btn .chevron {
    font-size: 0.7rem;
    transition: transform 0.2s;
}
.active-file-btn.active .chevron {
    transform: rotate(180deg);
}
.file-dropdown-panel {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    min-width: 300px;
    z-index: 200;
    border: 1px solid var(--border);
    flex-direction: column;
}
.file-dropdown-panel.active {
    display: flex;
    animation: dropFade 0.2s ease-out;
}
.file-search-box {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    position: relative;
}
.file-search-box i {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
}
.file-search-box input[type="text"] {
    width: 100%;
    padding: 10px 10px 10px 44px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
    outline: none;
    background: #f8fafc;
    color: var(--text-main);
}
.file-search-box input[type="text"]:focus {
    border-color: var(--primary);
    background: #fff;
}
.file-list-items {
    max-height: 250px;
    overflow-y: auto;
    padding: 8px;
    background: #fff;
}
.file-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    color: var(--text-main);
    border: 1px solid transparent;
    margin-bottom: 4px;
}
.file-item-row:hover {
    background: #f8fafc;
    border-color: var(--border);
}
.file-item-row.active-item {
    background: var(--primary-light);
    border-color: #bfdbfe;
}
.file-item-info {
    flex: 1;
    overflow: hidden;
}
.file-item-name {
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.file-item-stats {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}
.remove-file-icon {
    color: #94a3b8;
    padding: 6px 8px;
    font-size: 1.1rem;
    transition: color 0.2s, transform 0.2s;
    cursor: pointer;
}
.remove-file-icon:hover {
    color: var(--danger);
    transform: scale(1.1);
}

/* Right Side Header Icons */
.header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-top: 4px;
}
.add-file-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.2s ease;
}
.add-file-btn:hover {
    color: white;
    border-color: white;
    background: rgba(255,255,255,0.1);
    transform: scale(1.05);
}
.menu-container {
    position: relative;
}
.hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-size: 1.3rem;
    cursor: pointer;
    color: #cbd5e1;
    border-radius: 6px;
    transition: all 0.2s;
}
.hamburger:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 250px;
    margin-top: 16px;
    z-index: 101;
    max-height: 85vh;
    overflow-y: auto;
    border: 1px solid rgba(0,0,0,0.06);
    padding: 8px 0;
}
.dropdown-menu.active {
    display: flex;
    flex-direction: column;
    animation: menuFadeIn 0.2s ease-out;
}
@keyframes menuFadeIn {
    from { opacity: 0; transform: translateY(-10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.menu-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}
.dropdown-menu > button {
    width: calc(100% - 16px);
    margin: 2px 8px;
    padding: 12px 16px;
    border-radius: 8px;
    text-align: left;
    background: transparent;
    border: none;
    font-size: 0.95rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}
.dropdown-menu > button:hover {
    background: var(--background);
    color: var(--primary);
    transform: translateX(2px);
}
.dropdown-menu > button i {
    width: 20px;
    text-align: center;
    color: var(--text-muted);
    transition: color 0.2s;
}
.dropdown-menu > button:hover i {
    color: var(--primary);
}
.dropdown-menu > button.danger-text {
    color: var(--danger) !important;
    margin-top: 6px;
}
.dropdown-menu > button.danger-text i {
    color: var(--danger);
}
.dropdown-menu > button.danger-text:hover {
    background: var(--danger-bg);
    color: var(--danger);
}

/* --- NEW: User Profile in Dropdown --- */
.user-profile-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}
.user-profile-item img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}
.user-profile-item .user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}
.user-profile-item .user-info strong {
    font-weight: 600;
    color: var(--text-main);
}
.user-profile-item .user-info span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Containers & Buttons */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px;
}
.view-section {
    display: none;
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.view-section.active {
    display: block;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.primary-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2), 0 2px 4px -1px rgba(37, 99, 235, 0.1);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.primary-btn:hover {
    background: var(--primary-hover);
    box-shadow: 0 6px 8px -1px rgba(37, 99, 235, 0.3);
    transform: translateY(-1px);
}
.primary-btn:active {
    transform: translateY(1px);
    box-shadow: none;
}
.dark-btn {
    background: var(--text-main);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.dark-btn:hover {
    background: #0f172a;
    box-shadow: 0 6px 8px -1px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}
.dark-btn:active {
    transform: translateY(1px);
    box-shadow: none;
}
.btn-success { background: var(--success); box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.2); }
.btn-success:hover { background: #059669; }
.btn-danger { background: var(--danger); box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.2); }
.btn-danger:hover { background: #dc2626; }
.btn-warning { background: var(--pending); box-shadow: 0 4px 6px -1px rgba(245, 158, 11, 0.2); }
.btn-warning:hover { background: #d97706; }
.secondary-btn {
    background: white;
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}
.secondary-btn:hover {
    background: var(--background);
    border-color: #cbd5e1;
}
.full-width {
    width: 100%;
}
.back-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}
.back-btn:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Mapping Base */
.mapping-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 40px 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    max-width: 600px;
    margin: 0 auto;
    text-align: left;
}
.map-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}
.map-group label {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-main);
}
.mapping-actions {
    display: flex;
    gap: 12px;
    margin-top: 30px;
}
.mapping-actions button {
    flex: 1;
}

/* DRAG AND DROP UPLOAD CARD */
.upload-card {
    background: #f8fafc;
    border-radius: var(--radius);
    padding: 50px 24px;
    text-align: center;
    border: 2px dashed #94a3b8;
    max-width: 600px;
    margin: 0 auto;
    transition: all 0.3s ease;
}
.upload-card.dragover {
    background: #f1f5f9;
    border-color: var(--text-main);
    transform: scale(1.02);
}
.upload-card i {
    font-size: 56px;
    color: var(--text-main);
    margin-bottom: 16px;
    opacity: 0.9;
    pointer-events: none;
}
.upload-divider {
    margin: 20px 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    pointer-events: none;
}
.file-label {
    display: inline-block;
    cursor: pointer;
}
input[type="file"] {
    display: none;
}

/* --- NEW: Logged-out Prompt Card --- */
.login-prompt-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 40px 24px;
    text-align: center;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    max-width: 550px;
    margin: 40px auto;
}
.login-prompt-card h2 {
    font-size: 1.5rem;
    color: var(--header-bg);
    margin-bottom: 12px;
}
.login-prompt-card p {
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.5;
}

/* Global Input Override Fix */
input[type="text"],
input[type="email"],
input[type="password"],
textarea {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 0.95rem;
    background: #fff;
    outline: none;
    transition: all 0.2s ease;
    color: var(--text-main);
    font-family: inherit;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}
.premium-select {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    padding: 12px 40px 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
    background-color: var(--card-bg);
    cursor: pointer;
    transition: all 0.2s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 16px !important;
}
.premium-select:hover {
    border-color: #cbd5e1;
    background-color: #f8fafc;
}
.premium-select:focus {
    outline: none;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    background-color: #fff;
}

/* Custom Premium Select Dropdowns */
.custom-select-wrapper {
    position: relative;
    width: 100%;
    user-select: none;
}
.custom-select-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-radius: 8px;
    border: 2px solid var(--border);
    background: var(--card-bg);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    color: var(--text-main);
}
.custom-select-trigger:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}
.custom-select-trigger.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    background: #fff;
    z-index: 10;
}
.custom-select-trigger i.chevron-icon {
    color: var(--text-muted);
    transition: transform 0.2s;
    font-size: 0.85rem;
}
.custom-select-trigger.active i.chevron-icon {
    transform: rotate(180deg);
}
.custom-select-options {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    z-index: 100;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: dropFade 0.2s ease-out;
}
.custom-select-options.show {
    display: flex;
}
.custom-option {
    padding: 12px 16px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s, color 0.2s;
    border-bottom: 1px solid var(--background);
}
.custom-option:last-child {
    border-bottom: none;
}

/* Filter Bar Variant */
.controls-bar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 16px;
}
.filter-group {
    display: flex;
    gap: 12px;
    flex-direction: column;
}
.search-box {
    position: relative;
    flex: 1;
}
.search-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}
.search-box input[type="text"] {
    padding-left: 44px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}
.filter-wrapper {
    flex: 1;
}
.filter-trigger {
    font-weight: 500;
    border-width: 1px;
    padding: 12px 16px;
    box-shadow: var(--shadow-sm);
}
@media(min-width: 768px) {
    .controls-bar { flex-direction: row; }
    .filter-group { flex-direction: row; flex: 1.2; }
}
.results-stats {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* Dropdown Color Mapping Logic */
.status-none { color: var(--text-main); border-color: var(--border); background: #f8fafc; }
.status-interested { color: var(--success); border-color: var(--success); background: var(--success-bg); }
.status-not-interested { color: var(--danger); border-color: var(--danger); background: var(--danger-bg); }
.status-pending { color: var(--pending); border-color: var(--pending); background: var(--pending-bg); }
.opt-none { color: var(--text-main); }
.opt-none i { color: var(--text-muted); }
.opt-none:hover { background: #f1f5f9; }
.opt-interested { color: var(--text-main); }
.opt-interested i { color: var(--success); }
.opt-interested:hover { background: var(--success-bg); color: #065f46; }
.opt-not-interested { color: var(--text-main); }
.opt-not-interested i { color: var(--danger); }
.opt-not-interested:hover { background: var(--danger-bg); color: #991b1b; }
.opt-pending { color: var(--text-main); }
.opt-pending i { color: var(--pending); }
.opt-pending:hover { background: var(--pending-bg); color: #92400e; }

/* Grid & Cards */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    align-items: stretch;
}
@media (min-width: 768px) { .contact-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .contact-grid { grid-template-columns: repeat(3, 1fr); } }
.contact-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    border-left: 6px solid var(--border);
    display: flex;
    flex-direction: column;
    position: relative;
    height: 100%;
    min-width: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.contact-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* NEW CARD HEADER LAYOUT */
.contact-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}
.contact-name {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--header-bg);
    word-break: break-word;
    flex: 1;
    padding-top: 2px;
}
.header-actions-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}
.edit-btn {
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.05rem;
    padding: 4px 6px;
    border-radius: 6px;
    transition: all 0.2s;
}
.edit-btn:hover {
    color: var(--primary);
    background: var(--primary-light);
}

/* COMPACT STATUS DROPDOWN LOGIC */
.compact-status { width: auto; min-width: 110px; }
.compact-status .custom-select-trigger { padding: 4px 8px; font-size: 0.75rem; border-radius: 6px; border-width: 1px; }
.compact-status .custom-select-options { right: 0; left: auto; min-width: 160px; top: calc(100% + 4px); }
.card-body { display: flex; flex-direction: column; flex: 1; gap: 12px; min-width: 0; }
.card-details { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.card-phone { margin-top: auto; padding-top: 4px; }

/* Notes Styles */
.card-notes { margin-top: 0; }
.note-input {
    width: 100%;
    min-height: 44px;
    max-height: 120px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
    background: #f8fafc;
    color: var(--text-main);
    resize: vertical;
    transition: all 0.2s ease;
    line-height: 1.4;
}
.note-input:focus {
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
textarea.edit-input { resize: vertical; min-height: 80px; }
.highlight-pulse { animation: highlightAnim 2.5s ease-out; }
@keyframes highlightAnim {
    0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); border-color: var(--primary); }
    100% { box-shadow: 0 0 0 15px rgba(37, 99, 235, 0); border-color: var(--border); }
}
.contact-detail {
    color: #475569;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.contact-detail i { width: 14px; text-align: center; flex-shrink: 0; color: #94a3b8; }
.contact-detail a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s;
}
.contact-detail span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.contact-detail a:hover { color: var(--primary-hover); text-decoration: underline; }
.call-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: var(--primary-light);
    color: var(--primary);
    padding: 10px 14px;
    border-radius: 8px;
    text-decoration: none;
    border: 1px solid #bfdbfe;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.call-btn:hover { background: #dbeafe; border-color: #93c5fd; }
.call-btn.called { background: var(--success-bg); color: #059669; border-color: #a7f3d0; }
.call-btn.called:hover { background: #bbf7d0; }
.call-btn span { display: flex; align-items: center; gap: 8px; }
.call-btn.disabled-btn { background: var(--background); color: #94a3b8; border-color: var(--border); cursor: not-allowed; }
.call-btn.disabled-btn:hover { background: var(--background); border-color: var(--border); }
.multi-call-wrapper { width: 100%; }
.phone-dropdown {
    display: none;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
    padding-left: 12px;
    border-left: 2px solid var(--border);
    animation: fadeIn 0.2s ease-out;
}
.phone-dropdown.active { display: flex; }
.phone-dropdown .call-btn { padding: 10px 14px; font-size: 0.85rem; background: var(--card-bg); border-color: var(--border); color: var(--text-main); }
.phone-dropdown .call-btn:hover { background: var(--background); border-color: #cbd5e1; }
.edit-input { width: 100%; padding: 10px 14px; margin-bottom: 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 0.9rem; }
.save-btn {
    background: var(--header-bg);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 8px;
    width: 100%;
    font-weight: 600;
    transition: background 0.2s;
}
.save-btn:hover { background: var(--primary); }

/* --- MODAL STYLES (Generic) --- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease-out;
    padding: 16px;
}
.modal-overlay.active {
    display: flex;
}
.modal-content {
    background: var(--card-bg);
    padding: 32px;
    border-radius: 16px;
    width: 90%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255,255,255,0.1);
    position: relative;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.modal-header h2 {
    font-size: 1.3rem;
    color: var(--header-bg);
    font-weight: 700;
}
.close-modal {
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--text-muted);
    transition: color 0.2s;
    padding: 4px;
    position: absolute;
    top: 16px;
    right: 16px;
}
.close-modal:hover {
    color: var(--danger);
}
.export-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* --- NEW: Authentication Modal --- */
.auth-modal-content {
    max-width: 420px;
    padding: 24px;
}
.auth-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}
.auth-tab-btn {
    flex: 1;
    padding: 12px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-muted);
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}
.auth-tab-btn:hover {
    color: var(--text-main);
}
.auth-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.auth-form {
    display: none;
}
.auth-form.active {
    display: block;
    animation: fadeIn 0.3s ease;
}
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 6px;
}
.forgot-password {
    display: block;
    text-align: right;
    font-size: 0.85rem;
    color: var(--primary);
    text-decoration: none;
    margin-top: -8px;
    margin-bottom: 16px;
}
.forgot-password:hover {
    text-decoration: underline;
}
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    margin: 20px 0;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border);
}
.auth-divider:not(:empty)::before {
    margin-right: .5em;
}
.auth-divider:not(:empty)::after {
    margin-left: .5em;
}
.google-signin-container {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}
.form-error-message {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 4px;
}