/* ISP Control Panel - Complete Stylesheet */
/* Ready Groep */

:root {
    --primary: #007bff;
    --primary-dark: #0056b3;
    --secondary: #6c757d;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --light: #f8f9fa;
    --dark: #343a40;
    --white: #ffffff;
    --body-bg: #f0f2f5;
    --sidebar-bg: #1a1f36;
    --sidebar-width: 260px;
    --topbar-height: 64px;
    --shadow: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.12);
    --radius: 8px;
    --transition: all 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', system-ui, sans-serif; font-size: 14px; line-height: 1.5; color: var(--dark); background: var(--body-bg); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.app-container { display: flex; min-height: 100vh; }
.main-content { flex: 1; margin-left: var(--sidebar-width); display: flex; flex-direction: column; }
.content { padding: 24px; flex: 1; }

/* Sidebar */
.sidebar { width: var(--sidebar-width); background: var(--sidebar-bg); position: fixed; top: 0; left: 0; height: 100vh; display: flex; flex-direction: column; z-index: 1000; transition: var(--transition); }
.sidebar.collapsed { width: 0; overflow: hidden; }
.sidebar-header { padding: 20px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.logo { display: flex; align-items: center; gap: 12px; color: var(--white); }
.logo-icon { font-size: 28px; }
.logo-text { font-size: 18px; font-weight: 600; }
.sidebar-nav { flex: 1; padding: 16px 0; overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; color: rgba(255,255,255,0.7); cursor: pointer; transition: var(--transition); border-left: 3px solid transparent; }
.nav-item:hover, .nav-item.active { background: rgba(255,255,255,0.08); color: var(--white); border-left-color: var(--primary); }
.nav-item span:first-child { font-size: 18px; }
.nav-divider { height: 1px; background: rgba(255,255,255,0.1); margin: 12px 20px; }
.nav-header { padding: 12px 20px 8px; color: rgba(255,255,255,0.4); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.1); }

/* Topbar */
.topbar { height: var(--topbar-height); background: var(--white); display: flex; align-items: center; padding: 0 24px; box-shadow: var(--shadow); position: sticky; top: 0; z-index: 100; }
.page-title { flex: 1; }
.page-title h1 { font-size: 20px; font-weight: 600; }
.user-menu { display: flex; align-items: center; gap: 12px; }
.user-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color: var(--white); display: flex; align-items: center; justify-content: center; font-weight: 600; }
.user-info { display: flex; flex-direction: column; }
.user-name { font-weight: 600; font-size: 14px; }
.user-role { font-size: 12px; color: var(--secondary); }

