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

/* Light Theme (Default) */
:root {
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --secondary-color: #6b7280;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --logo-filter: none;
}

/* Dark Theme */
[data-theme="dark"] {
    --primary-color: #60a5fa;
    --primary-dark: #3b82f6;
    --secondary-color: #9ca3af;
    --success-color: #34d399;
    --warning-color: #fbbf24;
    --danger-color: #f87171;
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --logo-filter: brightness(1.2) contrast(1.1);
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 0;
    margin-bottom: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 24px;
    flex-wrap: wrap;
    gap: 16px;
}

/* Supporto per la nuova struttura unificata */
.header-container .app-info {
    display: flex;
    align-items: center;
}

.header-container .header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-container .header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Header Brand */
.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.logo i {
    font-size: 24px;
    color: white;
}

.brand-text h1 {
    font-size: 24px;
    margin: 0;
    font-weight: 700;
    line-height: 1.2;
}

.brand-text .tagline {
    font-size: 15px;
    margin: 0;
    opacity: 1;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
}

/* Header Navigation */
.header-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.nav-item i {
    font-size: 16px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: white;
}

.nav-item.primary {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-weight: 600;
}

.nav-item.primary:hover {
    background: rgba(255, 255, 255, 0.3);
}

.theme-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    margin-left: 8px;
}

.theme-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.theme-btn i {
    font-size: 16px;
    position: absolute;
    transition: all 0.3s ease;
}

.theme-icon-dark {
    opacity: 1;
}

.theme-icon-light {
    opacity: 0;
    transform: rotate(180deg);
}

[data-theme="dark"] .theme-icon-dark {
    opacity: 0;
    transform: rotate(-180deg);
}

[data-theme="dark"] .theme-icon-light {
    opacity: 1;
    transform: rotate(0deg);
}

.app-info h1 {
    color: var(--primary-color);
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.app-info h1 i {
    margin-right: 12px;
    color: var(--primary-color);
}

.tagline {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
    font-weight: 400;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* Gruppi logici nel header */
.nav-group, .action-group, .settings-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.nav-group {
    display: flex;
    gap: 8px;
    align-items: center;
    padding-right: 15px;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.action-group {
    margin-left: auto; /* Spinge il pulsante principale verso destra */
    padding-right: 15px;
}

.settings-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Separatori nel tema chiaro */
[data-theme="light"] .nav-group {
    border-right-color: rgba(0, 0, 0, 0.1);
}

/* Theme Toggle Button */
.btn-theme-toggle {
    position: relative;
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: var(--card-bg);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 18px;
}

.btn-theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: var(--primary-color);
}

.btn-theme-toggle:active {
    transform: translateY(0);
}

/* Theme Icons */
.theme-icon-dark,
.theme-icon-light {
    position: absolute;
    transition: all 0.3s ease;
}

[data-theme="dark"] .theme-icon-dark {
    opacity: 0;
    transform: rotate(180deg);
}

[data-theme="dark"] .theme-icon-light {
    opacity: 1;
    transform: rotate(0deg);
}

.theme-icon-dark {
    opacity: 1;
    transform: rotate(0deg);
}

.theme-icon-light {
    opacity: 0;
    transform: rotate(-180deg);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

/* Pulsanti di navigazione */
.btn-nav {
    background: var(--secondary-color);
    border: 1px solid transparent;
    color: white;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-nav i {
    font-size: 20px;
    margin-right: 8px;
}

.btn-nav:hover {
    background: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: white;
}

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

.btn-nav.primary {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    font-weight: 600;
}

.btn-nav.primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-2px);
}

/* Pulsanti controlli mappa */
.btn-map-control {
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
}

.btn-map-control i {
    font-size: 22px;
    margin-right: 8px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

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

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #4b5563;
}

.btn-icon {
    padding: 8px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    color: var(--text-secondary);
}

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

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

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Stili per card cliccabili */
.clickable-card {
    cursor: pointer;
    user-select: none;
}

.clickable-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.clickable-card:active {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

/* Freccia indicatore */
.card-arrow {
    margin-left: auto;
    color: var(--text-secondary);
    font-size: 14px;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.clickable-card:hover .card-arrow {
    opacity: 1;
    transform: translateX(4px);
    color: var(--text-primary);
}

/* Effetto ripple al click */
.clickable-card::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.clickable-card:active::before {
    width: 300px;
    height: 300px;
}

/* Indicatore filtro attivo */
.stat-card.active-filter {
    border: 2px solid var(--primary-color);
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(59, 130, 246, 0.05) 100%);
}

.stat-card.active-filter .stat-icon {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    transform: scale(1.05);
}

.stat-card.active-filter .card-arrow {
    color: var(--primary-color);
    opacity: 1;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    background-color: var(--primary-color);
}

.status-da-contattare .stat-icon {
    background-color: var(--warning-color);
}

.status-contattato .stat-icon {
    background-color: var(--success-color);
}

.status-non-interessato .stat-icon {
    background-color: var(--danger-color);
}

.stat-info h3 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-info p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Controls */
.controls {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.search-container {
    position: relative;
    margin-bottom: 20px;
}

.search-container i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

#searchInput {
    width: 100%;
    padding: 12px 16px 12px 48px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
}

#searchInput:focus {
    outline: none;
    border-color: var(--primary-color);
}

.filter-section {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
}

.order-section {
    flex: 1;
    display: flex;
    gap: 10px;
    align-items: center;
}

.order-select {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    font-size: 16px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.order-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-export-csv {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-export-csv:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-export-csv i {
    font-size: 16px;
}

.filter-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.region-filter {
    display: flex;
    align-items: center;
}

.region-filter select {
    padding: 8px 16px;
    border: 2px solid var(--border-color);
    border-radius: 20px;
    background: var(--card-bg);
    color: var(--text-color);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

.region-filter select:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.15);
}

.region-filter select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

/* Dark mode support for select */
[data-theme="dark"] .region-filter select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%9ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
}

.phone-type {
    font-weight: 500;
    color: var(--text-secondary);
    margin-right: 8px;
}

.provincia {
    color: var(--text-secondary);
    font-style: italic;
    margin-left: 4px;
}

.filter-tab {
    padding: 8px 16px;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
}

.filter-tab:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

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

/* Contacts Section */
.contacts-section {
    scroll-margin-top: 100px; /* Per offset quando si scrolla con anchor */
    transition: background-color 0.5s ease;
}

/* Companies List */
.companies-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.company-card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all 0.2s;
}

.company-card:hover {
    box-shadow: var(--shadow-lg);
}

.company-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid var(--border-color);
}

