/* ===== LOGIN PAGE STYLES ===== */

.login-section {
    min-height: calc(100vh - 80px);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 60px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.login-card {
    background: white;
    border-radius: 16px;
    padding: 48px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.login-header p {
    font-size: 16px;
    color: var(--text-light);
}

.login-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-bottom: 32px;
}

.btn-google {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background: white;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    color: #3c4043;
    cursor: pointer;
    transition: all 0.2s;
    width: 350px;
    justify-content: center;
}

.btn-google:hover {
    background: #f8f9fa;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.login-footer {
    padding-top: 32px;
    border-top: 1px solid var(--border-color);
}

.login-footer h3 {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--text-dark);
}

.login-footer ul {
    list-style: none;
    margin-bottom: 20px;
}

.login-footer li {
    padding: 8px 0;
    color: var(--text-light);
    font-size: 14px;
}

.privacy-note {
    background: var(--bg-light);
    padding: 16px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.6;
}

.login-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 24px;
    color: white;
}

.info-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.info-card h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.info-card p {
    font-size: 14px;
    line-height: 1.6;
    opacity: 0.9;
}

/* ===== WEB APP LAYOUT ===== */

.app-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: calc(100vh - 80px);
    background: var(--bg-light);
}

.app-sidebar {
    background: white;
    border-right: 1px solid var(--border-color);
    padding: 24px 0;
}

.app-sidebar-header {
    padding: 0 24px 24px;
    border-bottom: 1px solid var(--border-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.user-details h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.user-details p {
    font-size: 12px;
    color: var(--text-light);
}

.app-nav {
    margin-top: 24px;
}

.app-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
}

.app-nav-item:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.app-nav-item.active {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    border-left: 3px solid var(--primary-color);
}

.app-nav-item-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.app-main {
    padding: 32px;
    overflow-y: auto;
}

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

.app-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
}

.app-header-actions {
    display: flex;
    gap: 12px;
}

.btn-app {
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

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

.btn-app-secondary {
    background: white;
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.btn-app-secondary:hover {
    background: var(--bg-light);
}

/* ===== CRM TABLE ===== */

.crm-table-container {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

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

.crm-search {
    display: flex;
    gap: 12px;
    flex: 1;
    max-width: 500px;
}

.search-input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
}

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

.crm-table {
    width: 100%;
    border-collapse: collapse;
}

.crm-table thead {
    background: var(--bg-light);
}

.crm-table th {
    text-align: left;
    padding: 12px 24px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.crm-table td {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-dark);
}

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

.client-name {
    font-weight: 600;
    color: var(--text-dark);
}

.client-email {
    color: var(--text-light);
    font-size: 13px;
}

.table-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    padding: 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 16px;
}

.btn-icon:hover {
    background: var(--bg-light);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.empty-state p {
    font-size: 14px;
}

/* ===== MODAL ===== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 32px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

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

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

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
}

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

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
}

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

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

/* ===== RESPONSIVE ===== */

@media (max-width: 968px) {
    .login-container {
        grid-template-columns: 1fr;
    }
    
    .login-info {
        display: none;
    }
    
    .app-container {
        grid-template-columns: 1fr;
    }
    
    .app-sidebar {
        display: none;
    }
}

@media (max-width: 640px) {
    .login-card {
        padding: 32px 24px;
    }
    
    .btn-google {
        width: 100%;
    }
    
    .app-main {
        padding: 20px;
    }
    
    .crm-table-header {
        flex-direction: column;
        gap: 16px;
    }
    
    .crm-search {
        max-width: 100%;
    }
    
    .crm-table {
        font-size: 13px;
    }
    
    .crm-table th,
    .crm-table td {
        padding: 12px 16px;
    }
}

/* ===== LOADING STATE ===== */

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-light);
}

.spinner {
    border: 3px solid var(--bg-light);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

/* ===== TOAST NOTIFICATIONS ===== */

#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    background: white;
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    pointer-events: auto;
    animation: slideIn 0.3s ease-out;
}

.toast.hiding {
    animation: slideOut 0.3s ease-out forwards;
}

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

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.toast-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-message {
    font-weight: 500;
    color: var(--text-dark);
    margin: 0;
}

.toast.success {
    border-left: 4px solid #4caf50;
}

.toast.success .toast-icon {
    color: #4caf50;
}

.toast.error {
    border-left: 4px solid #f44336;
}

.toast.error .toast-icon {
    color: #f44336;
}

.toast.info {
    border-left: 4px solid #2196f3;
}

.toast.info .toast-icon {
    color: #2196f3;
}

.toast.warning {
    border-left: 4px solid #ff9800;
}

.toast.warning .toast-icon {
    color: #ff9800;
}

@media (max-width: 768px) {
    #toast-container {
        bottom: 16px;
        right: 16px;
        left: 16px;
    }
    
    .toast {
        min-width: unset;
        max-width: unset;
    }
}

/* ===== CLIENT DETAIL MODAL ===== */

.modal-fullscreen {
    max-width: 900px;
    max-height: 90vh;
    width: 90%;
    overflow-y: auto;
}

.detail-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.detail-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-color);
}

.detail-section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 500;
    color: var(--text-light);
    font-size: 14px;
}

.detail-value {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 15px;
}

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

/* ===== CUSTOM FIELDS COMPONENTS ===== */

.custom-field {
    margin-bottom: 20px;
}

.custom-field-label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-dark);
}

/* Slider Field */
.slider-field {
    width: 100%;
}

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

.slider-value {
    padding: 4px 12px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
}

.slider-input {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
    background: linear-gradient(to right, #4caf50 0%, #f44336 100%);
}

.slider-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 3px solid currentColor;
}

.slider-input::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 3px solid currentColor;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    font-size: 12px;
}

/* Multi Value Field */
.multi-value-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.multi-value-item {
    display: flex;
    gap: 8px;
    align-items: center;
}

.multi-value-item input {
    flex: 1;
}

.multi-value-item button {
    padding: 8px 12px;
    background: var(--error-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.multi-value-add {
    width: 100%;
    padding: 10px;
    background: var(--bg-light);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    color: var(--primary-color);
    cursor: pointer;
    font-weight: 500;
}

.multi-value-add:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Checkbox Field */
.checkbox-field {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-light);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.checkbox-field:hover {
    background: var(--primary-color-light);
}

.checkbox-field.checked {
    background: var(--primary-color-light);
}

.checkbox-field input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.checkbox-field label {
    flex: 1;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    margin: 0;
}

/* Custom Field Display (readonly) */
.custom-field-display {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.custom-field-display:last-child {
    border-bottom: none;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-bar-fill {
    height: 100%;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.multi-value-list {
    list-style: none;
    padding: 0;
    margin: 8px 0 0 0;
}

.multi-value-list li {
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.multi-value-list li::before {
    content: "•";
    color: var(--primary-color);
    font-weight: bold;
}
