/* ============================================
   FDMS Admin Portal - Custom Styles
   ============================================ */

/* --- Login Page --- */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a5276 0%, #2e86c1 100%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h2 {
    color: #1a5276;
    font-weight: 700;
    margin-bottom: 5px;
}

.login-header p {
    color: #7f8c8d;
    font-size: 14px;
}

/* --- Navigation --- */
.navbar-brand {
    font-weight: 700;
    font-size: 1.2rem;
}

.nav-link {
    font-weight: 500;
    padding: 10px 18px !important;
    border-radius: 6px;
    transition: all 0.3s;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.15);
}

/* --- Cards --- */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.stat-card {
    text-align: center;
    padding: 20px;
}

.stat-card .stat-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #3498db;
}

.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
}

.stat-card .stat-label {
    color: #7f8c8d;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card.bg-primary-light .stat-icon { color: #3498db; }
.stat-card.bg-success-light .stat-icon { color: #27ae60; }
.stat-card.bg-warning-light .stat-icon { color: #f39c12; }
.stat-card.bg-danger-light .stat-icon { color: #e74c3c; }
.stat-card.bg-info-light .stat-icon { color: #1abc9c; }

.bg-primary-light { background: #ebf5fb; }
.bg-success-light { background: #eafaf1; }
.bg-warning-light { background: #fef9e7; }
.bg-danger-light { background: #fdedec; }
.bg-info-light { background: #e8f8f5; }

/* --- Tables --- */
.table-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.table thead th {
    background: #f8f9fa;
    font-weight: 600;
    border-bottom: 2px solid #e9ecef;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

.badge-status {
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.75rem;
}

.badge-status.active { background: #d4edda; color: #155724; }
.badge-status.revoked { background: #f8d7da; color: #721c24; }
.badge-status.expired { background: #fff3cd; color: #856404; }
.badge-status.pending { background: #cce5ff; color: #004085; }
.badge-status.suspended { background: #ffeaa7; color: #6c3a00; }
.badge-status.inactive { background: #e2e3e5; color: #383d41; }

.badge-device {
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.75rem;
}

.badge-device.online { background: #d4edda; color: #155724; }
.badge-device.offline { background: #f8d7da; color: #721c24; }
.badge-device.blocked { background: #f8d7da; color: #721c24; }
.badge-device.new { background: #cce5ff; color: #004085; }

/* --- Buttons --- */
.btn-primary {
    background: #3498db;
    border: none;
    padding: 10px 24px;
    font-weight: 600;
    border-radius: 8px;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-success {
    background: #27ae60;
    border: none;
}

.btn-success:hover {
    background: #219a52;
}

.btn-danger {
    background: #e74c3c;
    border: none;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-warning {
    background: #f39c12;
    border: none;
    color: white;
}

.btn-warning:hover {
    background: #d68910;
    color: white;
}

.btn-outline-secondary {
    border-color: #bdc3c7;
    color: #7f8c8d;
}

.btn-outline-secondary:hover {
    background: #ecf0f1;
    border-color: #bdc3c7;
}

/* --- Forms --- */
.form-control {
    border-radius: 8px;
    padding: 10px 14px;
    border: 2px solid #e9ecef;
}

.form-control:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

.form-label {
    font-weight: 600;
    color: #2c3e50;
}

/* --- Modal --- */
.modal-content {
    border-radius: 12px;
    border: none;
}

.modal-header {
    border-bottom: 2px solid #e9ecef;
    padding: 20px 24px;
}

.modal-footer {
    border-top: 2px solid #e9ecef;
    padding: 16px 24px;
}

/* --- Status Indicators --- */
.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-dot.online { background: #27ae60; }
.status-dot.offline { background: #e74c3c; }
.status-dot.blocked { background: #e74c3c; }
.status-dot.new { background: #3498db; }
.status-dot.active { background: #27ae60; }
.status-dot.revoked { background: #e74c3c; }
.status-dot.expired { background: #f39c12; }

/* --- Responsive --- */
@media (max-width: 768px) {
    .stat-card .stat-number {
        font-size: 1.5rem;
    }
    
    .login-box {
        padding: 30px 20px;
    }
    
    .table-container {
        padding: 10px;
        overflow-x: auto;
    }
}

/* --- Animations --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* --- Loading Spinner --- */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* --- Toast Notifications --- */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9998;
}

.toast-custom {
    background: white;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-left: 4px solid;
    min-width: 300px;
    animation: slideIn 0.3s ease-out;
}

.toast-custom.success { border-color: #27ae60; }
.toast-custom.error { border-color: #e74c3c; }
.toast-custom.warning { border-color: #f39c12; }
.toast-custom.info { border-color: #3498db; }

@keyframes slideIn {
    from { opacity: 0; transform: translateX(100px); }
    to { opacity: 1; transform: translateX(0); }
}