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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

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

/* Header */
header {
    background: white;
    padding: 20px 30px;
    border-radius: 8px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header h1 {
    color: #2c3e50;
    font-size: 24px;
}

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

.badge {
    background: #3498db;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

/* Navigation */
.main-nav {
    background: white;
    padding: 15px 30px;
    border-radius: 8px;
    margin-bottom: 30px;
    display: flex;
    gap: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.main-nav a {
    color: #555;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.3s;
}

.main-nav a:hover,
.main-nav a.active {
    background: #3498db;
    color: white;
}

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

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.stat-card h3 {
    font-size: 36px;
    color: #3498db;
    margin-bottom: 5px;
}

.stat-card p {
    color: #777;
    font-size: 14px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background: #95a5a6;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn:hover {
    background: #7f8c8d;
}

.btn-primary {
    background: #3498db;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-success {
    background: #27ae60;
}

.btn-success:hover {
    background: #229954;
}

.btn-danger {
    background: #e74c3c;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Actions Cell - Vertical Buttons */
.actions-cell {
    white-space: normal;
    min-width: 80px;
}

.actions-cell .btn {
    display: block;
    width: 100%;
    margin-bottom: 5px;
    text-align: center;
}

.actions-cell .btn:last-child {
    margin-bottom: 0;
}

.actions-cell button {
    border: none;
    cursor: pointer;
    display: block;
    width: 100%;
}

/* Table */
.leads-section {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.leads-section h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

/* Table Responsive Wrapper */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
    border: 1px solid #ecf0f1;
    border-radius: 8px;
}

.leads-table {
    width: auto;
    min-width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.leads-table th,
.leads-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
    white-space: nowrap;
    overflow: visible;
}

.leads-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
}

.leads-table tr:hover {
    background: #f8f9fa;
}

/* Status badges */
.status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-new {
    background: #e3f2fd;
    color: #1976d2;
}

.status-contacted {
    background: #fff3e0;
    color: #f57c00;
}

.status-qualified {
    background: #f3e5f5;
    color: #7b1fa2;
}

.status-converted {
    background: #e8f5e9;
    color: #388e3c;
}

.status-lost {
    background: #ffebee;
    color: #d32f2f;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

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

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
}

.demo-credentials {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 12px;
}

.demo-credentials p {
    margin: 5px 0;
}

/* Modal */
/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(2px);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    animation: modalFadeIn 0.3s ease;
}

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

.close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: #000;
}

/* Lead Details */
.lead-details {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.lead-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.info-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
}

.info-item label {
    display: block;
    font-size: 12px;
    color: #777;
    margin-bottom: 5px;
}

.info-item .value {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

.notes-section {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.note-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 15px;
    border-left: 4px solid #3498db;
}

.note-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 12px;
    color: #777;
}

.note-text {
    color: #333;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
    padding: 20px;
}

.page-info {
    color: #555;
    font-size: 14px;
    font-weight: 600;
}

/* Filter Banner */
.filter-banner {
    background: #e3f2fd;
    padding: 15px 30px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-left: 4px solid #2196f3;
    color: #1565c0;
    font-size: 14px;
}

.filter-banner strong {
    color: #0d47a1;
    text-transform: capitalize;
}

.filter-count {
    margin-left: 10px;
    color: #1976d2;
}

/* Filters Section */
.filters-section {
    background: white;
    padding: 20px 30px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.filters-section h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 16px;
}

.filters-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 5px;
}

.filter-group select,
.filter-group input[type="date"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.filter-group button,
.filter-group a {
    margin-right: 10px;
}

/* Performance Dashboard */
.performance-section {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.performance-section h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.performance-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.performance-table th,
.performance-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

.performance-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
}

.performance-table tr:hover {
    background: #f8f9fa;
}

.rank-cell {
    text-align: center;
}

.rank-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    background: #ecf0f1;
    color: #555;
}

.rank-badge.rank-1 {
    background: #ffd700;
    color: #000;
}

.rank-badge.rank-2 {
    background: #c0c0c0;
    color: #000;
}

.rank-badge.rank-3 {
    background: #cd7f32;
    color: #fff;
}

.converted-cell {
    font-weight: 700;
    color: #27ae60;
}

.conversion-rate {
    position: relative;
    background: #ecf0f1;
    border-radius: 4px;
    height: 28px;
    min-width: 120px;
}

.rate-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #27ae60 0%, #2ecc71 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.rate-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 700;
    color: #000;
    font-size: 13px;
    z-index: 1;
}

.performance-summary {
    margin-top: 40px;
}

.performance-summary h3 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.summary-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.summary-card h4 {
    font-size: 36px;
    margin: 0 0 10px 0;
}

.summary-card p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
}

/* Responsive */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 15px;
    }
    
    .main-nav {
        flex-direction: column;
        gap: 10px;
    }
    
    .leads-table {
        font-size: 12px;
    }
    
    .leads-table th,
    .leads-table td {
        padding: 8px;
    }
}

/* Reminders Section */
.add-reminder-form .form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.add-reminder-form .form-row .form-group {
    margin-bottom: 0;
}

.reminders-list {
    margin-top: 20px;
}

.reminder-item {
    background: #f8f9fa;
    border-left: 4px solid #3498db;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 4px;
    transition: all 0.3s;
}

.reminder-item.reminder-completed {
    opacity: 0.7;
    border-left-color: #95a5a6;
    background: #ecf0f1;
}

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

.reminder-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.reminder-header strong {
    font-size: 16px;
    color: #2c3e50;
}

.reminder-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 10px;
    vertical-align: middle;
}

.reminder-badge.completed {
    background: #27ae60;
    color: white;
}

.reminder-badge.overdue {
    background: #e74c3c;
    color: white;
    animation: pulse 2s infinite;
}

.reminder-badge.today {
    background: #f39c12;
    color: white;
}

.reminder-badge.upcoming {
    background: #3498db;
    color: white;
}

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

.reminder-actions {
    display: flex;
    gap: 5px;
}

.reminder-actions .btn {
    white-space: nowrap;
}

.reminder-details {
    color: #555;
    font-size: 14px;
}

.reminder-datetime {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: 500;
}

.reminder-description {
    margin: 10px 0;
    padding: 10px;
    background: white;
    border-radius: 4px;
    font-size: 13px;
}

.reminder-meta {
    display: block;
    margin-top: 8px;
    color: #95a5a6;
    font-size: 12px;
}

/* Reminder Count Badge */
.reminder-count-badge {
    background: #e74c3c;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    margin-left: 5px;
    vertical-align: super;
    animation: pulse 2s infinite;
}
