/* Client Renewal Manager - Custom Styles */
:root {
    --primary: #2c3e50;
    --secondary: #34495e;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --info: #3498db;
    --light: #ecf0f1;
}

body {
    background-color: #f8f9fa;
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

.sidebar {
    min-height: 100vh;
    background: var(--primary);
    color: #fff;
    position: fixed;
    width: 260px;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: all 0.3s;
    overflow-y: auto;
}

.sidebar .brand {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

.sidebar .brand h4 {
    margin: 0;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.sidebar .nav-link {
    color: rgba(255,255,255,0.8);
    padding: 12px 20px;
    border-radius: 0;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar .nav-link:hover, .sidebar .nav-link.active {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border-left: 4px solid var(--success);
}

.main-content {
    margin-left: 260px;
    padding: 20px;
    min-height: 100vh;
}

.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.stat-card {
    border-left: 4px solid;
}

.stat-card.primary { border-left-color: var(--primary); }
.stat-card.success { border-left-color: var(--success); }
.stat-card.warning { border-left-color: var(--warning); }
.stat-card.danger { border-left-color: var(--danger); }
.stat-card.info { border-left-color: var(--info); }

.badge-status {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.renewal-card {
    border-radius: 10px;
    border: 1px solid #e9ecef;
    transition: all 0.2s;
}

.renewal-card:hover {
    border-color: var(--primary);
}

.days-badge {
    font-size: 0.9rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 20px;
}

.table th {
    font-weight: 600;
    color: var(--secondary);
    border-top: none;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 6px 16px;
}

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

.btn-primary:hover {
    background: var(--secondary);
    border-color: var(--secondary);
}

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.invoice-preview {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.action-btn-group .btn {
    margin: 2px;
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        min-height: auto;
    }
    .sidebar .nav {
        flex-direction: row;
        overflow-x: auto;
        flex-wrap: nowrap;
    }
    .sidebar .nav-link {
        white-space: nowrap;
    }
    .main-content {
        margin-left: 0;
    }
}

/* WhatsApp button */
.btn-whatsapp {
    background: #25D366;
    border-color: #25D366;
    color: #fff;
}
.btn-whatsapp:hover {
    background: #128C7E;
    border-color: #128C7E;
    color: #fff;
}

/* Communication timeline */
.timeline {
    position: relative;
    padding-left: 30px;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e9ecef;
}
.timeline-item {
    position: relative;
    margin-bottom: 20px;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -26px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
}
.status-dot.green { background: var(--success); }
.status-dot.yellow { background: var(--warning); }
.status-dot.orange { background: #e67e22; }
.status-dot.red { background: var(--danger); }
.status-dot.grey { background: #95a5a6; }

/* FIX for modal shaking/blinking - was caused by multiple modals inside tbody */
.modal {
    overflow-y: auto;
}
body.modal-open {
    overflow: hidden;
    padding-right: 0 !important;
}
.modal-backdrop {
    opacity: 0.5 !important;
}
.modal-dialog {
    transform: none !important;
    transition: none !important;
}
/* Prevent table row hover flicker affecting modal */
.table-hover tbody tr:hover {
    background-color: rgba(0,0,0,.02);
}
