:root {
    --primary-color: #3699ff;
    --primary-dark: #187de4;
    --sidebar-bg: #1e1e2d;
    --sidebar-text: #6f7288;
    --sidebar-active: #ffffff;
    --bg-body: #f3f6f9;
    --bg-card: #ffffff;
    --text-main: #3f4254;
    --text-muted: #b5b5c3;
    --success: #1bc5bd;
    --danger: #f64e60;
    --warning: #ffa800;
    --border-radius: 8px;
    --shadow: 0 0 20px 0 rgba(76, 87, 125, 0.02);
    --font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-body);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
}

.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }

.btn {
    padding: 10px 20px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-primary { background-color: var(--primary-color); color: white; }
.btn-primary:hover { background-color: var(--primary-dark); }
.btn-primary:disabled { background-color: #ccc; cursor: not-allowed; }
.btn-outline { background-color: transparent; border: 1px solid #e4e6ef; color: var(--text-main); }
.btn-outline:hover { background-color: #f3f6f9; }
.btn-danger { background-color: var(--danger); color: white; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.font-bold { font-weight: 700; }

.auth-container { display: flex; height: 100vh; width: 100vw; background: white; }
.auth-left { width: 50%; display: flex; flex-direction: column; justify-content: center; padding: 0 15%; background: white; }
.auth-right { width: 50%; background-color: #f3f6f9; background-image: url('https://picsum.photos/seed/office/800/1200'); background-size: cover; background-position: center; position: relative; }
.auth-right::after { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.1); }
.brand-logo { font-size: 24px; font-weight: 800; color: var(--text-main); margin-bottom: 40px; display: flex; align-items: center; gap: 10px; }
.brand-logo i { color: var(--primary-color); }

.form-group { margin-bottom: 20px; }
.form-label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 14px; }
.form-input { width: 100%; padding: 12px 16px; border: 1px solid #e4e6ef; border-radius: 6px; background-color: #f3f6f9; transition: border-color 0.2s; }
.form-input:focus { border-color: var(--primary-color); background-color: white; }
.auth-link { color: var(--primary-color); text-decoration: none; font-size: 13px; font-weight: 600; }
.auth-footer { margin-top: 30px; font-size: 14px; }

.dashboard-container { display: flex; height: 100vh; }
.sidebar { width: 250px; background-color: var(--sidebar-bg); display: flex; flex-direction: column; transition: width 0.3s; flex-shrink: 0; }
.sidebar-header { height: 70px; display: flex; align-items: center; padding: 0 25px; font-weight: 800; color: white; font-size: 20px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.sidebar-nav { padding: 20px 0; flex: 1; }
.nav-item { padding: 12px 25px; color: var(--sidebar-text); text-decoration: none; display: flex; align-items: center; gap: 15px; font-weight: 500; font-size: 15px; transition: all 0.2s; border-left: 3px solid transparent; cursor: pointer; }
.nav-item:hover, .nav-item.active { color: var(--sidebar-active); background-color: rgba(255,255,255,0.05); border-left-color: var(--primary-color); }
.nav-item i { font-size: 18px; width: 20px; text-align: center; }

.main-content { flex: 1; display: flex; flex-direction: column; background-color: var(--bg-body); overflow: hidden; }
.top-bar { height: 70px; background: white; display: flex; align-items: center; justify-content: space-between; padding: 0 30px; box-shadow: var(--shadow); flex-shrink: 0; }
.page-title { font-size: 22px; font-weight: 700; }
.user-profile { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.user-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }

.content-scroll { padding: 30px; overflow-y: auto; flex: 1; }

.server-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 20px; }
.server-card { background: white; border-radius: var(--border-radius); box-shadow: var(--shadow); padding: 25px; position: relative; border: 1px solid transparent; transition: transform 0.2s, box-shadow 0.2s; }
.server-card:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(0,0,0,0.05); }
.server-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 15px; }
.server-status { font-size: 12px; padding: 4px 8px; border-radius: 4px; background: #e8fff3; color: var(--success); font-weight: 600; text-transform: uppercase; }
.server-status.offline { background: #ffe2e5; color: var(--danger); }
.server-name { font-size: 18px; font-weight: 700; color: var(--text-main); margin-bottom: 5px; }
.server-ip { font-size: 13px; color: var(--text-muted); font-family: monospace; }
.card-actions { display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid #f3f6f9; padding-top: 15px; }

.detail-header { background: white; padding: 25px; border-radius: var(--border-radius); margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between; gap: 15px; flex-wrap: wrap; }
.metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-bottom: 20px; }
.metric-card { background: white; padding: 20px; border-radius: var(--border-radius); display: flex; align-items: center; gap: 15px; box-shadow: var(--shadow); }
.metric-icon { width: 50px; height: 50px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.metric-info h4 { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.metric-info span { font-size: 20px; font-weight: 700; color: var(--text-main); }

.php-table { width: 100%; border-collapse: collapse; margin-top: 15px; font-size: 14px; }
.php-table th { text-align: left; padding: 12px; border-bottom: 2px solid #f3f6f9; color: var(--text-muted); font-weight: 600; }
.php-table td { padding: 12px; border-bottom: 1px solid #f3f6f9; }
.php-table tr:hover { background-color: #fafafa; }

dialog { border: none; border-radius: 8px; padding: 0; box-shadow: 0 20px 50px rgba(0,0,0,0.2); width: 520px; max-width: 90%; background: white; margin: auto; max-height: 90vh; overflow-y: auto; }
dialog::backdrop { background: rgba(0, 0, 0, 0.4); backdrop-filter: blur(2px); }
.modal-header { padding: 20px 25px; border-bottom: 1px solid #f3f6f9; display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { font-size: 18px; font-weight: 700; }
.close-modal { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-muted); }
.modal-body { padding: 25px; }
.modal-footer { padding: 15px 25px; background: #f9f9f9; display: flex; justify-content: flex-end; gap: 10px; }

#toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast { background: white; padding: 15px 20px; border-radius: 6px; box-shadow: 0 5px 15px rgba(0,0,0,0.1); display: flex; align-items: center; gap: 12px; min-width: 300px; animation: slideIn 0.3s ease-out; border-left: 4px solid var(--primary-color); }
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.info { border-left-color: var(--primary-color); }
.toast-content h5 { font-size: 14px; margin-bottom: 2px; }
.toast-content p { font-size: 12px; color: var(--text-muted); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

@media (max-width: 768px) {
    .auth-container { flex-direction: column; }
    .auth-left { width: 100%; padding: 20px; }
    .auth-right { display: none; }
    .sidebar { position: absolute; left: -250px; height: 100%; z-index: 100; }
    .sidebar.open { left: 0; }
    .menu-toggle { display: block; cursor: pointer; font-size: 20px; margin-right: 15px; }
    .php-table { display: block; overflow-x: auto; }
    dialog { width: 95%; }
}
@media (min-width: 769px) { .menu-toggle { display: none; } }