/* Cards */
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 24px; }
.card-header { padding: 16px 20px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; }
.card-title { font-size: 16px; font-weight: 600; margin: 0; }
.card-body { padding: 20px; }
.card-footer { padding: 16px 20px; border-top: 1px solid #eee; }

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-bottom: 24px; }
.stat-card { background: var(--white); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 16px; }
.stat-icon { width: 56px; height: 56px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.stat-icon.blue { background: rgba(0,123,255,0.1); color: var(--primary); }
.stat-icon.green { background: rgba(40,167,69,0.1); color: var(--success); }
.stat-icon.red { background: rgba(220,53,69,0.1); color: var(--danger); }
.stat-icon.orange { background: rgba(255,193,7,0.1); color: var(--warning); }
.stat-icon.purple { background: rgba(111,66,193,0.1); color: #6f42c1; }
.stat-info { flex: 1; }
.stat-value { font-size: 28px; font-weight: 700; line-height: 1.2; }
.stat-label { color: var(--secondary); font-size: 13px; }
.stat-change { font-size: 12px; margin-top: 4px; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 6px; border: none; cursor: pointer; font-size: 14px; font-weight: 500; transition: var(--transition); text-decoration: none; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--secondary); color: var(--white); }
.btn-success { background: var(--success); color: var(--white); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-warning { background: var(--warning); color: var(--dark); }
.btn-outline { background: transparent; border: 1px solid #ddd; color: var(--dark); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-outline.btn-danger { border-color: var(--danger); color: var(--danger); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 14px 24px; font-size: 16px; }
.btn-logout { width: 100%; background: rgba(220,53,69,0.1); color: var(--danger); }
.btn-menu { display: none; background: none; border: none; font-size: 24px; cursor: pointer; padding: 8px; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; color: var(--dark); }
.form-control { width: 100%; padding: 10px 14px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; transition: var(--transition); }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,123,255,0.1); }
.form-control.error { border-color: var(--danger); }
select.form-control { appearance: none; background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23333' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E") no-repeat right 12px center; padding-right: 36px; }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-text { font-size: 12px; color: var(--secondary); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-row { display: flex; gap: 16px; }
.form-row > * { flex: 1; }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid #eee; }
.table th { background: var(--light); font-weight: 600; font-size: 13px; color: var(--secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.table tr:hover { background: #fafbfc; }
.table .actions { white-space: nowrap; }
.table .actions .btn { margin-right: 4px; }

/* Badges */
.badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.badge-primary { background: rgba(0,123,255,0.1); color: var(--primary); }
.badge-success { background: rgba(40,167,69,0.1); color: var(--success); }
.badge-danger { background: rgba(220,53,69,0.1); color: var(--danger); }
.badge-warning { background: rgba(255,193,7,0.2); color: #856404; }
.badge-info { background: rgba(23,162,184,0.1); color: var(--info); }
.badge-secondary { background: rgba(108,117,125,0.1); color: var(--secondary); }

/* Status Indicators */
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 8px; }
.status-dot.online { background: var(--success); }
.status-dot.offline { background: var(--danger); }
.status-dot.unknown { background: var(--secondary); }

/* Modals */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); display: none; align-items: center; justify-content: center; z-index: 2000; padding: 20px; }
.modal-overlay.show { display: flex; }
.modal { background: var(--white); border-radius: var(--radius); width: 100%; max-width: 500px; max-height: 90vh; overflow: hidden; display: flex; flex-direction: column; }
.modal.modal-lg { max-width: 800px; }
.modal.modal-sm { max-width: 400px; }
.modal-header { padding: 16px 20px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { font-size: 18px; font-weight: 600; margin: 0; }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--secondary); padding: 4px; line-height: 1; }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 16px 20px; border-top: 1px solid #eee; display: flex; justify-content: flex-end; gap: 12px; }

/* Toast Notifications */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 3000; display: flex; flex-direction: column; gap: 12px; }
.toast { padding: 14px 20px; border-radius: 8px; background: var(--dark); color: var(--white); box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 12px; min-width: 300px; animation: slideIn 0.3s ease; }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); color: var(--dark); }
.toast.info { background: var(--info); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Tabs */
.tabs { display: flex; border-bottom: 2px solid #eee; margin-bottom: 20px; }
.tab { padding: 12px 20px; cursor: pointer; color: var(--secondary); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: var(--transition); }
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Alerts */
.alert { padding: 14px 18px; border-radius: 6px; margin-bottom: 16px; display: flex; align-items: flex-start; gap: 12px; }
.alert-success { background: rgba(40,167,69,0.1); color: #155724; border-left: 4px solid var(--success); }
.alert-danger { background: rgba(220,53,69,0.1); color: #721c24; border-left: 4px solid var(--danger); }
.alert-warning { background: rgba(255,193,7,0.1); color: #856404; border-left: 4px solid var(--warning); }
.alert-info { background: rgba(23,162,184,0.1); color: #0c5460; border-left: 4px solid var(--info); }

/* Empty State */
.empty-state { text-align: center; padding: 60px 20px; color: var(--secondary); }
.empty-state-icon { font-size: 64px; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 20px; margin-bottom: 8px; color: var(--dark); }
.empty-state p { margin-bottom: 20px; }

/* Loading */
.loading { display: flex; align-items: center; justify-content: center; padding: 40px; }
.spinner { width: 40px; height: 40px; border: 3px solid #eee; border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Utility */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--secondary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary); }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.hidden { display: none !important; }

/* Login Page */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1a1f36 0%, #0d1025 100%); padding: 20px; }
.login-card { background: var(--white); border-radius: 16px; padding: 40px; width: 100%; max-width: 400px; box-shadow: var(--shadow-lg); }
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo .logo-icon { font-size: 48px; display: block; margin-bottom: 12px; }
.login-logo h1 { font-size: 24px; color: var(--dark); margin-bottom: 4px; }
.login-logo p { color: var(--secondary); }
.login-form .form-group { margin-bottom: 20px; }
.login-form .btn { width: 100%; padding: 14px; font-size: 16px; }
.login-footer { text-align: center; margin-top: 24px; color: var(--secondary); font-size: 13px; }

/* Responsive */
@media (max-width: 992px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .btn-menu { display: block; }
    .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .content { padding: 16px; }
    .stats-grid { grid-template-columns: 1fr; }
    .topbar { padding: 0 16px; }
    .modal { margin: 10px; max-height: calc(100vh - 20px); }
    .form-row { flex-direction: column; }
}