.company-header:hover {
    background-color: var(--bg-color);
}

.company-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.company-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
}

.company-main-info {
    flex: 1;
    min-width: 0;
}

.company-main-info h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.company-contacts-count {
    color: var(--text-secondary);
    font-size: 14px;
}

.company-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.urgent-badge {
    background: var(--danger-color);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.company-chevron {
    color: var(--text-secondary);
    transition: transform 0.3s ease;
    font-size: 14px;
}

.company-card.expanded .company-chevron {
    transform: rotate(180deg);
}

.company-contacts {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 20px;
}

.company-card.expanded .company-contacts {
    max-height: 10000px;
    padding: 20px;
}

/* Contacts Grid */
.contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.contact-card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: all 0.2s;
    overflow: hidden;
}

.contact-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.contact-header {
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.contact-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}

.contact-main-info {
    flex: 1;
    min-width: 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.contact-main-info h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
    text-align: center;
}

.contact-company {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
    text-align: center;
    font-size: 15px;
}

.contact-position {
    color: var(--text-secondary);
    font-size: 13px;
    text-align: center;
    font-style: italic;
}

/* Contact Icons in header */
.contact-icons {
    position: absolute;
    top: 16px;
    right: 60px;
    display: flex;
    gap: 8px;
}

.contact-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
    cursor: help;
}

.email-icon {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
}

