* { box-sizing: border-box; }
body { background: #f0f2f5; font-family: 'Segoe UI', sans-serif; }
.login-container { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.login-card { width: 100%; max-width: 380px; padding: 2rem; background: #fff; border-radius: 1rem; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.login-card .brand { text-align: center; margin-bottom: 1.5rem; }
.login-card .brand i { font-size: 2.5rem; color: #667eea; }
.login-card .brand h3 { margin-top: 0.5rem; color: #333; font-size: 1.3rem; }

.app-wrapper { display: flex; min-height: 100vh; }
.sidebar {
    width: 220px;
    background: #1e2a3a;
    color: #cbd5e0;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    font-size: 1.0rem;
}
.sidebar .brand {
    padding: 0.8rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    border-bottom: 1px solid #2d3a4a;
    text-align: center;
}
.sidebar .brand i { margin-right: 6px; color: #64b5f6; }
.sidebar .nav { flex: 0 0 auto; padding: 0.5rem 0; }
.sidebar .nav-footer { flex: 0 0 auto; }
.sidebar .nav-divider { height: 1px; background: #2d3a4a; margin: 0.3rem 1rem; }
.sidebar .nav-item {
    padding: 0.6rem 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    color: #a0b4c8;
    transition: all 0.15s;
    border-left: 2px solid transparent;
    text-decoration: none;
    font-size: 1rem;
}
.sidebar .nav-item i { width: 20px; margin-right: 8px; font-size: 0.9rem; }
.sidebar .nav-item:hover,
.sidebar .nav-item.active {
    background: #2d3a4a;
    color: #fff;
    border-left-color: #64b5f6;
}
.sidebar .logout {
    padding: 0.6rem 1.2rem;
    border-top: 1px solid #2d3a4a;
    color: #e2a3a3;
    cursor: pointer;
    font-size: 1rem;
    margin-top: auto;
}

.main-content { flex: 1; padding: 1rem 1.5rem; background: #f0f2f5; overflow-y: auto; }
.top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; background: #fff; padding: 0.5rem 1rem; border-radius: 0.5rem; box-shadow: 0 2px 4px rgba(0,0,0,0.04); font-size: 0.9rem; }
.top-bar .page-title { font-weight: 600; color: #1e293b; }
.top-bar .user-info { display: flex; align-items: center; gap: 10px; }
.top-bar .user-info .avatar { width: 28px; height: 28px; border-radius: 50%; background: #667eea; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 0.75rem; }

.card { border: none; border-radius: 0.5rem; box-shadow: 0 2px 8px rgba(0,0,0,0.06); margin-bottom: 1rem; }
.card-header { background: #fff; border-bottom: 1px solid #edf2f7; font-weight: 600; padding: 0.6rem 1rem; font-size: 0.95rem; }
.card-body { padding: 1rem; }
.badge-status { padding: 0.2rem 0.6rem; border-radius: 2rem; font-weight: 500; font-size: 0.7rem; }
.badge-status.active { background: #d4edda; color: #155724; }
.badge-status.inactive { background: #f8d7da; color: #721c24; }
.app-item { cursor: pointer; transition: background 0.1s; }
.app-item:hover { background: #f8f9fa; }
.hidden { display: none !important; }
@media (max-width: 768px) { .sidebar { width: 50px; } .sidebar .brand span, .sidebar .nav-item span { display: none; } }

.modal-dialog { max-width: 700px; }
#userAppsBody .list-group-item { flex-wrap: wrap; gap: 8px; }
#userAppsBody .app-info { flex: 1 1 100%; word-break: break-all; }
#userAppsBody .app-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
#userAppsBody .form-check-label { white-space: nowrap; }
#appDetailUnpackIPInput, #appDetailClientMaxInput { font-family: monospace; }