* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #126fb9;
    --primary-dark: #168be8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-500: #6b7280;
    --gray-700: #374151;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    min-height: 100vh;
}

.login-container { display: flex; justify-content: center; align-items: center; min-height: 100vh; padding: 20px; }
.login-box { background: white; border-radius: 20px; padding: 40px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); max-width: 400px; width: 100%; }
.login-header { text-align: center; margin-bottom: 30px; }
.icon-large { font-size: 48px; margin-bottom: 10px; }
.login-header h1 { color: var(--primary); font-size: 28px; margin-bottom: 10px; }
.subtitle { color: var(--gray-500); font-size: 14px; }
.portal-badge { display: inline-block; padding: 6px 16px; border-radius: 20px; font-size: 12px; font-weight: 600; margin-bottom: 10px; }
.badge-customer { background: #dbeafe; color: #1e40af; }
.badge-staff { background: #fce7f3; color: #9f1239; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; color: var(--gray-700); font-weight: 500; font-size: 14px; }
.form-group input, .form-group select { width: 100%; padding: 12px 15px; border: 2px solid var(--gray-200); border-radius: 10px; font-size: 14px; }
.form-group input:focus, .form-group select:focus { outline: none; border-color: var(--primary); }
.btn { width: 100%; padding: 14px; border: none; border-radius: 10px; font-size: 16px; font-weight: 600; cursor: pointer; transition: all 0.3s; }
.btn-primary { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: white; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3); }
.btn-secondary { background: var(--gray-100); color: var(--gray-500); }
.error-message { background: #fee2e2; color: #991b1b; padding: 12px; border-radius: 8px; margin-bottom: 15px; font-size: 14px; }
.success-message { background: #d1fae5; color: #065f46; padding: 12px; border-radius: 8px; margin-bottom: 15px; font-size: 14px; }
.container { max-width: 1400px; margin: 0 auto; padding: 20px; }
.header { background: white; border-radius: 20px; padding: 20px 30px; margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.header h1 { color: var(--primary); font-size: 24px; }
.brand { display: flex; align-items: center; gap: 15px; }
.brand > div:first-child { font-size: 32px; }
.user-info { display: flex; align-items: center; gap: 15px; }
.user-avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); display: flex; align-items: center; justify-content: center; color: white; font-weight: 600; }
.nav-tabs { background: white; border-radius: 20px; padding: 10px; margin-bottom: 20px; display: flex; gap: 10px; overflow-x: auto; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.nav-tab { padding: 12px 24px; border: none; background: transparent; color: var(--gray-500); font-size: 14px; font-weight: 600; border-radius: 12px; cursor: pointer; white-space: nowrap; }
.nav-tab.active { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: white; }
.content { background: white; border-radius: 20px; padding: 30px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.tab-content { display: none; }
.tab-content.active { display: block; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-bottom: 30px; }
.stat-card { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: white; padding: 25px; border-radius: 15px; box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3); }
.stat-card h3 { font-size: 14px; opacity: 0.9; margin-bottom: 10px; }
.stat-card .value { font-size: 32px; font-weight: 700; }
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { background: var(--gray-50); padding: 15px; text-align: left; font-weight: 600; color: var(--gray-700); font-size: 14px; }
td { padding: 15px; border-bottom: 1px solid var(--gray-200); font-size: 14px; color: var(--gray-500); }
.badge { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }
.action-btn { padding: 6px 12px; border: none; border-radius: 6px; font-size: 12px; cursor: pointer; margin-right: 5px; }
.action-btn-primary { background: var(--primary); color: white; }
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 20px; }
.modal.active { display: flex; }
.modal-content { background: white; border-radius: 20px; padding: 30px; max-width: 800px; width: 100%; max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-header h2 { color: var(--primary); }
.close-modal { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--gray-500); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; }
.info-card { background: var(--gray-50); padding: 20px; border-radius: 12px; margin-bottom: 20px; }
.info-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--gray-200); }
.info-row:last-child { border-bottom: none; }
.info-label { font-weight: 600; color: var(--gray-700); }
.info-value { color: var(--gray-500); }
.realm-badge { display: inline-block; padding: 6px 12px; border-radius: 8px; font-size: 12px; font-weight: 600; }
.realm-knbb { background: #dbeafe; color: #1e40af; }
.realm-ljn { background: #fce7f3; color: #9f1239; }
.realm-tia { background: #dcfce7; color: #166534; }
.checkbox-group { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; }
.toggle-switch { position: relative; display: inline-block; width: 50px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: 0.4s; border-radius: 24px; }
.toggle-slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: 0.4s; border-radius: 50%; }
input:checked + .toggle-slider { background-color: var(--success); }
input:checked + .toggle-slider:before { transform: translateX(26px); }
.api-status { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.api-connected { background: #d1fae5; color: #065f46; }
@media (max-width: 768px) {
    .header { flex-direction: column; gap: 15px; }
    .stats-grid { grid-template-columns: 1fr; }
    .grid-2 { grid-template-columns: 1fr; }
}