.phone-icon {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.linkedin-icon {
    background-color: rgba(0, 119, 181, 0.1);
    color: #0077b5;
}

.website-icon {
    background-color: rgba(255, 107, 53, 0.1);
    color: #ff6b35;
}

.contact-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.contact-actions {
    display: flex;
    gap: 4px;
}

.contact-details {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Sezione Contatti */
.contact-section {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
}

.contact-row {
    margin-bottom: 12px;
}

.contact-info-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.contact-info-item i {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 16px;
}

.contact-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    cursor: default;
    user-select: text;
}

.contact-link:hover {
    color: var(--text-color);
    text-decoration: none;
}

/* Pulsante copia email */
.btn-copy-email {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    margin-left: auto;
}

.btn-copy-email:hover {
    background: var(--bg-hover);
    color: var(--primary-color);
}

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

/* Social Links */
.social-links {
    gap: 16px;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.linkedin-link {
    color: #0077b5;
    background-color: rgba(0, 119, 181, 0.1);
    border-color: rgba(0, 119, 181, 0.2);
}

.linkedin-link:hover {
    background-color: rgba(0, 119, 181, 0.15);
    border-color: rgba(0, 119, 181, 0.3);
    transform: translateY(-1px);
    text-decoration: none;
}

.website-link {
    color: #ff6b35;
    background-color: rgba(255, 107, 53, 0.1);
    border-color: rgba(255, 107, 53, 0.2);
}

.website-link:hover {
    background-color: rgba(255, 107, 53, 0.15);
    border-color: rgba(255, 107, 53, 0.3);
    transform: translateY(-1px);
    text-decoration: none;
}

/* Sezione Azioni Rapide */
.quick-actions-section {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
}

.quick-actions-section h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.btn-phone-action {
    padding: 12px;
    border: none;
    background: var(--bg-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
    font-size: 14px;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
    text-align: center;
    text-decoration: none;
}

.btn-phone-action i {
    font-size: 20px;
}

.btn-phone-action span {
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
}

.btn-phone-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Colori di base per identificazione immediata */
.btn-phone-action[onclick*="addToPhoneBook"] {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
}

.btn-phone-action[onclick*="callContact"] {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.btn-phone-action[onclick*="sendSMS"] {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.btn-phone-action[onclick*="openWhatsApp"] {
    background-color: rgba(37, 211, 102, 0.1);
    color: #25d366;
}

.btn-phone-action[onclick*="sendEmail"] {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
}

/* Stati hover più intensi */
.btn-phone-action[onclick*="addToPhoneBook"]:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-phone-action[onclick*="callContact"]:hover {
    background-color: var(--success-color);
    color: white;
}

.btn-phone-action[onclick*="sendSMS"]:hover {
    background-color: var(--warning-color);
    color: white;
}

.btn-phone-action[onclick*="openWhatsApp"]:hover {
    background-color: #25d366;
    color: white;
}

.btn-phone-action[onclick*="sendEmail"]:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Pulsanti disabilitati */
.btn-phone-action.disabled,
.btn-phone-action:disabled {
    background: var(--border-color) !important;
    color: var(--text-secondary) !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

.btn-phone-action.disabled:hover,
.btn-phone-action:disabled:hover {
    background: var(--border-color) !important;
    color: var(--text-secondary) !important;
    transform: none !important;
    box-shadow: none !important;
    opacity: 0.6;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .filter-section {
        flex-direction: column;
        gap: 12px;
    }
    
    .order-section {
        width: 100%;
        margin-left: 0 !important;
        flex-direction: column;
        align-items: stretch;
    }
    
    .order-select {
        width: 100%;
        padding: 12px 16px;
        font-size: 16px;
    }
    
    .btn-export-csv {
        width: 100%;
        justify-content: center;
    }
    
    .contact-details {
        gap: 16px;
        padding: 16px;
    }
    
    .quick-actions-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    
    .btn-phone-action {
        min-height: 70px;
        padding: 10px;
    }
    
    .btn-phone-action i {
        font-size: 18px;
    }
    
    .btn-phone-action span {
        font-size: 10px;
    }
    
    .status-notes-section {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    
    .status-container {
        order: 1;
    }
    
    .notes-container {
        order: 2;
    }
}

@media (max-width: 480px) {
    .filter-section {
        flex-direction: column;
        gap: 12px;
    }
    
    .order-section {
        width: 100%;
        margin-left: 0 !important;
    }
    
    .order-select {
        width: 100%;
        padding: 12px 16px;
        font-size: 16px;
    }
    
    .contact-details {
        gap: 12px;
        padding: 12px;
    }
    
    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .btn-phone-action {
        min-height: 80px;
        padding: 12px 8px;
        border-radius: 12px;
    }
    
    .btn-phone-action i {
        font-size: 24px;
    }
    
    .btn-phone-action span {
        font-size: 11px;
        font-weight: 600;
    }
    
    /* Aggiunge feedback tattile più evidente */
    .btn-phone-action:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    }
    
    .btn-phone-action:active {
        transform: translateY(1px);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    }
    
    .status-notes-section {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }
    
    .status-container {
        order: 1;
    }
    
    .notes-container {
        order: 2;
    }
    
    .notes-textarea {
        min-height: 100px;
    }
}

/* Sezione Stato e Note */
.status-notes-section {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 16px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
}

/* Su mobile, imposta sempre colonna singola e ordine verticale */
@media (max-width: 768px) {
    .status-notes-section {
        display: flex;
        flex-direction: column;
        grid-template-columns: 1fr;
    }
    
    .status-container {
        order: 1;
    }
    
    .notes-container {
        order: 2;
    }
}

.status-container,
.notes-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.status-container label,
.notes-container label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.status-select {
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    font-size: 14px;
    font-weight: 500;
    transition: border-color 0.2s ease;
    cursor: pointer;
}

.status-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.notes-textarea {
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
    font-size: 14px;
    background: var(--card-bg);
    transition: border-color 0.2s ease;
}

.notes-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.notes-textarea::placeholder {
    color: var(--text-secondary);
    font-style: italic;
}

/* Note List */
.notes-list {
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
    padding: 8px;
    background: var(--bg-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.no-notes {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 20px;
    font-size: 14px;
}

.note-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    transition: box-shadow 0.2s ease;
}

.note-item:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.note-author {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-color);
}

.note-date {
    font-size: 11px;
    color: var(--text-secondary);
}

.note-content {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.add-note-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.new-note-textarea {
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    resize: vertical;
    min-height: 60px;
    font-family: inherit;
    font-size: 14px;
    background: var(--card-bg);
    transition: border-color 0.2s ease;
    width: 100%;
}

.new-note-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.new-note-textarea::placeholder {
    color: var(--text-secondary);
    font-style: italic;
}

.btn-add-note {
    align-self: flex-end;
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-add-note:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-add-note:active {
    transform: translateY(0);
}

/* Meta Info */
.meta-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 12px;
}

.meta-item i {
    width: 14px;
    font-size: 11px;
    opacity: 0.7;
}

.meta-item span {
    line-height: 1.3;
}

.urgent-indicator {
    color: var(--danger-color) !important;
    font-weight: 600;
}

.urgent-indicator i {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* TODO Section */
.todo-section {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
}

.todo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.todo-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-add-task {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
}

.btn-add-task:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.task-item {
    background: var(--bg-color);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.task-item[data-priority="urgente"] {
    border-left-color: #dc2626;
    background: rgba(220, 38, 38, 0.05);
}

.task-item[data-priority="alta"] {
    border-left-color: var(--danger-color);
    background: rgba(239, 68, 68, 0.05);
}

.task-item[data-priority="media"] {
    border-left-color: var(--warning-color);
    background: rgba(245, 158, 11, 0.05);
}

.task-item[data-priority="bassa"] {
    border-left-color: var(--success-color);
    background: rgba(16, 185, 129, 0.05);
}

.task-item[data-status="completato"] {
    opacity: 0.6;
    text-decoration: line-through;
}

.task-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

.task-title {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.3;
    flex: 1;
}

.task-priority {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.priority-urgente {
    background: #dc2626;
    color: white;
}

.priority-alta {
    background: var(--danger-color);
    color: white;
}

.priority-media {
    background: var(--warning-color);
    color: white;
}

.priority-bassa {
    background: var(--success-color);
    color: white;
}

.task-user {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

.task-user i {
    font-size: 11px;
    opacity: 0.7;
}

.task-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
}

.task-date {
    display: flex;
    align-items: center;
    gap: 4px;
}

.task-type {
    background: var(--border-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    text-transform: capitalize;
}

.task-actions {
    display: flex;
    gap: 4px;
}

.btn-task-toggle,
.btn-task-calendar {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    transition: all 0.2s ease;
}

.btn-task-toggle {
    background: var(--success-color);
}

.btn-task-calendar {
    background: var(--primary-color);
}

.btn-task-toggle:hover,
.btn-task-calendar:hover {
    transform: scale(1.1);
}

.btn-task-calendar:hover {
    background: var(--primary-dark);
}

.task-item[data-status="completato"] .btn-task-toggle {
    background: var(--secondary-color);
}

.tasks-more {
    text-align: center;
    margin-top: 8px;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
    padding: 4px 0;
}

.btn-link:hover {
    color: var(--primary-dark);
}

.no-tasks {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
}

.no-tasks p {
    margin-bottom: 8px;
    font-size: 14px;
}

.no-tasks .btn-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Status indicators */
.contact-card[data-status="da_contattare"] {
    border-left: 4px solid var(--warning-color);
}

.contact-card[data-status="contattato"] {
    border-left: 4px solid var(--success-color);
}

.contact-card[data-status="non_interessato"] {
    border-left: 4px solid var(--danger-color);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.empty-state i {
    font-size: 64px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 24px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--card-bg);
    margin: 2% auto;
    border-radius: 12px;
    width: 95%;
    max-width: 600px;
    max-height: 95vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    position: relative;
}

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

.modal-header h2 {
    font-size: 24px;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
    border-radius: 4px;
}

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

/* Form Styles */
#contactForm,
#taskForm {
    padding: 24px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

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

/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Success/Error messages */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-weight: 500;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .container {
        padding: 12px;
    }
    
    .header-container {
        flex-direction: column;
        text-align: center;
        gap: 16px;
        padding: 20px 16px;
    }
    
    .header-container .app-info {
        flex-direction: column;
        text-align: center;
    }
    
    .header-container .header-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .header-brand {
        justify-content: center;
    }
    
    .header-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
    }
    
    .nav-item {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .nav-item i {
        font-size: 14px;
    }
    
    .theme-btn {
        width: 36px;
        height: 36px;
        margin-left: 0;
    }
    
    .header-actions {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        width: 100%;
    }
    
    .nav-group, .settings-group {
        gap: 6px;
        border: none;
        padding-right: 0;
    }
    
    .action-group {
        padding-right: 0;
        margin-left: 0;
        order: -1; /* Il pulsante "Nuovo" va prima su mobile */
    }
    
    .btn {
        font-size: 11px;
        padding: 6px 8px;
        flex: 1;
        min-width: 70px;
        max-width: 100px;
        text-align: center;
    }
    
    .btn i {
        margin-right: 3px;
    }
    
    .btn-nav i {
        font-size: 18px;
        margin-right: 6px;
    }
    
    .btn-map-control {
        padding: 12px 18px;
        font-size: 15px;
    }
    
    .btn-map-control i {
        font-size: 20px;
        margin-right: 6px;
    }
    
    .btn-theme-toggle {
        flex: 0 0 auto;
        min-width: 35px;
        max-width: 35px;
        padding: 6px;
    }
    
    .app-info h1 {
        font-size: 24px;
    }
    
    .tagline {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .header-container {
        padding: 16px 12px;
        gap: 12px;
    }
    
    .brand-text h1 {
        font-size: 20px;
    }
    
    .brand-text .tagline {
        font-size: 14px;
    }
    
    .header-nav {
        gap: 4px;
    }
    
    .nav-item {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .nav-item span {
        display: none;
    }
    
    .nav-item i {
        font-size: 16px;
    }
    
    .theme-btn {
        width: 32px;
        height: 32px;
    }
    
    .btn {
        font-size: 10px;
        padding: 5px 6px;
        min-width: 40px;
        max-width: 50px;
    }
    
    .btn .btn-text {
        display: none;
    }
    
    .btn i {
        margin-right: 0;
        font-size: 14px;
    }
    
    .btn-nav i {
        font-size: 20px;
    }
    
    .btn-map-control i {
        font-size: 24px;
    }
    
    .btn-theme-toggle {
        min-width: 30px;
        max-width: 30px;
        padding: 5px;
    }
    
    .app-info h1 {
        font-size: 20px;
    }
    
    .tagline {
        font-size: 11px;
    }
}
    
    .btn-theme-toggle {
        width: 45px;
        height: 45px;
        font-size: 16px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .stat-card {
        padding: 16px;
        flex-direction: column;
        text-align: center;
    }
    
    .clickable-card:hover {
        transform: translateY(-2px);
    }
    
    .clickable-card:active {
        transform: scale(0.98);
    }
    
    .card-arrow {
        margin-top: 8px;
        margin-left: 0;
    }
    
    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    
    .companies-list {
        gap: 12px;
    }
    
    .company-header {
        padding: 16px;
    }
    
    .company-avatar {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .company-main-info h3 {
        font-size: 16px;
    }
    
    .company-contacts {
        padding: 0 16px !important;
    }
    
    .company-card.expanded .company-contacts {
        padding: 16px !important;
    }
    
    .contacts-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .contact-header {
        padding: 16px;
    }
    
    .contact-details {
        padding: 16px;
    }
    
    .contact-icons {
        right: 50px;
        top: 16px;
        gap: 6px;
    }
    
    .contact-icon {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .contact-avatar {
        width: 50px;
        height: 50px;
        font-size: 16px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 10px auto;
        width: calc(100% - 20px);
        max-width: none;
        max-height: calc(100vh - 20px);
        border-radius: 8px;
        overflow-x: visible;
        box-sizing: border-box;
    }
    
    .modal-header {
        padding: 16px;
    }
    
    #contactForm,
    #taskForm {
        padding: 16px;
        overflow-x: visible;
        box-sizing: border-box;
    }
    
    .modal-actions {
        flex-direction: column;
        gap: 12px;
        position: sticky;
        bottom: 0;
        background: var(--card-bg);
        padding: 16px;
        margin-top: 24px;
        border-top: 1px solid var(--border-color);
        width: 100%;
        box-sizing: border-box;
    }
    
    .modal-actions .btn {
        width: 100%;
        padding: 16px 24px;
        font-size: 16px;
        font-weight: 600;
        justify-content: center;
        min-height: 52px;
        text-align: center;
        display: flex;
        align-items: center;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        white-space: normal;
        word-wrap: break-word;
        overflow: visible;
        box-sizing: border-box;
        max-width: 100%;
    }
    
    .modal-actions .btn i {
        margin-right: 8px;
        flex-shrink: 0;
    }
    
    .modal-actions .btn span {
        white-space: normal;
        overflow: visible;
        word-wrap: break-word;
        text-overflow: clip;
        display: inline-block;
        max-width: 100%;
    }
    
    .filter-tabs {
        justify-content: center;
    }
    
    .filter-tab {
        flex: 1;
        text-align: center;
        min-width: 80px;
    }
    
    .filter-section {
        gap: 10px;
    }
    
    .region-filter select {
        min-width: 100%;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-header {
        flex-direction: column;
        text-align: center;
        gap: 12px;
        align-items: center;
    }
    
    .contact-main-info {
        align-items: center;
        text-align: center;
    }
    
    .contact-actions {
        align-self: center;
    }
    
    .contact-icons {
        position: relative;
        top: auto;
        right: auto;
        align-self: center;
        margin-top: 8px;
    }
    
    .app-info h1 {
        font-size: 20px;
    }
    
    .tagline {
        font-size: 12px;
    }
    
    .btn-theme-toggle {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .modal-content {
        margin: 5px auto;
        width: calc(100% - 10px);
        max-height: calc(100vh - 10px);
        border-radius: 6px;
        overflow-x: visible;
        box-sizing: border-box;
    }
    
    .modal-header {
        padding: 12px;
    }
    
    .modal-header h2 {
        font-size: 18px;
    }
    
    #contactForm,
    #taskForm {
        padding: 12px;
        overflow-x: visible;
        box-sizing: border-box;
    }
    
    .form-group {
        margin-bottom: 12px;
    }
    
    .modal-actions {
        margin-top: 16px;
        gap: 10px;
        padding: 12px;
        border-top: 1px solid var(--border-color);
        width: 100%;
        position: sticky;
        bottom: 0;
        background: var(--card-bg);
        box-sizing: border-box;
    }
    
    .modal-actions .btn {
        width: 100%;
        padding: 16px 24px;
        font-size: 16px;
        font-weight: 600;
        justify-content: center;
        min-height: 52px;
        text-align: center;
        display: flex;
        align-items: center;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        white-space: normal;
        word-wrap: break-word;
        overflow: visible;
        box-sizing: border-box;
        max-width: 100%;
    }
    
    .modal-actions .btn i {
        margin-right: 8px;
        flex-shrink: 0;
    }
    
    .modal-actions .btn span {
        white-space: normal;
        overflow: visible;
        word-wrap: break-word;
        text-overflow: clip;
        display: inline-block;
        max-width: 100%;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #0f172a;
        --card-bg: #1e293b;
        --text-primary: #f1f5f9;
        --text-secondary: #94a3b8;
        --border-color: #334155;
    }
}

/* Print styles */
@media print {
    .header,
    .controls,
    .modal,
    .contact-actions,
    .btn {
        display: none !important;
    }
    
    .contact-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
